-
Twitter API Snowflake and MySQL
Posted on November 13th, 2010 2 commentsI’ve been looking at APIs lately, and in particular, the Twitter API.
I managed to stumble into an advanced discussion on the Twitter developer forums about Twitter’s “Snowflake” update. One of the primary changes of the Snowflake update is the use of 64-bit integers for their ID.
As a PHP & MySQL developer interested in learning more about the Twitter API, I want my database schema to be optimized properly.
On this page of the MySQL website, it says, in part:
Some things you should be aware of with respect to
BIGINTcolumns:- All arithmetic is done using signed
BIGINTorDOUBLEvalues, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting aBIGINTvalue to aDOUBLE.
Does that mean I cannot use a BIGINT to store a Tweet’s primary key?
Surely VARCHAR(64) will be much slower…
2 responses to “Twitter API Snowflake and MySQL”

-
Actually I believe BIGINT UNSIGNED works fine for storing 64-bit integers.
-
Maddy June 26th, 2011 at 06:22
Good Day, professional Weblog, i can only recommend! I have bookmarked for future reference! Greetings
Leave a reply
- All arithmetic is done using signed



Funny Pug Photos November 19th, 2010 at 00:22