Facebook user id storage

Maximum value for facebook user id?

I used an integer SQL to store the value, but this is not enough, as I ran into an identifier with 15 digits.

I assume that no (it will be logical ...) and that the equivalent of a large integer is used? So should I just switch to varchar (255)?

+4
source share
2 answers

Facebook once recommended saving your user_id values ​​as strings (now you cannot find the link anywhere). The documentation also states that user_id is a string.

In my experience, the value of user_id may be the value of bigint(20) , but I think it is a good idea to save it as a string in order to try to prevent any possible future changes from messing with my applications. In any case, no numerical operations are required on the actual user_id ; This is just a unique identifier. Make sure you use it as an index in the database user table so that it is not possible to duplicate user_ids.

+10
source

From Java Practices , it’s a good idea to keep the facebook user ID in line for the reasons mentioned in this tip. You can define an index in this field for faster filtering, and I think you are not going to perform any queries with a numeric type in these user IDs.

+3
source

Source: https://habr.com/ru/post/1434393/


All Articles