Randflake ID
lastmod 2024-12-11created 2024-12-111 edits
A distributed, uniform, unpredictable, unique random ID generator
Randflake ID is a 64-bit unique identifier generation system that can be used in distributed environments.
Key features
- Unpredictability: uses a block cipher so the next/previous ID cannot be predicted
- Guaranteed uniqueness: combines a timestamp, node ID, and sequence number
- Distributed environment support: supports up to 131,072 nodes
- High throughput: can generate up to 17,179,869,184 IDs per second
Structure
- Timestamp: 30 bits
- Node ID: 17 bits
- Sequence: 17 bits
Pros
- Generates unique IDs without database lookups
- Uniform distribution makes it usable as a sharding key
- Provides internal tracing (limited to holders of the secret key)
Applications
A lease-based node ID coordination mechanism lets it run efficiently in distributed systems, making it suitable for global-scale applications.