Twitter Announces "Snowflake" for Unique Tweet IDs
engineering.twitter.com
engineering.twitter.com
// Tue, 21 Mar 2006 20:50:14.000 GMT
val twepoch = 1142974214000L
According to the README they can fit 69 years worth of timestamps in 41 bits with the custom epoch, since they don't care about any times that happened before Twitter launched.Apparently the best google-fu effort only yields #20: http://twitter.com/jack/status/20
Much like how we (reddit) are using it for a chunk of our data, but we still have Postgres as our canonical source.
We are however moving slowly towards more Cassandra.
Maybe Availability was all that was chosen? And it's doomed in a mere some-billion years anyway...
Of course, that is probably too much for twitter who just needs to Get It Done, but I find such things interesting to think about.
"Used in the Internet of today with computers ranging from personal workstations to supercomputers, NTP provides accuracies generally in the range of a millisecond in LANs and up to a few tens of milliseconds in the global Internet"
But this is news to me, interesting:
"When kernel support for precision timing signals, such as a pulse-per-second (PPS) signal, is available the accuracy can be improved ultimately to the order of one nanosecond in time and one nanosecond per second in frequency."
http://www.cubinlab.ee.unimelb.edu.au/radclock/
more information about the accuracy is available there :
http://www.cubinlab.ee.unimelb.edu.au/radclock/performance.p...
When looking at it, I was a bit dubious until we made some tests at work and compared it with our current NTP using GPS IRIG-B receiver. Even for disconnect period longer than 48 hours, we had a small drift (around 200 nanoseconds) compared to traditional NTP.
The only drawback is that you need a kernel path to make it works.
Not sure about anyone else but it makes my mind boggle!
Oh well, at least it was a fun hack.
Remember: Twitter is nothing new. We have done massively distributed messaging since the 70s. It's called e-mail.
Although it should be easy for client applications to sort on time instead of id, that's not what all applications do. Twitter chose not to break clients that sort on id.
Sure, except for the stated design goal of being backwards compatible with code which expects a 64-bit ID and uses that value for sorting posts.
Your solution violates the listed requirements that the ID is 64 bits and the IDs need to be roughly sortable.