Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the max. length of a Facebook uid?

I've seen multiple sizes and I don't want to waste server memory on a MySQL field which is reserving too much space for too many characters. What's the biggest they can get and will this ever change?

like image 688
Farid El Nasire Avatar asked Sep 27 '11 09:09

Farid El Nasire


People also ask

What is Facebook UID number?

Facebook unique ID number or your User ID is a string of numbers that does not personally identify you but does connect to your Facebook profile. You have a User ID automatically, whether or not you choose to create a username. Anyone with the user ID can see your profile, including any public information know more.

How long can Facebook names be?

Facebook maximum character limits Besides posts and ads, Facebook also has character limits for usernames, Page descriptions and comments: Username character limit – at least 5 characters and up to 50 characters. Page description – 255 Characters. Facebook comments – 8,000 Characters.


2 Answers

This is how integer overflows, integer->string migrations etc happen, by making datatypes too restrictive. Splash out on a few bytes for a 128b varchar and save yourself the hassle down the road. If your user base gets so massive that you need to be worrying about how many bytes you will save by crunching data types of UIDs, consider yourself a huge success and that is a problem you will be happy to solve.

Short answer, I dont think anyone will be able to answer your question, "ever" is a long time and who knows how many entities facebook will have enslaved by then.

I'll end with a quote from one who said it best;

We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. —Donald E. Knuth 
like image 145
markdsievers Avatar answered Sep 27 '22 00:09

markdsievers


How could you ever be sure that this will never change? Better make it a varchar.

like image 20
Johan Kotlinski Avatar answered Sep 26 '22 00:09

Johan Kotlinski