Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storage of facebook user id

Is there a maximum value to the id of a facebook user ?

I was using an SQL integer to store the value but it's not enough as I've encountered an id with 15 digits.

I'm guessing there is none (would be logical...) and that the equivalent of a big integer is being used ? So should I just switch to varchar(255) ?

like image 653
James P. Avatar asked Dec 12 '22 22:12

James P.


1 Answers

Facebook once recommended that you store your user_id values as strings (can't find the reference anywhere now). The documentation also says that the user_id value is a string.

In my experience, the user_id can be a bigint(20) value but I think it's a good idea to store it as a string to try prevent any possible future changes from messing with my applications. In any case, no numerical operations are really needed on the actual user_id; It's just a unique identifier. Make sure you use it as an index in your database's users table so that there will be no chance of duplicate user_ids.

like image 60
Lix Avatar answered Dec 24 '22 22:12

Lix