I'm using the term "quantum" to refer to the smallest representable unit of time. In the case of noeq/snowflake, this is one millisecond. There is a per quantum counter of 4096. If no values are allocated in a given quantum, those values cannot be used and thus are "wasted". Conversely, if more than 4096 values are required within a quantum, you'll need to wait for the next quantum to allocate more. Of course, this is all per machine, so with up to 1024 machines, you can generate billions per second (theoretically, of course: 1024 machines * 4096 sequence * 1000ms/s).

This is great if you require ids that need to be sorted by time and are generating thousands per second. It's not so great if you're allocating 4 billions ids today and zero tomorrow.


Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 14 of 16 | next ›
Discussion Overview
groupgolang-nuts @
postedDec 2, '12 at 1:03p
activeDec 11, '12 at 9:52p



site design / logo © 2021 Grokbase