Table of contents
Flake ids are represented in 64-bit unsigned integers. Ids can be broken down into three components:
- Bucket: A 10-bit bucket id for sharding ids over 1024 different buckets.
- Timestamp: A 42-bit millisecond encoded timestamp of when the id was generated.
- Sequence: A 12-bit incrementing sequence number that is reset at each timestamp increment.
With this formation, flake can generate 4096 unique ids per millisecond per bucket, or in other words, 4 billion unique ids per second. For reference, YouTube gets about 75 thousand unique views per second.
Contributions are very much welcomed. Please read the Contribution Guide for how to get started.
Note that all contributors are expected to follow the Code of Conduct.