Build Kafka
13 scenes · ~91 min · build the primitive

Build your own Kafka

A partitioned, replicated, append-only log. The log is the database — internalize that, and a dozen product designs get easier.

  1. 01
  2. 01a
  3. 02
  4. 02a
  5. 03
  6. 04
  7. 04a
  8. 05
  9. 05a
  10. 06
  11. 07
  12. 08
  13. 09
  1. 01
    Foundations — what Kafka is, words you'll hear
    Why Kafka exists and the seven core nouns (producer, broker, topic, partition, record, offset, consumer). Orientation before you touch anything.
    ~7 min
  2. 01a
    Hello Kafka — topic, brokers, records
    Foundations: what's a topic vs a partition, what's a broker, what does the producer/consumer code actually look like.
    ~7 min
  3. 02
    The log is the database
    Why a log isn't a queue, and why that one fact unlocks the rest.
    ~7 min
  4. 02a
    Offsets, retention, and where bookmarks live
    Read and commit are separate ack channels; retention, not consumers, ages records out.
    ~7 min
  5. 03
    Partitions — splitting the log
    Parallelism by sharding ordering. Hot partitions, key skew.
    ~7 min
  6. 04
    Replication — ISR is not a quorum
    Why a write commits when the in-sync set fetches it, not a majority.
    ~7 min
  7. 04a
    Cluster, controller, and metadata
    One controller per cluster; KRaft made the metadata itself a Raft log.
    ~7 min
  8. 05
    Durability is four knobs, not one
    acks, min.insync.replicas, RF, unclean — and how 'all' silently means one.
    ~7 min
  9. 05a
    Log compaction — keep the last value per key
    Compact-retention turns the log into a state store; tombstones propagate deletes.
    ~7 min
  10. 06
    Leader epoch — the vector clock that fixes truncation
    Why HW-based truncation could silently lose acked writes, and how KIP-101 closed the gap.
    ~7 min
  11. 07
    Rebalance — stop-the-world vs. cooperative
    Eager revokes everyone; cooperative-sticky only the lanes that move.
    ~7 min
  12. 08
    Exactly-once — three monotonic counters
    PID, epoch, group-generation — three independent fences against zombies.
    ~7 min
  13. 09
    Design canvas — pick the knobs
    Capstone: apply scenes 2-8 to a fresh problem and articulate the trade-off you took.
    ~7 min