3 ms·
This is an interesting topic -- and I'm super-excited that Salvatore is working on Disque! Below are a few methods I've seen for UIDs. Setup used by MongoDB[1
by sandstrom 11y ago
This is an interesting topic -- and I'm super-excited that Salvatore is working on Disque!
Below are a few methods I've seen for UIDs.
Setup used by MongoDB[1]:
[ time, machine_id, process_id, counter ]
Twitter Snowflake[2] use something similar to the above.
Cassandra[3] use something like this:
[ time, version, variant, counter, node_id ]
Flickr on their ticket-DB[4] and Instagram on their setup[5].
---
[1] https://github.com/mongodb/bson-ruby/blob/master/lib/bson/object_id.rb#L372 https://github.com/mongodb/bson-ruby/blob/master/lib/bson/ob...
[2] https://blog.twitter.com/2010/announcing-snowflake https://blog.twitter.com/2010/announcing-snowflake
[3] http://wiki.apache.org/cassandra/TimeBaseUUIDNotes http://wiki.apache.org/cassandra/TimeBaseUUIDNotes
[4] http://code.flickr.net/2010/02/08/ticket-servers-distributed-unique-primary-keys-on-the-cheap/ http://code.flickr.net/2010/02/08/ticket-servers-distributed...
[5] http://instagram-engineering.tumblr.com/post/10853187575/sharding-ids-at-instagram http://instagram-engineering.tumblr.com/post/10853187575/sha...