4 ms·
Wasn't this method already popularized (basically) by twitter's simpleflake/snowflake? https://news.ycombinator.com/item?id=7764254 https://news.ycombinator.co
by jack9 11y ago
Wasn't this method already popularized (basically) by twitter's simpleflake/snowflake?
https://news.ycombinator.com/item?id=7764254 https://news.ycombinator.com/item?id=7764254
- geofft 11y agoTwitter Snowflake has the additional requirements of being mostly chronologically sorted (events at least 1s apart, and preferably 10ms apart, should have IDs in the right sort order) and using 64-bit IDs, which make the problem harder. If you're happy to use random, 128-bit IDs, /dev/urandom solves the problem of unique IDs, and very easily fits the performance numbers Snowflake promises without even trying (they want 10k IDs per second and 2ms latency; /dev/urandom on my three-year-old machine does 700k IDs per second and 14µs latency in read()).