SD-11 · Back to the write-up
Design a Distributed Event Log
Partition each topic into replicated append-only logs, let consumers pull by offset, and tier old segments to object storage.
Follow a request
Produce with acks=all
Consume at the tail
Replay from yesterday
A leader dies
Tier old segments
Copy to region 2
Producers
Cluster
Copies
Consumers
ProducerBatches + compresses
ControllerRaft quorum of 3
Leader brokerPartition 7, epoch 7
Follower brokerIn sync, other zone
Group coordinatorMembers + offsets
Object storageDays 2 to 7
Region mirrorStandby cluster
ConsumerGroup member
order_id to partition 7, fills a batch of 64 events in under 5 ms, compresses it and sends it to the leader. The leader checks the sequence number, gives the batch offsets 1,205 to 1,268 and appends it to the active segment in the page cache.1 / 4The numbers, at a glance
1 write ≈ 750 MB/s2 copies + 3 reads ≈ 3.75 GB/s
65 TBD1
130 TBD2
194 TBD3
259 TBD4
324 TBD5
389 TBD6
454 TBD7
1 day on broker disks7 days kept
A produce with acks=all, in order
The consumer only sees the batch once the high watermark passes it.
Producer
Leader
Follower A
Follower B
Consumer
1 batch, seq 42
2 fetch from 1,205
3 1,205 to 1,268
4 fetch from 1,205
5 1,205 to 1,268
6 fetch from 1,269
7 ack base 1,205
8 fetch from 1,205
9 records up to HW 1,269
RequestResponseAsync, does not block
What holds the events
The decision this question is really about.
push to worker
ack → delete
2nd reader? copy it
+ Per-message retries.− No replay; each reader needs a copy.
INSERT event
SELECT id > last
DELETE old rows
+ Familiar and queryable.− Index writes and deletes at 3M/s.
append to partition 7
3 copies, HW movesreaders keep offsets
drop whole segments
+ Sequential I/O, many readers, replay.− Order only per partition.
How it grows
Add a box only when a number forces you to. Highlighted boxes are new at each stage.
Producers
One broker
Consumers
Producers
Controller quorum
Brokers × NFollowers
Consumers
Batching producers
Controller quorum
Brokers × 13Followers
Group coordinatorConsumer groups
Batching producers
Controller quorum
Brokers × 13Followers
Object storageRegion mirror
Consumer groups
Was this walkthrough useful?Your vote tells us what to improve next.