Part 1 of 7 · 1 min read
Why this page comes second in Level 10
In this module you will
- Say why a single database counter is not enough for a large system.
- Compare four designs: multi-master counters, UUID, a ticket server and the snowflake layout.
- Split a 64-bit ID into time, place and sequence, and compute how many IDs and how many years it holds.
- Name the dangers: clocks that move back, duplicate machine numbers, and running out of bits.
- Tune the bit split for a different need.
Almost every later case study needs IDs for posts, messages, orders or files. This page is short and arithmetic-heavy, which makes it a good place to practise "numbers first". It also leads straight into the clock problems of Level 5. The book used is "System Design Interview" by Alex Xu, chapter 7. The numbers marked "made up" only show the idea. The bit arithmetic below was checked with a small script.