Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Google Plus user id's are such big integers, even it's bigger than bigint on MySQL?

I was wondering today why google decided to do this for the google plus platform. I know I can handle these id's using varchars in mysql, but it's a bit weird to me why google decided to go for such big integers. An example google plus id is like this: 117634089072667507999

It's a very big integer which is out of the range of unsigned bigint on Mysql. Even with a big integer on mysql, it would take thousands of years to reach the limit of the id though there were millions of users signing in for google plus every second. So my question is, why did google choose such big integers?

like image 860
Masum Avatar asked Mar 11 '12 17:03

Masum


People also ask

When should I use BIGINT in MySQL?

BIGINT is the MySQL data type that can be assigned to the columns of the table in which we want to store the whole numbers and we are aware that the range of the numbers that we will store in that column will be huge and not exceed the range of the BIGINT data type.

How big is a BIGINT?

A big integer is a binary integer with a precision of 63 bits. The range of big integers is -9223372036854775808 to +9223372036854775807.


1 Answers

Probably to allow them to use non-sequential IDs so that you can't deduce anything by comparing user IDs.

You should store them as strings, since you aren't using them as numbers (just like zip codes or phone numbers).

like image 107
SLaks Avatar answered Sep 30 '22 07:09

SLaks