01Chapter 1: Why unique IDs are hard when nodes cannot coordinateEvery record in a system needs a name: an order, a user, a message, a log line. On one machine with one database, naming is easy. The database hands out 1, 2, 3, and so on. The problem changes once several machines create records at the same time and cannot cheaply ask each other what is already tak7 min read
02Chapter 2: What to ask of an ID: uniqueness, ordering, size, and coordinationThis chapter assumes you can read basic Python, know what a primary key and a B-tree index are, can follow bit shifting, and have a rough idea of a distributed system (several nodes, network calls, partial failure). It does not cover specific schemes in depth. Later chapters do that. Here you build 8 min read
03Chapter 3: Central counters and auto-increment: simple, but a bottleneckThis chapter assumes you know Python, relational primary keys and indexes, and the basic shape of a distributed system: several nodes, network calls, and partial failure. The previous chapters set out why unique IDs are hard and what to ask of an ID scheme. Here we look at the most obvious answer, o7 min read
04Chapter 4: Handing out blocks of IDs to reduce coordinationThis chapter assumes you have read the previous chapter on central counters. You should know why a single database sequence is simple but becomes a bottleneck and a single point of failure. It also assumes you can read basic Python and SQL.7 min read
05Chapter 5: Random IDs and UUID v4: no coordination neededThis chapter assumes you know what a primary key is and how to read a 128-bit value in hexadecimal. It also assumes you can run short Python scripts. Earlier chapters covered why counters need coordination. Here you will see how random IDs remove that need, what a UUID v4 contains, and which mistake6 min read
06Chapter 6: How likely is a collision? The birthday boundThis chapter assumes you know what a UUID v4 is and why random IDs avoid coordination (the previous chapter). You should be comfortable with powers of two, basic probability, and reading short Python. No statistics background is needed beyond that.8 min read
07Chapter 7: Why random keys hurt B-tree indexesThis chapter assumes you know what a primary key and an index are, and that you have a rough picture of a balanced tree. It also assumes you have read the earlier chapters on random IDs and UUID v4. Random IDs need no coordination, but they have a cost inside the database. Here you will see where th7 min read
08Chapter 8: Time-ordered IDs: UUID v7 and ULIDThis chapter assumes you know what a B-tree index is, can read bit-shift expressions in Python, and have seen the collision estimate for random UUID v4 values. The previous chapters showed that random IDs need no coordination but scatter inserts across an index. Time-ordered IDs keep the no-coordina6 min read
09Chapter 9: Snowflake-style IDs: timestamp, worker, sequenceThis chapter assumes you know what a B-tree index is and how bit shifting and masking work. It also assumes you have met UUIDs and time-ordered IDs in the earlier chapters. Here you will build a Snowflake-style generator and learn how it fails.6 min read
10Chapter 10: Giving every generator a unique worker IDThis chapter assumes you have read the Snowflake chapter. You should know the layout of a 64-bit Snowflake ID: a 41-bit timestamp, a 10-bit worker ID, and a 12-bit sequence. You should also be comfortable with leases and timeouts at a basic level. The question here is how each generator gets a worke6 min read
11Chapter 11: Clock skew and backwards clocksThis chapter covers what happens to time-based ID generators when the system clock misbehaves. It assumes you have read the Snowflake chapter and know the layout of timestamp, worker ID, and sequence. You should be comfortable with bit shifting and with the idea that machines in a cluster do not sha7 min read
12Chapter 12: Predictable IDs and what they revealThis chapter assumes you have read the earlier chapters on UUID v4, UUID v7, and Snowflake IDs. It also assumes you know how a web API usually exposes a record by ID, for example GET /orders/1042. The earlier chapters judged ID schemes on uniqueness, ordering, size, and coordination. This chapter 6 min read
13Chapter 13: Choosing a scheme for your systemThis chapter assumes you have read the earlier chapters on counters, UUIDs, time-ordered IDs, Snowflake-style IDs, and clock hazards. You should be comfortable with primary keys, B-tree indexes, and bit fields. The goal is to turn those pieces into a decision you can defend in a design review.6 min read