Overview of UidGenerator
masterUidGenerator is a Java-based unique ID generator implementing the Snowflake algorithm. It is designed as a component for application projects and supports custom workerId bit lengths and initialization strategies, making it suitable for virtualized environments like Docker where instances may restart or drift.
Key features:
- Uses future time to overcome the concurrency limits of the sequence.
- Employs a
RingBufferto cache generated UIDs, parallelizing production and consumption. - Uses CacheLine padding to avoid hardware-level 'false sharing' issues.
- Achieves a single-machine throughput of approximately 6 million QPS.