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?
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.
A big integer is a binary integer with a precision of 63 bits. The range of big integers is -9223372036854775808 to +9223372036854775807.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With