What datatype facebook uses to store userid, what should be that best data type for such field performance and scalability perspective.
If one uses int 4 bytes then i gu
Use BIGINT(64) to store Facebook User IDs in MySQL Database Table.
Here you go: https://developers.facebook.com/blog/post/45/
Good question. Facebook IDs can lead to problems as well as Tweet IDs. Both exceed the 32bit integer range. Depending on programming language specifics and the purpose (e.g. database, code, etc.) you may want to use float or double but in my experience casting them to string is satisfactory.
In MySQL, as tagged, provided is the BIGINT data type, which is large enough to store these IDs as numbers. The tricky part is when you read these values and process them in your program code. Those that are greater than the maximum allowed by system architecture / programming language may cause errors or be truncated leading to inconsistency.
If you want to use fixed length large IDs in MySQL, a good practice is to use the CHAR type and HEX format or you can use the UUID format.