On this page
How it works · Diskless Kafka
How AutoMQ works
AutoMQ is a fork of Apache Kafka 3.9.1 that replaces Kafka’s log storage with S3Stream. Every partition has one replica and one leader, chosen by the KRaft controller, and the leader buffers writes in a WAL in S3 that each broker shares across its partitions. acks=all is answered when the WAL object’s upload finishes and, with the zone router off (the default), acks=1 at append; later the broker writes the data again as stream set objects, which the controller records.
- Status
- Version 1.7.4, released 29 August 2026; on 12 November 2026 the newer 1.7.5 had only release candidates. AutoMQ 1.7.4 release
- License
- Apache 2.0. AutoMQ LICENSE
- Code
- A fork of Apache Kafka that keeps Kafka’s compute layer and replaces its storage layer with S3Stream, AutoMQ’s own stream storage library. AutoMQ README
- Based on
- Apache Kafka 3.9.1. AutoMQ gradle.properties (the Kafka version it builds on)
- Write-ahead log
- The open code at 1.7.4 accepts only a WAL in S3; any other WAL protocol is refused. The README still names EBS as a WAL. AutoMQ WAL factory code (DefaultWalFactory.java)
- Components
- Brokers, each with one WAL in S3 for all its partitions; S3 for the WAL and the stream data; KRaft controllers holding the stream metadata: streams, objects and their epochs. AutoMQ stream metadata in the controller (StreamControlManager.java)
- Commercial edition
- The README advertises an AutoMQ Business Edition that, in its words, provides "a powerful and easy-to-use control plane to help you manage clusters". AutoMQ README
The write path, up to the ack
- Route to the leader
Each partition has one replica, its leader, chosen by the KRaft controller. With the zone router off, the default, the producer sends to that leader as in Apache Kafka.
- Append and assign offsets
The leader appends the batch to its log, assigns its offsets and adds it to the broker’s one WAL buffer, shared by every partition the broker leads. A producer with acks=1 is answered here, before anything reaches S3; acks=all waits.
- Upload one WAL object
The buffer closes within 250 ms or once it holds 8 MiB, the defaults at 1.7.4 (
batchIntervalandmaxBytesInBatchons3.wal.path), and is uploaded as one WAL object that mixes records from many partitions. - Confirm and ackproducer acked
Uploads complete in order, each after its PUT and an S3 read of the broker’s WAL reservation object, which checks that the broker still owns its WAL; uploads that finish together share one read. The confirm offset moves, the high watermark follows it, and acks=all is answered. Nothing on this path calls the controller.
- Commit an SSO, later
In the background, every
s3.wal.upload.interval.ms(60 s by default) or once enough data is cached, the broker writes the cached records as stream set objects (SSOs), commits them to the controller and then trims the WAL.
Where the latency comes from
Source: AutoMQ object WAL defaults (ObjectWALConfig.java).
The ack waits for 3 parts; the sources give no latency percentile for them:
- WAL batch: up to 250 ms or 8 MiB, whichever comes first (the defaults at 1.7.4)
- S3 PUT of the WAL object: the sources give no figure
- S3 read of the WAL reservation object (ownership check): the sources give no figure; uploads that finish together share one read (
ObjectReservationService)
The sources give no figure for the WAL upload or for the ack end to end. The README’s comparison table puts AutoMQ’s publish latency at P99 as "Single-digit ms latency" without saying which WAL it was measured with; elsewhere the README ties single-digit millisecond latency to EBS as WAL, which the open code at 1.7.4 does not include.
acks=1 does not wait for the upload at all, unless the zone router is on. Turning the WAL into SSOs is not on the ack path either.
Who orders the batches
The metadata lives in Kafka’s own KRaft controller quorum, with no external database. The controller picks each partition’s leader, records streams, SSOs and stream objects with their epochs, and fences brokers that stop heartbeating.
It is not on the ack path. The leader assigns offsets itself, and the high watermark is its confirm offset. The controller hears about data only when a broker commits an SSO, which it checks against the broker’s epoch.
A partition moves by closing its stream on one broker and opening it on another: the controller refuses to open a stream that is still open, or with an older epoch.
The read path
Only the leader serves fetches, unless the zone router is on. It reads from its log cache, which holds records once their WAL object is confirmed, then from a block cache, then from S3. It serves up to the high watermark, so a record is readable only after its WAL upload, whatever acks it was written with.
With the zone router on, a consumer can read from a snapshot copy of the partition in its own zone instead; see cross-zone traffic.
When something fails
| What fails | What happens |
|---|---|
| A broker dies | Its partitions keep it as their leader, and requests to it time out, until the controller fences it after broker.session.timeout.ms, 9 s by default. A peer broker then takes over its WAL, replays the confirmed WAL objects into an SSO and closes its streams, and the partitions reopen on other brokers with the next epoch. The controller fails over only a broker that started more than a minute earlier. acks=1 records still in its buffer had been answered and are lost; acks=all records were answered only after their upload and are kept. AutoMQ failover controller code (FailoverControlManager.java) |
| A partition is reassigned, or its broker shuts down gracefully | The controller takes the partition’s leader away. The old leader uploads its WAL buffer, writes and commits an SSO, and closes the stream; the new broker, which checks every 100 ms, opens it with the next epoch and becomes leader. No replica catches up and nothing is copied between brokers. The code gives no duration. AutoMQ stream close code (S3Stream.java) |
| The KRaft controller quorum is lost | Produce and acks go on until the broker’s WAL cache (s3.wal.cache.size) fills: records leave it only once their SSO is committed, which needs the controller, and by default the broker retries controller requests without limit (s3.controller.request.retry.max.count). Then appends back off. SSO commits, stream opens, fencing and failover wait for the controller to return, and so does a reassignment, which is a controller request. The sources describe this case only through these code paths. AutoMQ WAL cache backoff (S3Storage.java) |
| A broker is cut off from the controller | It keeps leading until the controller fences it after the session timeout, as it would a dead broker, and a peer takes over its WAL. From then on the cut-off broker’s uploads fail the WAL ownership check (WALFencedException), and what it had not confirmed is lost. AutoMQ object WAL writer code (DefaultWriter.java) |
| An SSO commit fails | The broker halts at once. AutoMQ storage code (S3Storage.java) |
| S3 is unavailable | A WAL upload is retried on every error except a 404, with no limit on attempts and no overall timeout, backing off up to 60 s, so nothing fails. acks=1 was answered at append; acks=all requests wait, and time out with REQUEST_TIMED_OUT if S3 stays down past their timeout. Uploads complete in the order they were written once S3 is back. SSO uploads wait too, so the WAL is not trimmed. AutoMQ S3 write retry code (AbstractObjectStorage.java) |
Cross-zone traffic: what goes, what stays
Goes
- Replication between brokers: there is none, one replica per partition with S3 for durability
Stays
- With the zone router off, the default: client produce and fetch to a leader in another zone, as in Apache Kafka
- Uploads to and reads from S3: the sources do not say whether S3 access crosses zones
The zone router is off by default and turned on with automq.zonerouter.channels. With it on, a client that names its zone (automq_az=<zone> in its client.id) writes to a broker in that zone, the leader itself when the leader is there. That broker writes the batch to its router channel, an object WAL in S3, and sends the leader only a pointer (RouterOutV2). The leader reads the batch from S3 and appends it with acks=-1 (RouterInV2), its own WAL holding only a link record that points at the channel object, so under the router an acks=1 producer also waits for the leader’s WAL upload. Consumers in a zone without the leader read from a snapshot copy kept on their zone’s broker (ProxyNodeMapping, SnapshotReadPartitionsManager). Record data stays in the zone and only small requests cross. At 1.7.4 the router channel always uses the object WAL defaults, 250 ms and 8 MiB (DefaultRouterChannelProvider), although the config doc in AutoMQConfig lists batchInterval and maxBytesInBatch on the channel URI. AutoMQ zone router, proxy side (zerozone/RouterOutV2.java)
Does it support...
| Feature | Status | Details |
|---|---|---|
| Idempotent producer | Yes | Kafka’s idempotent producer, with the producer state kept by S3Stream. AutoMQ producer state code (ElasticProducerStateManager.java) |
| Transactions | Yes | Kafka’s transactions, with the transaction index kept by S3Stream. AutoMQ transaction index code (ElasticTransactionIndex.java) |
| Compacted topics | Yes | Kafka’s log cleaner runs on AutoMQ’s segments, so cleanup.policy=compact works. Kafka’s log cleaner in AutoMQ (LogCleaner.scala) |
| Consumer groups | Yes | Kafka’s group coordinator with the classic protocol. In Kafka 3.9.1 the KIP-848 consumer protocol is early access and off by default (group.coordinator.rebalance.protocols). Kafka 3.9.1 group protocols in AutoMQ (GroupCoordinatorConfig.java) |
| Diskless internal topics | Yes | Every partition is created as an S3Stream log, internal topics included, so __consumer_offsets, with the committed offsets and group state, is in S3 with one replica like any other topic. AutoMQ creates every log in S3Stream (LogManager.scala) |
| Share groups | No | AutoMQ 1.7.4 builds on Kafka 3.9.1, where share groups sit behind the internal setting group.share.enable, off by default. Kafka 3.9.1 share group config in AutoMQ (ShareGroupConfig.java) |
| Tiered storage | Unclear | Not needed for S3: S3Stream replaces Kafka’s storage layer, so every partition is in S3 already. The sources do not say whether Kafka’s own tiered storage can be turned on as well. AutoMQ README |
| Replication factor above 1 | No | A topic asked for with more replicas is created with one, with min.insync.replicas forced to 1, and a reassignment to more than one replica is refused (InvalidReplicaAssignmentException). S3 provides the durability. AutoMQ partition metadata in the controller (ReplicationControlManager.java) |
The configs it adds
| Config | Level | What it does |
|---|---|---|
s3.wal.path | Broker | The WAL, as an S3 URI such as 0@s3://<bucket>?region=<region>; batchInterval (default 250 ms) and maxBytesInBatch (default 8 MiB) can be set on it. AutoMQ broker configs (AutoMQConfig.java) |
s3.wal.upload.interval.ms | Broker | How often the broker turns its WAL into SSOs committed to the controller. Default 60000; not on the ack path. AutoMQ broker configs (AutoMQConfig.java) |
automq.zonerouter.channels | Broker | Turns the zone router on, as an S3 URI for the router channels. Default unset: off. AutoMQ broker configs (AutoMQConfig.java) |
autobalancer.controller.enable | Controller | Runs the self-balancer in the controller, which the README says schedules partitions and network traffic between brokers. Default true. AutoMQ self-balancer configs (AutoBalancerControllerConfig.java) |
How it differs from Apache Kafka
Each partition has one leader, chosen by the KRaft controller, which takes all its writes and assigns its offsets. KIP-1163 has no leader for writes: any broker takes records for any partition, and the coordinator assigns offsets at commit.
The coordinator is the KRaft controller, and it is off the ack path: the producer is acked after the WAL upload, and SSOs are committed to the controller later. In KIP-1164 the diskless coordinator, inside Kafka in __diskless_metadata, commits each object’s batches before the ack.
Each broker’s WAL object mixes batches from many partitions, as the KIP’s shared objects do, but the high watermark is the leader’s confirm offset rather than an offset the coordinator assigns.
A partition moves by closing its stream on one broker and opening it on another, with no data copied; there are no replicas to catch up.
Every topic is stored in S3. The KIPs add diskless as a topic type next to classic topics.
See it in the simulator
- AutoMQ: the write path, step 4
- AutoMQ: the write path, step 5
- AutoMQ: a broker crashes and its WAL is replayed, step 4
- AutoMQ: a broker crashes and its WAL is replayed, step 5
- AutoMQ: S3 goes down, step 4
- AutoMQ: moving a partition without copying, step 4
- AutoMQ zone router: one leader, no cross-zone data, step 3
- AutoMQ zone router: one leader, no cross-zone data, step 7
The simulator stretches the timings so each step is visible: the scenarios here use a 500 ms batch interval, a 600 ms upload, a 40 ms SSO commit and a 300 ms read in a failover, figures AutoMQ’s sources do not give, and turn the WAL into SSOs every 4 s instead of the code default of 60 s. It keeps the 9 s broker session timeout, Kafka’s default. The failover broker is the lowest-id alive broker not already running one (AutoMQ picks round-robin), and a moved partition goes to the broker leading the fewest partitions in the same rack, a stand-in for AutoMQ’s weighted random pick; brokers count as running long before the scene, so the one-minute failover rule applies only to one restarted in it. With the zone router on, in a zone without the leader the proxy is a stable hash of topic and partition, not AutoMQ’s consistent hash; the leader’s read of a channel object from S3 takes 600 ms, a figure the code does not give; the proxy drops a channel object once every leader it pointed to has answered, which the code does not state; and a proxy that dies after the leader stored a batch makes its producer time out and retry, so the record is written twice. In an S3 outage a failed upload is retried every second (AutoMQ backs off up to 60 s), and acks=all producers wait without timing out, since the simulator has no produce request timeout. It does not model other WALs, the self-balancer, KRaft outages, automq.zonerouter.local.write.mode=direct, or routing by automq.zone.cidr.blocks, and it refuses idempotence, transactions and compacted topics on AutoMQ clusters for now.
The proposals behind it
Sources
- AutoMQ 1.7.4 release
- AutoMQ README
- AutoMQ LICENSE
- AutoMQ gradle.properties (the Kafka version it builds on)
- AutoMQ WAL factory code (DefaultWalFactory.java)
- AutoMQ object WAL defaults (ObjectWALConfig.java)
- AutoMQ object WAL writer code (DefaultWriter.java)
- AutoMQ WAL ownership check (ObjectReservationService.java)
- AutoMQ log append code (ElasticLog.scala)
- AutoMQ high watermark code (Partition.scala)
- Kafka’s produce wait rule in AutoMQ (ReplicaManager.scala)
- AutoMQ S3 write retry code (AbstractObjectStorage.java)
- AutoMQ storage code (S3Storage.java)
- AutoMQ WAL cache backoff (S3Storage.java)
- AutoMQ stream close code (S3Stream.java)
- AutoMQ stream metadata in the controller (StreamControlManager.java)
- AutoMQ partition metadata in the controller (ReplicationControlManager.java)
- Kafka’s broker heartbeat defaults in AutoMQ (KRaftConfigs.java)
- AutoMQ failover controller code (FailoverControlManager.java)
- AutoMQ WAL failover steps (Failover.java)
- AutoMQ failover rule (NodeRuntimeMetadata.java)
- AutoMQ stream open wait (ElasticLog.scala)
- AutoMQ broker configs (AutoMQConfig.java)
- AutoMQ sample server.properties
- AutoMQ self-balancer configs (AutoBalancerControllerConfig.java)
- AutoMQ zone router switch (BrokerServer.scala)
- AutoMQ zone router, proxy side (zerozone/RouterOutV2.java)
- AutoMQ zone router, leader side (zerozone/RouterInV2.java)
- AutoMQ zone router proxy choice (zerozone/ProxyNodeMapping.java)
- AutoMQ router channel (zerozone/DefaultRouterChannelProvider.java)
- AutoMQ snapshot reads (zerozone/SnapshotReadPartitionsManager.java)
- AutoMQ preferred read node (ElasticReplicaManager.scala)
- AutoMQ producer state code (ElasticProducerStateManager.java)
- AutoMQ transaction index code (ElasticTransactionIndex.java)
- Kafka’s log cleaner in AutoMQ (LogCleaner.scala)
- Kafka 3.9.1 group protocols in AutoMQ (GroupCoordinatorConfig.java)
- AutoMQ creates every log in S3Stream (LogManager.scala)
- Kafka 3.9.1 share group config in AutoMQ (ShareGroupConfig.java)
Changes to this page
- Consumer groups and diskless internal topics in the feature table, for the new consumer groups and broker state columns on the diskless hub.
- S3 outages, with a simulator step from scenario 09.1.5.
- Published, with simulator steps from scenarios 09.1.1, 09.1.2, 09.1.3 and 09.1.4.