Skip to content
learn
  1. Learn
  2. High Level System Design
  3. Unique IDs and Coordination Primitives

HLD-M11

Unique IDs and Coordination Primitives

Two small building blocks every large system needs: unique ids generated without a central bottleneck, and coordination services for config, leaders and locks.

2 lessonsabout 25 min

Some problems are trivial on one machine and surprisingly subtle on many. Handing out the next order number is one line of SQL until your data lives on hundreds of shards; agreeing on which node is the leader, or what the current configuration is, is easy until machines start failing and the network starts splitting.

This module covers both. You will compare auto-increment ids, UUIDs, ULIDs, ticket servers and Snowflake-style ids, and see why sortability matters for indexes. Then you will see what coordination services such as ZooKeeper and etcd store, how watches work, and why they are deliberately small, strongly consistent and never your main database.

Lessons

  1. HLD-11.01 Generating unique IDs at scale Auto-increment ids need a central counter, which does not scale across shards. Intermediate 14 min
  2. HLD-11.02 Coordination services (ZooKeeper, etcd) Coordination services like ZooKeeper and etcd are small, strongly consistent key-value stores built on consensus. Advanced 10 min

Start with lesson 1