Monedula

Markdown

Part III · Architecture

How it works · Diskless Kafka

How AutoMQ works

AutoMQ · vendor implementation · checked against its sources on 12 November 2026

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
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

  1. 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.

  2. 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.

  3. Upload one WAL object

    The buffer closes within 250 ms or once it holds 8 MiB, the defaults at 1.7.4 (batchInterval and maxBytesInBatch on s3.wal.path), and is uploaded as one WAL object that mixes records from many partitions.

  4. 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.

  5. 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.

broker-1’s WAL object, holding records of both partitions it leads, finished uploading: the high watermark rose and p-all (acks=all) was answered, with nothing written to the KRaft controller. p-one (acks=1) had been answered at append. Step through it in the playground

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.

Consumer g1 in az-b fetched both records from the leader, broker-1 in az-a, a cross-zone fetch. The acks=1 record, answered at append, became readable only once its upload was confirmed. Step through it in the playground

When something fails

What failsWhat happens
A broker diesIts 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 gracefullyThe 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 lostProduce 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 controllerIt 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 failsThe broker halts at once. AutoMQ storage code (S3Storage.java)
S3 is unavailableA 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)
Kill plus 9 s: the controller fences broker-1 and retargets orders-0 and orders-3, which have no leader until they reopen. The targets, and broker-2 as the broker that runs the failover, are the simulator’s picks. Step through it in the playground
broker-2 read broker-1’s confirmed WAL object from S3, wrote it as an SSO committed to the controller and closed both streams. The acks=1 record in broker-1’s open buffer is gone. Step through it in the playground
S3 is down and nothing has failed: broker-1 keeps retrying its WAL uploads, p-all (acks=all) waits, p-one’s acks=1 record is acked but not readable, and wal-0001 is not trimmed because its SSO upload waits too. Step through it in the playground
broker-1 uploaded its WAL and committed it as an SSO, and orders-0’s stream closed at 3441. 100 ms later broker-3 opened it with epoch 1 at the high watermark; no data was copied between brokers. Step through it in the playground

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)

Zone router on: each producer’s record went to the router channel of the broker in its own zone, in S3, and only a pointer to it crossed to broker-2, the leader in az-b. The cross-zone card counts 2 requests and 0 records. Step through it in the playground
Two records were produced and consumed across three zones with no record data crossing zones; six small requests crossed. The simulator counts S3 access as zone-free, which AutoMQ’s code does not state. Step through it in the playground

Does it support...

FeatureStatusDetails
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

ConfigLevelWhat it does
s3.wal.pathBrokerThe 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.msBrokerHow 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.channelsBrokerTurns the zone router on, as an S3 URI for the router channels. Default unset: off. AutoMQ broker configs (AutoMQConfig.java)
autobalancer.controller.enableControllerRuns 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

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

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.

All diskless implementations