Scenario 09.1.4 · AutoMQ zone router: one leader, no cross-zone data
AutoMQ diskless Kafka: zone router, no cross-zone data
AutoMQ 1.7.4 · with the zone router on, each client talks to the broker in its own zone, the leader links the batch from S3 instead of receiving it, and no record data crosses a zone.
Run this scenario in the playgroundZone router on: each client talks to the broker in its zone. t+0.160s
orders-1 is led by broker-2 in az-b, but neither producer talks to it. Producer p-all (acks=all) sits in az-a and p-one (acks=1) in az-c; each sends to the proxy in its own zone: broker-1 and broker-3. With one broker per zone the proxy is that broker; with several the simulator picks one by a hash (AutoMQ picks by consistent hash too, in zerozone/ProxyNodeMapping.java). At 150 each proxy appended its producer's k11 record to its own router channel buffer, rc-0001 on broker-1 and rc-0002 on broker-3, so nothing is on the leader yet. The router is off by default in AutoMQ 1.7.4 (automq.zonerouter.channels defaults to null); here it is on.
Open at this step: step 1, Zone router on: each client talks to the broker in its zoneEach proxy writes its batch to its router channel in S3. t+0.700s
The router channel is an object WAL in S3, not a network hop to the leader (zerozone/RouterOutV2.java). Each proxy's buffer closed at 650, 500 ms after it opened, and uploaded as its own object: broker-1 uploads rc-0001 with p-all's record, broker-3 uploads rc-0002 with p-one's, 600 ms each, landing at 1250. The 500 ms batch and the 600 ms upload are the simulator's sandbox timings; AutoMQ's default for the buffer is 250 ms and its code gives no upload time. No ack yet and orders-1 still has high watermark 0.
Open at this step: step 2, Each proxy writes its batch to its router channel in S3Only a pointer crosses to the leader in az-b. t+1.300s
Both channel objects are in S3 since 1250. At 1250 each proxy sent broker-2 in az-b a pointer, the channel object's key: rc-0001 from broker-1 (az-a) and rc-0002 from broker-3 (az-c). Those two requests are the only thing that has crossed zones so far, and the cross-zone card counts them as 2 requests and 0 records. The record bytes stay in S3. Orders-1 still has high watermark 0: the leader has not read the objects yet.
Open at this step: step 3, Only a pointer crosses to the leader in az-bThe leader reads the batch from S3 and links it in its WAL. t+1.900s
At 1850 broker-2 had read both channel objects from S3 (the simulator uses 600 ms for that read; AutoMQ's code shows no figure) and numbered the records: offset 0 of orders-1 is p-all's order-1 (from rc-0001), offset 1 is p-one's order-2 (from rc-0002). The leader's WAL buffer holds a link record for each, pointing at the channel object, not a second copy of the record (zerozone/LinkRecord.java). It appends with acks=-1, so nothing is answered yet and the high watermark is still 0. The buffer closes 500 ms after the first link, at 2350.
Open at this step: step 4, The leader reads the batch from S3 and links it in its WALLeader's upload done: both producers answered, acks=1 too. t+2.950s
The leader's WAL object wal-0003 went up at 2350 and was confirmed at 2950 with 2 link records; orders-1 now has high watermark 2. At the same instant broker-2 answered both proxies, which dropped their channel objects (simulator choice), and both producers got their ack, 2800 ms after the append at 150. That includes p-one with acks=1: the leader appends with acks=-1 and the proxy answers its client only when the leader answers (RouterInV2.java, RouterOutV2.java), so under the router acks=1 is no faster than acks=all. This is the cost: two uploads and a read before any ack.
Open at this step: step 5, Leader's upload done: both producers answered, acks=1 tooThe az-c consumer reads from its own zone's snapshot copy. t+3.600s
Consumer g1 sits in az-c and reads orders-1 from broker-3, its zone's proxy, not from broker-2 in az-b: AutoMQ names the zone's proxy as the preferred read node and keeps a read-only snapshot copy of the partition there that replays the leader's confirm WAL from S3 (ElasticReplicaManager.scala, SnapshotReadPartitionsManager.java). In the simulator broker-1 and broker-3 synced to end offset 2 at 3550, 600 ms after the confirm, and at 3600 g1 polled broker-3 and got both records, position 2 on orders-1. The records came from the proxy in its own zone; the leader's zone served nothing to the consumer.
Open at this step: step 6, The az-c consumer reads from its own zone's snapshot copyCross-zone record data: 0; only small requests crossed. t+4.300s
Two records were produced and consumed across three zones and the cross-zone card counts 0 record data. Six small requests crossed: 2 pointers (1250), 2 responses to the proxies (2950) and 2 snapshot syncs (3550). The simulator counts S3 access as zone-free because AutoMQ's code does not say; with the router off, the producers' appends to the leader and the consumer's fetch would each have crossed zones as record data. The price is the ack time seen at 2950: the produce waited for a channel upload, a leader read and the leader's own upload.
Open at this step: step 7, Cross-zone record data: 0; only small requests crossedWhat you start with
AutoMQ 1.7.4 has an optional zone router, off by default, that needs broker.rack on every broker. Metadata is rewritten so each partition's leader looks like a broker in the client's own zone, the proxy; the client zone comes from an automq_az key in client.id, from its IP, or for fetch from client.rack. Producer p-all (acks=all) in az-a and p-one (acks=1) in az-c write to orders-1, which broker-2 in az-b leads; consumer g1 in az-c reads it. Timings are slowed so each phase gets its own frame.
Step by step
- Zone router on: each client talks to the broker in its zone t+0.160s orders-1 is led by broker-2 in az-b, but neither producer talks to it. Producer p-all (acks=all) sits in az-a and p-one (acks=1) in az-c; each sends to the proxy in its own zone: broker-1 and broker-3. With one broker per zone the proxy is that broker; with several the simulator picks one by a hash (AutoMQ picks by consistent hash too, in zerozone/ProxyNodeMapping.java). At 150 each proxy appended its producer's k11 record to its own router channel buffer, rc-0001 on broker-1 and rc-0002 on broker-3, so nothing is on the leader yet. The router is off by default in AutoMQ 1.7.4 (automq.zonerouter.channels defaults to null); here it is on. Open at this step: step 1, Zone router on: each client talks to the broker in its zone
- Each proxy writes its batch to its router channel in S3 t+0.700s The router channel is an object WAL in S3, not a network hop to the leader (zerozone/RouterOutV2.java). Each proxy's buffer closed at 650, 500 ms after it opened, and uploaded as its own object: broker-1 uploads rc-0001 with p-all's record, broker-3 uploads rc-0002 with p-one's, 600 ms each, landing at 1250. The 500 ms batch and the 600 ms upload are the simulator's sandbox timings; AutoMQ's default for the buffer is 250 ms and its code gives no upload time. No ack yet and orders-1 still has high watermark 0. Open at this step: step 2, Each proxy writes its batch to its router channel in S3
- Only a pointer crosses to the leader in az-b t+1.300s Both channel objects are in S3 since 1250. At 1250 each proxy sent broker-2 in az-b a pointer, the channel object's key: rc-0001 from broker-1 (az-a) and rc-0002 from broker-3 (az-c). Those two requests are the only thing that has crossed zones so far, and the cross-zone card counts them as 2 requests and 0 records. The record bytes stay in S3. Orders-1 still has high watermark 0: the leader has not read the objects yet. Open at this step: step 3, Only a pointer crosses to the leader in az-b
- The leader reads the batch from S3 and links it in its WAL t+1.900s At 1850 broker-2 had read both channel objects from S3 (the simulator uses 600 ms for that read; AutoMQ's code shows no figure) and numbered the records: offset 0 of orders-1 is p-all's order-1 (from rc-0001), offset 1 is p-one's order-2 (from rc-0002). The leader's WAL buffer holds a link record for each, pointing at the channel object, not a second copy of the record (zerozone/LinkRecord.java). It appends with acks=-1, so nothing is answered yet and the high watermark is still 0. The buffer closes 500 ms after the first link, at 2350. Open at this step: step 4, The leader reads the batch from S3 and links it in its WAL
- Leader's upload done: both producers answered, acks=1 too t+2.950s The leader's WAL object wal-0003 went up at 2350 and was confirmed at 2950 with 2 link records; orders-1 now has high watermark 2. At the same instant broker-2 answered both proxies, which dropped their channel objects (simulator choice), and both producers got their ack, 2800 ms after the append at 150. That includes p-one with acks=1: the leader appends with acks=-1 and the proxy answers its client only when the leader answers (RouterInV2.java, RouterOutV2.java), so under the router acks=1 is no faster than acks=all. This is the cost: two uploads and a read before any ack. Open at this step: step 5, Leader's upload done: both producers answered, acks=1 too
- The az-c consumer reads from its own zone's snapshot copy t+3.600s Consumer g1 sits in az-c and reads orders-1 from broker-3, its zone's proxy, not from broker-2 in az-b: AutoMQ names the zone's proxy as the preferred read node and keeps a read-only snapshot copy of the partition there that replays the leader's confirm WAL from S3 (ElasticReplicaManager.scala, SnapshotReadPartitionsManager.java). In the simulator broker-1 and broker-3 synced to end offset 2 at 3550, 600 ms after the confirm, and at 3600 g1 polled broker-3 and got both records, position 2 on orders-1. The records came from the proxy in its own zone; the leader's zone served nothing to the consumer. Open at this step: step 6, The az-c consumer reads from its own zone's snapshot copy
- Cross-zone record data: 0; only small requests crossed t+4.300s Two records were produced and consumed across three zones and the cross-zone card counts 0 record data. Six small requests crossed: 2 pointers (1250), 2 responses to the proxies (2950) and 2 snapshot syncs (3550). The simulator counts S3 access as zone-free because AutoMQ's code does not say; with the router off, the producers' appends to the leader and the consumer's fetch would each have crossed zones as record data. The price is the ack time seen at 2950: the produce waited for a channel upload, a leader read and the leader's own upload. Open at this step: step 7, Cross-zone record data: 0; only small requests crossed
The takeaway
Each producer wrote to the broker in its own zone. That proxy put the batch in a router channel, an object it uploaded to S3, and sent the leader in az-b only a pointer to it; the leader read the object from S3 and stored a link record in its own WAL, not a second copy, appending with acks=-1 (RouterInV2, LinkRecord). Only after the leader's WAL upload was confirmed did the proxies answer, so acks=1 was answered at the same moment as acks=all, 2800 ms after the append. Consumer g1 read from the snapshot copy on broker-3 in its own zone, which replays the leader's WAL from S3. No record data crossed a zone; six small requests did: two pointers, two responses and two snapshot syncs. The cost is the wait: a channel upload, a leader read and the leader's upload before the first ack. Simulator choices: the proxy hash (one broker per zone here), the 500 ms batch interval (AutoMQ's router channel defaults to 250 ms), the 600 ms upload, the 600 ms S3 read stand-in on the leader and the snapshot copies, and counting S3 access as zone-free (AutoMQ's code does not say).
Configs in this scenario
-
broker.The rack or availability zone of the broker; when a topic is created, the replicas of each partition are spread across racks so one rack failing cannot take every copy.rack -
client.A logical name the producer sends with every request - it shows up in broker logs, metrics, and quota enforcement so traffic can be attributed to an application.id -
client.The rack (in the cloud, the availability zone) the client runs in (default empty); with a broker-side replica.selector.class such as RackAwareReplicaSelector a consumer fetches from a follower in its own rack instead of the leader, and since Kafka 4.4 a producer with partitioner.rack.aware=true sends keyless records to partitions whose leader is in its rack.rack -
acksHow many replicas must have a write before the producer counts it as sent: 0 (none), 1 (the leader only) or all (every in-sync replica, the default, and required for idempotence). How acks works
Embed this scenario
Paste this into a blog post, a course page or your team's docs. The scenario plays inside your page, and the link under it points readers to this walkthrough.
<iframe src="https://monedula.dev/kafka-simulator/embed/?scenario=09.1.4" title="Kafka Simulator: AutoMQ zone router: one leader, no cross-zone data" width="100%" height="520" style="border:1px solid #d0d0d0;border-radius:8px" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
<p><a href="https://monedula.dev/kafka-simulator/scenarios/automq-zone-router/">AutoMQ diskless Kafka: zone router, no cross-zone data</a></p> Further reading
AutoMQ v1.7.4 source on GitHub
More in Diskless
- Diskless Kafka topics (KIP-1163): the write path
- Diskless vs classic Kafka: cross-AZ replication traffic
- Diskless Kafka produce latency: the price of object storage
- Diskless Kafka (KIP-1163): when object storage goes down
- Aiven Inkless diskless Kafka: the write path
- Aiven Inkless: what a PostgreSQL outage does to Kafka
- Aiven Inkless: what losing a Kafka broker costs
- Aiven Inkless: a slow S3 bucket fails Kafka produce
- KafScale diskless Kafka: etcd lease, S3 segment, ack
- KafScale 2.1 diskless Kafka: a lease owner crashes
- KafScale 2.1 diskless Kafka: when etcd goes down
- KafScale 2.1 diskless Kafka: when S3 goes down
- KafScale 2.1 proxy: etcd down past the 60 s cache TTL
- KafScale 2.1: a Kafka producer timeout that still wrote
- KafScale 2.1 diskless Kafka: lease handover, no overwrite
- KafScale 2.1 diskless Kafka: a paused broker comes back
- AutoMQ diskless Kafka: one S3 WAL per broker, then ack
- AutoMQ diskless Kafka: a broker crash and WAL failover
- AutoMQ diskless Kafka: moving a partition, no copying
- AutoMQ diskless Kafka: when S3 goes down
- WarpStream diskless Kafka: the write path through Agents
- WarpStream Kafka: a leader per client, a cache per zone
- WarpStream Kafka: an Agent dies mid-commit
- WarpStream Kafka: the control plane goes down
- WarpStream Kafka Ripcord: produce without the control plane
- WarpStream Kafka lightning topics: ack before the commit
- WarpStream Kafka transactions in the control plane
- Redpanda Kafka write path: the offset comes after S3
- Redpanda Kafka leader crash: a Raft election, no replay
- Redpanda Kafka S3 outage: uploads time out, Raft holds
- Redpanda Kafka L0 to L1: the LRO and who serves a read
- Redpanda Kafka transactions: exactly-once on Cloud Topics
- Nisshi diskless Kafka: watermark.json, then the batch
- Nisshi diskless Kafka on PostgreSQL: a row lock per write
- Nisshi diskless Kafka: two brokers write one partition
- Nisshi diskless Kafka: reading through another broker
- Nisshi diskless Kafka: a broker dies mid-write
- Nisshi diskless Kafka: when PostgreSQL goes down
- Nisshi diskless Kafka: what 0.8.2 refuses
- Ursa for Kafka write path: Oxia assigns the offset
- Ursa for Kafka zones: the zonal owner and the zone cache
- Ursa for Kafka compaction: from WAL objects to Parquet
- Ursa for Kafka broker failure: a kill and a silent broker
- Ursa for Kafka: diskless and disk topics, side by side