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

梦想的初衷 提交于 2019-11-29 02:12:13

问题


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?


回答1:


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



回答2:


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




回答3:


Currently, Facebook UIDs are 64 bits integers. But I can't guarantee that won't change one day.




回答4:


The Facebook UID will never change because it is a unique identifier in their database. If it changed then facebook would cease to work



来源:https://stackoverflow.com/questions/7566672/whats-the-max-length-of-a-facebook-uid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!