01Chapter 1: Why unique IDs are hard when nodes cannot coordinateThis chapter assumes you can read basic Python and know what a primary key is in a relational database. You should also have a rough idea of what a distributed system is: several nodes that talk over a network and can fail independently. Bit shifting appears in later chapters, not here.3 min read
02Chapter 2: What to ask of an ID: uniqueness, ordering, size, and coordinationThis chapter assumes you know what a primary key and an index are, can read binary and bit shifts, and understand that distributed nodes can fail independently. Before comparing schemes, you need a checklist for judging them. Every scheme in the rest of the tutorial is a different set of answers to 3 min read
03Chapter 3: Central counters and auto-increment: simple, but a bottleneckThis chapter assumes you know what a primary key is, have used an auto-increment column, and understand that a distributed system has several nodes that talk over a network and can fail independently. Here you will see why the simplest ID scheme works well on one machine and what limits it when many3 min read
04Chapter 4: Handing out blocks of IDs to reduce coordinationThis chapter assumes you know why a single central counter becomes a bottleneck and a single point of failure. It also assumes you are comfortable with relational primary keys and basic Python. Block allocation keeps the simplicity of a counter but contacts the central service far less often.3 min read
05Chapter 5: Random IDs and UUID v4: no coordination neededThis chapter assumes you know what a primary key is, can read basic Python, and understand that nodes in a distributed system may fail or lose contact with each other. You should also be comfortable with binary numbers and bit shifting.3 min read
06Chapter 6: How likely is a collision? The birthday boundThis chapter assumes you know what a UUID v4 is (a random 128-bit identifier with 122 random bits), can read basic Python, and understand powers of two. By the end you can estimate the chance that random IDs collide and decide whether a given ID size is safe.4 min read
07Chapter 7: Why random keys hurt B-tree indexesThis chapter assumes you know what a primary key and a B-tree index are, and that you have seen UUID v4 as a coordination-free ID. Here we look at what random keys do to insert performance, and why time-ordered IDs reduce the cost.3 min read
08Chapter 8: Time-ordered IDs: UUID v7 and ULIDThis chapter assumes you know why random UUID v4 keys scatter inserts across a B-tree index. It also assumes you can read bit shifts in Python. Time-ordered IDs keep the "no coordination" property of random IDs and fix most of the index problem.3 min read
09Chapter 9: Snowflake-style IDs: timestamp, worker, sequenceThis chapter assumes you know what a B-tree index is, can read bit shifts in Python, and understand that distributed nodes can fail independently. Earlier chapters showed that random IDs need no coordination but sort poorly, and that time-ordered IDs fix much of that. Snowflake-style IDs go further.2 min read
10Chapter 10: Giving every generator a unique worker IDThis chapter assumes you know how a Snowflake-style ID is laid out (timestamp, worker ID, sequence) and can read bit-shifting code. The scheme only guarantees uniqueness if no two live generators share a worker ID. That makes worker ID assignment a coordination problem, and it is the one place where3 min read
11Chapter 11: Clock skew and backwards clocksThis chapter assumes you know how a Snowflake-style ID packs a timestamp, a worker ID, and a sequence number into 64 bits. It also assumes you know what a B-tree index is. Snowflake generators depend on the wall clock, so they inherit every clock problem the machine has.3 min read
12Chapter 12: Predictable IDs and what they revealThis chapter assumes you know the ID schemes from earlier chapters: auto-increment counters, UUID v4, UUID v7, and Snowflake-style IDs. You should also be comfortable with bit shifting and basic web authorization.3 min read
13Chapter 13: Choosing a scheme for your systemThis chapter assumes you have read the earlier chapters on counters, UUIDs, time-ordered IDs, and Snowflake IDs. You should also be comfortable with primary keys and B-tree indexes. Here we turn those pieces into a decision procedure.3 min read