Quartz 4

Home

❯

Unique ID Generation

Unique ID Generation

Nov 14, 20251 min read

  • distributed-system

Snowflake from Twitter

Source code: https://github.com/twitter-archive/snowflake/tree/snowflake-2010

  • ID is composed of:
    • time - 41 bits (millisecond precision w/ a custom epoch gives us 69 years)
    • configured machine ID - 10 bits - gives us up to 1024 machines
    • sequence number - 12 bits - rolls over every 4096 per machine (with protection to avoid rollover in the same ms)
  • System Clock Dependency

Graph View

Backlinks

  • Design system interview

Created with Quartz v4.5.2 © 2025

  • GitHub
  • Discord Community