Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it safe to store Tweet IDs as BIGINTs?

Tags:

mysql

twitter

Moving forwards, am I going to have a problem at some point if I store Tweet IDs from the Twitter API as an unsigned BIGINT in MySQL?

Am I better off using a CHAR(25) or something? The Tweet IDs are only going to get bigger and bigger over time.

like image 557
bcmcfc Avatar asked Jun 02 '11 10:06

bcmcfc


1 Answers

an unsigned bigint can hold a value in the range of 0 to 18446744073709551615 (a really big number)

if there are say approx. 52 billion tweets per year then:

18446744073709551615 / 52000000000 = 354745078 years worth of tweets

so I think you'd be safe :P

like image 119
Jon Black Avatar answered Sep 28 '22 13:09

Jon Black