Snowflake

Unique ID generation scheme in distributed systems.

Feature

Unique ID generator
Green pluggable, without external storage like Redis or MySQL
Suitable for distributed systems

Description

1-bit Reserve (always 0)
41-bits Time (millisecond precision w/ a custom epoch gives us 69 years)
10-bits Configured machine id (gives us up to 1024 machines)
12-bits Sequence number (rolls over every 4096 per machine)

Performance

minimum 10k ids per second per process
response rate 2ms (plus network latency)

Limition

Solution