Snowflake ID design

The core idea

A Snowflake-style generator packs time, a worker identity and a sequence into one integer.

Assigned workers can generate locally, while the time prefix makes their values roughly sortable by generation time.

In this lesson

  • Give each field a fixed range
  • Fill one millisecond
  • Worker assignment is part of correctness
  • Keep every bit through serialization

Continue reading

Pro unlocks video lessons, visual walkthroughs, full notes, diagrams, case studies, and implementations across the System Design archive.