Monedula

Scenario 07.1.1 · Inkless: the write path

Aiven Inkless diskless Kafka: the write path

Diskless · Advanced · about 3 min · Apache Kafka 4.4 · Aiven Inkless 0.51

Aiven Inkless 0.51 · any broker accepts the write, the client's zone picks which; PostgreSQL assigns offsets at commit, the ack waits for it, and a same-zone consumer reads from that broker's cache.

Run this scenario in the playground

az-b reads from cache, az-c from object storage. t+1.800s

Both groups polled. g-b in az-b was served by broker-2, which had the range cached. g-c in az-c was served by broker-3, which had nothing cached: it read the object from object storage (remote read) and now caches it too.

Open at this step: step 5, az-b reads from cache, az-c from object storage

What you start with

Inkless is Aiven's fork of Apache Kafka that runs diskless topics today. A diskless partition has no leader for writes: a client that names its zone in client.id (diskless_az=<zone>) is sent to a broker in that zone, which buffers records from many partitions, uploads the buffer as one object, and asks PostgreSQL, the batch coordinator, to commit it. Watch the WAL counter under broker-2, the PostgreSQL lane and the object storage lane. Timings are slowed so each phase gets its own frame.

Step by step

  1. Inkless cluster, empty t+0.000s clicks is an Inkless diskless topic (Aiven Inkless 0.51) with one partition and replication factor 1: any broker can serve it. Three brokers, one per availability zone: broker-1 in az-a, broker-2 in az-b, broker-3 in az-c. PostgreSQL, the batch coordinator, runs in az-a. Producer p1 names its zone in client.id (diskless_az=az-b); consumer group g-b sits in az-b and g-c in az-c. Open at this step: step 1, Inkless cluster, empty
  2. Records buffered on broker-2 t+0.400s p1 flushed two records at 150 ms. Its zone, az-b, sent them to broker-2, the only broker there: no partition leader is involved in the write. broker-2 holds them in its write buffer (WAL 2); nothing is in object storage yet and no offset exists. Open at this step: step 2, Records buffered on broker-2
  3. One object uploaded, awaiting PostgreSQL t+1.000s broker-2 closed the buffer at 650 ms, after the 500 ms commit interval, and started uploading it as one object, wal-0001 (the upload takes 600 ms here). It is not committed: it has no offsets yet, so p1 is still waiting for its ack. Open at this step: step 3, One object uploaded, awaiting PostgreSQL
  4. PostgreSQL commits, producer acked t+1.310s PostgreSQL committed wal-0001 and assigned offsets 0-1; only then was p1 acked, 1160 ms after its batch entered the buffer. broker-2 is in az-b and PostgreSQL in az-a, so the commit call crossed zones. broker-2 keeps the committed range in its cache. Open at this step: step 4, PostgreSQL commits, producer acked
  5. az-b reads from cache, az-c from object storage t+1.800s Both groups polled. g-b in az-b was served by broker-2, which had the range cached. g-c in az-c was served by broker-3, which had nothing cached: it read the object from object storage (remote read) and now caches it too. Open at this step: step 5, az-b reads from cache, az-c from object storage

The takeaway

The zone in client.id, not a partition leader, chose broker-2. No offset existed until PostgreSQL committed the object, and the producer was acked only then; the commit crossed from az-b to az-a, where PostgreSQL runs. The consumer in az-b read from broker-2's cache, the one in az-c from object storage first. Simulator choices: the zone hash is the simulator's own, not murmur2 over the topic id, and a client without a zone would be hashed over every broker.

Configs in this scenario

  • client.id 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.

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=07.1.1" title="Kafka Simulator: Inkless: the write path" 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/inkless-write-path/">Aiven Inkless diskless Kafka: the write path</a></p>

Further reading

Aiven Inkless source on GitHub (inkless-release-0.51)

More in Diskless

All scenarios