

Twitter's UID associated to each tweet will very soon exceed 2,147,483,647 - timothychung
http://www.twitpocalypse.com/

======
drawkbox
Always use a UUID or GUID (same thing) in todays web applications. When we get
to terrabytes of data as the norm for apps int based keys are going to seem so
ancient.

Sure it takes more room but space it cheap, and it makes syncing and
distributed databases so much easier (not tied to one machine or cluster)

------
dpcan
I figure many twitter apps are written with SQLite as their database (in AIR,
etc) so the Integer, Primary Key, can get up to 9223372036854775807

<http://www.sqlite.org/faq.html>

What is the point of creating a website like this?

------
lallysingh
Anyone notice the footnote on the estimated time of crossing?

"3 the average tweets per second and the Twitpocalypse date are a rough
approximation, please do not schedule any vacation around that date"

------
ivankirigin
Maybe I'm just paranoid, but I index the tweet id's in Tipjoy with a string:
tweetId = models.CharField(max_length=50, db_index=True)

------
Steve0
Meh, anyone who's coding for this platform must have put those id's in a
unsigned integer, wouldn't they?

~~~
patio11
I suspect for a lot of people coding against Twitter the notion of integers
being signed or unsigned is about as foreign to their experience as pointer
arithmetic. I do not consider that a bad thing.

irb > "2,147,483,647".gsub(",","").to_i + 1

2147483648

(Forgive the extra code necessary to strip out the commas. The Windows irb
console leaves a little to be desired in terms of midline editing.)

~~~
there
you know ruby supports _ as a comma separator, right?

irb(main):002:0> 2_147_483_647 + 1

=> 2147483648

------
cl3m
More at [http://blog.programmableweb.com/2009/06/09/the-
twitpocalypse...](http://blog.programmableweb.com/2009/06/09/the-
twitpocalypse-is-near-will-your-twitter-client-survive/)

------
pierrefar
It's actually sooner. They assume 83 tweets per second (reference 2) but the
number is 200 tweets per second:
[http://friendfeed.com/scobleizer/50e673d8/some-stats-from-
tw...](http://friendfeed.com/scobleizer/50e673d8/some-stats-from-twitter-
conference-compared-to)

~~~
m_eiman
From the link:

"Twitter is seeing about 200 tweets per second, during peak loads. - Robert
Scoble"

Note "during peak loads", so 83 is probably not too far off.

~~~
pierrefar
Fair enough. Do we have any solid references of the actual average rate of
tweets?

~~~
m_eiman
I haven't seen one, but it's easy enough to get it. Just check the UID of the
latest tweet on the public timeline, wait a week and check again.

------
DrJokepu
In the age of multicore 64 bit CPUs, they're not using signed 32 bit integers
as primary key, do they?

~~~
thristian
To be fair, they say "For some of your favorite third-party Twitter services
not designed to handle such a case..." rather than accusing Twitter themselves
of primary-key ineptitude.

------
charlesju
I'm going to put money down that this will not affect anything.

------
TweedHeads
ALTER TABLE twits MODIFY COLUMN twitid BIGINT UNSIGNED NOT NULL

There, fixed, send check for $20 to donations@redcross.org

Call me back when they reach 18446744073709551615

~~~
fleaflicker
That command will take several hours to complete and write lock the table.

~~~
jsonscripter
Why can't you just redirect the writes to a new temporary table and join the
original and temporary on reads? (I'm not a database admin)

~~~
karanbhangui
I'm actually interested in this answer as well. I know of a company using a
proprietary db and now that their growth has literally exploded, they're stuck
with it.

~~~
jsonscripter
I wonder what literally exploding growth looks like...

------
sho
That is quite an amazingly high number. Surely 100m people have not posted
2,000 "tweets" each.

I wonder what proportion of the total is human-typed, and how much is machine
generated?

~~~
cperciva
_Surely 100m people have not posted 2,000 "tweets" each._

Two billion tweets would be 1M people posting 2k tweets each, or 100M people
posting 20 tweets each.

~~~
sho
Oh. Oops. Of course you are right. That was pretty dumb of me : /

