System Design

Twitter Snowflake: 64-Bit Unique ID Generation

System Design diagram · made in Skemio

Architecture diagram of Twitter Snowflake showing 64-bit allocation with timestamp, worker ID, and sequence counter coordinated across workers.
Architecture diagram of Twitter Snowflake showing 64-bit allocation with timestamp, worker ID, and sequence counter coordinated across workers.

What it shows

  • 41 timestamp bits ensure 69 years of millisecond-precision ordering.
  • 10 machine ID bits allow 1,024 independent distributed worker nodes.
  • 12 sequence bits permit up to 4,096 unique IDs per millisecond per node.

The takeaway

K-ordered 64-bit integers index cleanly in B-Trees without DB bottlenecks.

More system design diagrams