On this page
How it works · Diskless Kafka
How KafScale works
KafScale is its own broker, written in Go rather than built from Apache Kafka’s code, that speaks the Kafka protocol and keeps every topic in S3. One broker owns each partition through a lease in etcd and assigns its offsets. By default each produce request’s records for a partition are uploaded to S3 as one segment, the new end offset is written to etcd, and only when both succeed is the producer acked.
- Status
- Version 2.1.0, released 26 November 2026. 2.0.0 came out on 20 November; 2.0.1 the next day moved the Go module path and added a demo image. KafScale v2.1.0 release notes
- Production use
- The README says KafScale is used in production environments, with no warranties or guarantees. KafScale README
- License
- Apache 2.0. KafScale LICENSE
- Who builds it
- Copyright NovaTechflow (Alexander Alten); supported and financed by Scalytics. KafScale NOTICE
- Code
- Its own stateless broker, written in Go rather than built from Apache Kafka’s code, that speaks the Kafka wire protocol for core produce, fetch and consumer group APIs. KafScale README
- Components
- Brokers; S3 for log segments and their indexes, the source of truth; etcd for metadata, offsets and consumer group state; an operator for Kubernetes, a console and an optional Schema Registry. KafScale architecture
- Proxy
- An optional Kafka-aware proxy in front of the brokers, which the operations guide recommends; brokers can also be exposed directly. KafScale operations guide
- Object storage
- Any store that speaks the S3 API and rejects a create-only write to an existing key: AWS S3, MinIO and several other clouds. Google Cloud Storage, Backblaze B2 and Azure Blob Storage are not supported. KafScale Storage Backend Compatibility
- Managed service
- KafScale is the open source base of Scalytics’ Lascaris, which Scalytics runs in the customer’s cloud or supports on premises. KafScale README
The write path, up to the ack
- Route to the owner
The operations guide recommends connecting through the KafScale proxy, which watches the partition leases in etcd and forwards each partition’s records to the broker that owns it, or to any broker while it has no owner. A broker that does not own the partition answers
NOT_LEADER_OR_FOLLOWER, and the proxy retries on another broker. - Take the lease
On the first request for a partition, the broker takes its lease in etcd with a compare-and-set, under a TTL of 10 s that it keeps alive. It then restores the partition: the end offset from etcd and the segment list from S3.
- Assign offsets
The owner appends the batch to the partition’s buffer in memory and gives it the next offsets. etcd does not assign them.
- Upload
With
KAFSCALE_PRODUCE_SYNC_FLUSHon, the default, and acks not 0, the broker flushes the buffer at once: one segment and its index for the partition, normally holding just this request, uploaded to S3 withIf-None-Match: *, so S3 never replaces a segment that exists. - Record the end offset
After the upload the broker writes the partition’s new end offset to etcd, guarded by its lease. Consumers read up to that offset. If the write fails, the producer gets an error instead of an ack.
- Ackproducer acked
Only when the upload and the etcd write have both succeeded does the broker answer the producer with the base offset. Offsets move on only then, so a failed request leaves no gap.
Where the latency comes from
KafScale Storage Backend Compatibility gives a latency target, not a budget in parts.
Stated target: about 500 ms. The storage compatibility guide says the target assumes low-latency storage access, so it advises placing storage in the same region as the Kubernetes cluster. It is a goal, not a measured percentile.
The sources give no figures for the S3 upload or the etcd write on their own. The overview says KafScale trades latency for operational simplicity.
With sync flush on, every produce request with acks other than 0 waits for its own S3 upload and an etcd write. Turning sync flush off acks from memory and flushes on an interval or a size instead, which the operations guide offers for lower S3 write costs at the price of a larger loss window after a crash.
Who orders the batches
There is no batch coordinator. Each partition has one owner, the broker that holds its lease in etcd, and that broker assigns the offsets in memory, as a Kafka partition leader would. etcd keeps each partition’s durable end offset, written after every upload, along with topic configs, consumer offsets and group state.
A broker’s partition leases hang off one etcd session with a 10 s TTL: if the broker dies, etcd drops them all once the TTL runs out. The broker does not set the TTL, so this default applies and no setting changes it. Consumer groups work the same way: the broker that holds a group’s lease coordinates it.
So writes and reads do have a leader per partition, chosen through etcd instead of KRaft, but no replicas: S3 is the only copy.
The read path
A fetch needs the partition’s lease, as a produce does. A broker that gets a fetch for a partition with no owner takes the lease and restores the partition first, so a consumer can make its broker the owner. While another broker holds the lease, the fetch gets NOT_LEADER_OR_FOLLOWER and no records. The owner reads the partition’s end offset from etcd and serves records up to it.
Each broker keeps a cache of hot segments, 32 MiB by default. A segment goes into it when the broker uploads it, so the owner serves fresh records from memory. On a miss the broker reads the range it needs from S3 using the segment’s index, and prefetches the next segments (KAFSCALE_READAHEAD_SEGMENTS).
A broker that loads a partition, after a restart or a change of owner, first rebuilds its segment list from S3; requests for that partition wait until it is done. Brokers in another region can read from a replicated bucket instead (KAFSCALE_S3_READ_BUCKET).
When something fails
| What fails | What happens |
|---|---|
| etcd is unavailable | Produce, admin and consumer group requests fail with REQUEST_TIMED_OUT; producers see it per partition. KafScale operations guide |
| Fetching while etcd is unavailable | A broker cannot read the partition’s end offset, so it answers REQUEST_TIMED_OUT with the high watermark unknown, which Kafka clients retry. This holds for the partition’s owner too, though it has the partition loaded. Before 2.0 a timed-out read left the high watermark at 0, and a fetch above offset 0 got OFFSET_OUT_OF_RANGE (issue #342). KafScale PR #352: return retryable Fetch errors on metadata timeouts, KafScale issue #342: an owner’s fetch returns OFFSET_OUT_OF_RANGE when its etcd offset read times out, KafScale code at v2.1.0: a fetch reads the end offset from etcd |
| The etcd write after a good upload | If it fails, the producer gets an error instead of an ack: REQUEST_TIMED_OUT, whether etcd did not answer within 3 s or the broker lost the lease, since the broker cannot tell whether the records were written. The segment stays in S3, and the broker drops the partition from memory. The next request for the partition restores it, and the restore adopts that segment: records the producer was told had failed become readable, and its retry writes them a second time. The operations guide says a timeout does not prove that nothing was written. KafScale’s maintainers confirmed this is intended: the segments in S3 are authoritative, so the restore moves the end offset in etcd forward to match them, and delivery is at-least-once. Since 2.1.0 an idempotent producer’s retry gets the original offsets back instead of a second copy, because the restore also rebuilds the producer’s recent sequences from the segments in S3. The simulator models both: scenario 08.2.5 runs its producer without idempotence to show the copy. KafScale code at v2.1.0: the etcd write gates the ack, KafScale code at v2.1.0: the restore adopts any indexed segment, KafScale operations guide at v2.1.0: timeouts, KafScale protocol guarantees: idempotent producers, KafScale PR #327: fence partition logs across lease changes |
| etcd down longer than the lease TTL | The brokers keep running, but their etcd keepalives fail, and about one TTL (10 s) into the outage each broker’s etcd client ends its session. The broker then owns nothing and drops every partition log it owned. To load a partition again it needs a new session, so its requests wait for etcd. When etcd is back, its leader renews every lease for one more TTL; the old owner takes its lease back at its next request with a new ownership token and restores the partition from etcd and S3. The simulator ends the session exactly 10 s into the outage. KafScale code at v2.1.0: a lost session drops ownership; a new one is needed to take a lease again, etcd client v3.6.8: a keepalive with no answer for the TTL ends the session, etcd v3.6.8: a new leader renews every lease by its TTL, KafScale code at v2.1.0: a request takes the lease, then looks for the log of that ownership token |
| A broker dies | Its leases stay in etcd until the 10 s TTL runs out, and no other broker may write or read its partitions until then: a fetch needs the lease too. Then the next request makes another broker take the lease and restore the partition from etcd and S3. Nothing is replicated, so nothing has to catch up. KafScale lease manager code, KafScale code at v2.1.0: a fetch to a broker without the lease |
| A broker shuts down gracefully | It releases all its leases first, so another broker can take over without waiting for the TTL, and then lets the requests in flight finish. A write still in flight then fails its lease check or its lease-guarded etcd write and gets NOT_LEADER_OR_FOLLOWER; if its segment already reached S3, the next owner adopts it at restore. The simulator follows the same order (scenario 08.2.6). KafScale code at v2.1.0: shutdown releases the leases, then drains, KafScale PR #327: fence partition logs across lease changes |
| S3 is degraded or unavailable | The broker refuses produce and fetch: REQUEST_TIMED_OUT while S3 is degraded, KAFKA_STORAGE_ERROR while it is unavailable or an upload fails, which Kafka clients retry. The state comes from S3 latency and error rates over a 60 s window. Offsets move on only after the upload and the etcd write both succeed, so a failed upload leaves no gap: the retry takes the same offsets. KafScale code at v2.1.0: S3 states to error codes, KafScale code at v2.1.0: offsets move on after the upload and the etcd write, KafScale PR #272: a retriable storage error when S3 is unavailable, KafScale PR #273: storage errors for ListOffsets and older Produce and Fetch versions, KafScale PR #254: append multi-batch Produce requests atomically |
| Two owners writing the same segment | Segment uploads carry If-None-Match: *, so S3 never replaces a segment. If a new owner restored the partition before an old owner’s late segment landed, both write the same segment key and the second PUT fails with KAFKA_STORAGE_ERROR; nothing acked is overwritten (issue #324). The conflict does not count as an S3 failure (PR #345), and the broker whose PUT lost evicts its handle, so its next request restores the winning segment and writes on after it (PR #353). With equal upload times the PUT sent first wins: in scenario 08.2.6 an owner stopped gracefully mid-upload wins the key, and the new owner’s PUT fails, adopts the winner and writes on after it, so the old owner’s record, whose producer got an error and retried, is in the log twice. KafScale code at v2.1.0: If-None-Match on segment uploads, KafScale code at v2.1.0: a failed claim fences the handle, KafScale PR #327: fence partition logs across lease changes, KafScale issue #324: acked records overwritten when a partition lease moves away and back, KafScale issue #343: an upload conflict leaves the partition unwritable while the lease is held, KafScale PR #353: recover partition writes after upload conflicts, KafScale issue #335: a fencing conflict counted as an S3 failure blocks all produces for 60 s, KafScale PR #345: keep fencing conflicts out of S3 health errors |
| Object storage without conditional writes | Because segment uploads rely on If-None-Match: *, the store must reject a create-only write to a key that exists. The storage guide lists Google Cloud Storage and Backblaze B2 as not supported: the Google Cloud Storage XML API honours If-None-Match only on reads, and B2 has no conditional writes. Brokers write a probe key twice at startup and refuse to start if the second write is not rejected (PR #346). The simulator has one S3 and does not model the choice of store. KafScale Storage Backend Compatibility, KafScale issue #336: no startup check for S3 conditional PUT support, KafScale PR #346: check S3 fencing at startup |
| A broker paused past its lease | Its leases expire after the 10 s TTL and another broker takes over. When it resumes and learns its etcd session is gone, it drops every partition log it owned, and a partition that comes back to it is restored from etcd and S3 before it writes again, so it numbers on from the right offset. A write in flight at the pause is fenced: its lease check fails with NOT_LEADER_OR_FOLLOWER, or its segment upload fails If-None-Match with KAFKA_STORAGE_ERROR. The simulator does not model the write in flight at the pause: it fails at once, as on a hard kill. KafScale code at v2.1.0: a lost session drops ownership and runs OnLost, KafScale code at v2.1.0: the next acquisition reloads the partition, KafScale PR #327: fence partition logs across lease changes, KafScale issue #324: acked records overwritten when a partition lease moves away and back |
| etcd down longer than the proxy’s cache | The proxy routes from its cache while etcd is down, but only while the cache is fresh: KAFSCALE_PROXY_BACKEND_CACHE_TTL_SEC, 60 s by default. After that the proxy is not ready: it answers each client request with REQUEST_TIMED_OUT itself, closes that connection, and /readyz returns 503. It is ready again as soon as etcd answers. The limit does not apply with static brokers (KAFSCALE_PROXY_BACKENDS). The proxy refreshes its cache every 10 s, so the real grace is between 50 and 60 s; the simulator counts the full 60 s from the moment etcd stops. KafScale proxy code at v2.1.0: the cache is fresh for the TTL, KafScale proxy code at v2.1.0: not ready, the connection is closed, KafScale PR #319: proxy cache TTL |
Cross-zone traffic: what goes, what stays
Goes
- Replication between brokers: there is none, one copy per partition with S3 for durability
Stays
- Client traffic: neither the broker nor the proxy knows about zones, so a client reaches its partition’s owner wherever it runs
- Calls to etcd, a quorum ideally spread across zones
- Uploads to and reads from S3
The operations guide advises spreading etcd members across zones so etcd survives losing one. It says nothing about the zones of clients or brokers. KafScale operations guide
Does it support...
| Feature | Status | Details |
|---|---|---|
| Idempotent producer | Yes | Since 2.1.0, without transactions: brokers and the proxy answer InitProducerId with a producer ID from etcd, and an idempotent produce needs acks=all. The last five batches per producer and partition are deduplicated, and that state is rebuilt from S3 after a restart or a change of owner. Before 2.1.0, idempotence had to be turned off in the client. KafScale protocol guarantees: idempotent producers |
| Transactions | No | Exactly-once semantics and transactions are an explicit non-goal. KafScale README |
| Compacted topics | No | An explicit non-goal. KafScale README |
| Consumer groups | Yes | The classic group protocol (JoinGroup, SyncGroup, Heartbeat, OffsetCommit, OffsetFetch), with offsets and group state in etcd. KafScale technical specification |
| Share groups | No | The broker does not advertise the share group APIs. KafScale broker code (cmd/broker/main.go) |
| Deleting records | No | DeleteRecords is not supported; S3 lifecycle rules handle retention. KafScale technical specification |
| Replication factor above 1 | No | No replication between brokers: S3 handles durability, and Kafka’s internal replication APIs are not implemented. KafScale technical specification |
| Schema Registry | Yes | A separate service that serves the Confluent Schema Registry API for Avro, Protobuf and JSON Schema and keeps its state in etcd and S3. The simulator does not model it. KafScale Schema Registry docs |
The configs it adds
| Config | Level | What it does |
|---|---|---|
KAFSCALE_PRODUCE_SYNC_FLUSH | Broker | Flushes to S3 on every produce request with acks other than 0. Default true; with false, acked records still in the buffer are lost if the broker crashes. KafScale operations guide |
KAFSCALE_FLUSH_INTERVAL_MS | Broker | The time after which the buffer is flushed, which matters when sync flush is off. Default 500; the cost-optimized profile uses 2000 or more. KafScale operations guide |
KAFSCALE_SEGMENT_BYTES | Broker | The size at which the buffer is flushed. Default 4 MiB; the cost-optimized profile uses 32 MiB or more. KafScale operations guide |
KAFSCALE_READAHEAD_SEGMENTS | Broker | How many following segments a broker prefetches from S3 into its cache. Default 2. KafScale broker code (cmd/broker/main.go) |
KAFSCALE_PROXY_BACKEND_CACHE_TTL_SEC | Broker | How long the proxy keeps routing from its last etcd read while etcd cannot be read. Default 60; past it the proxy is not ready. KafScale operations guide |
enable.idempotence | Client | Kafka clients turn it on by default, which works since 2.1.0 with acks=all; upgrade every broker and proxy first. Leave transactional.id unset. Before 2.1.0 it had to be false. KafScale protocol guarantees: idempotent producers |
How it differs from Apache Kafka
The coordinator lives outside Kafka, in etcd: partition leases, end offsets, consumer offsets and group state. KIP-1164 keeps its metadata inside Kafka, in the internal topic __diskless_metadata, where its coordinator also assigns the offsets.
Each partition has one owner that takes all its writes and reads and assigns its offsets in memory. KIP-1163 has no leader for writes: any broker takes records for any partition, and the coordinator assigns offsets at commit.
Each flush writes one segment and its index per partition, with sync flush normally one per produce request. KIP-1163 packs batches from many partitions into one shared object, closed by time or size.
There are no transactions; the idempotent producer works since 2.1.0. KIP-1163 plans to keep the idempotent producer and plans transactions for protocol v2.
KafScale is its own broker in Go, not a change to Apache Kafka, and supports the subset of Kafka APIs its specification lists. Every topic is stored in S3; the KIPs add diskless as a topic type next to classic topics.
See it in the simulator
- KafScale: the write path, step 3
- KafScale: the write path, step 4
- KafScale: a lease owner crashes, step 2
- KafScale: a lease owner crashes, step 4
- KafScale: etcd goes down, step 3
- KafScale: S3 goes down, step 3
- KafScale: a failed etcd write after a good upload, step 5
- KafScale: etcd down longer than the proxy cache, step 5
- KafScale: a paused broker comes back without overwriting, step 6
The simulator’s model follows KafScale’s code and docs at the v2.1.0 tag, apart from topic IDs, new in 2.1.0, which it does not model. It stretches the timings so each step is visible: the scenarios here use a 600 ms S3 upload and a 40 ms etcd write, figures KafScale’s sources do not give. It models only the sync flush mode and keeps the lease TTL at KafScale’s 10 s default. etcd is one up/down entity with no members or quorum, and brokers notice an outage at once; their etcd sessions end exactly one lease TTL into it. For a partition with no owner yet, the proxy picks a broker by a stable hash with no zone preference. A graceful shutdown releases a broker’s leases first and drains its in-flight requests after, as KafScale’s code does. Where the sources are silent it makes its own choices: a new owner restores a partition with no extra delay, and a fetch while etcd is down answers REQUEST_TIMED_OUT at once, where KafScale’s broker waits up to 3 s for its etcd read. Of two segment uploads to the same key, the one that ends first wins, and the losing upload is not drawn in the bucket while it runs. An idempotent producer’s retry of a record already in a finished segment in S3 gets that record’s offset back and is not appended again; the simulator reads the producer state from the segments, with no five-batch window and no check for sequence gaps, and does not model the INVALID_REQUIRED_ACKS refusal of an idempotent produce with acks other than all. The KafScale scenarios run their producers without idempotence, so their retries show the at-least-once copies. S3 health is one monitor for the cluster, not one per broker; a single bad sample decides the state, fetches take no samples, and a slow S3 call takes 2 s. A paused broker’s leases expire one TTL after the pause starts, its requests time out at once, and its work in flight fails at the pause; the simulator pauses brokers on KafScale only. It does not model acks=0, the flush-interval mode, reads from a replicated bucket in another region, network partitions between brokers and etcd, the other etcd server errors (UNKNOWN_SERVER_ERROR), the NOT_LEADER_OR_FOLLOWER that Produce below v4 and Fetch v5 and older get instead of KAFKA_STORAGE_ERROR, the Produce request’s own timeout, CRC checks, or the Schema Registry.
The proposals behind it
Sources
- KafScale v2.1.0 release notes
- KafScale v2.0.0 release notes
- KafScale v2.0.1 release notes
- KafScale README
- KafScale technical specification
- KafScale overview
- KafScale architecture
- KafScale operations guide
- KafScale protocol guarantees: idempotent producers
- KafScale Storage Backend Compatibility
- KafScale Schema Registry docs
- KafScale broker code (cmd/broker/main.go)
- KafScale proxy code (cmd/proxy/main.go)
- KafScale lease manager code
- KafScale LICENSE
- KafScale NOTICE
- KafScale PR #327: fence partition logs across lease changes
- KafScale PR #272: a retriable storage error when S3 is unavailable
- KafScale PR #254: append multi-batch Produce requests atomically
- KafScale PR #319: proxy cache TTL
- KafScale PR #277: Schema Registry
- KafScale PR #352: return retryable Fetch errors on metadata timeouts
- KafScale PR #353: recover partition writes after upload conflicts
- KafScale PR #345: keep fencing conflicts out of S3 health errors
- KafScale PR #346: check S3 fencing at startup
- KafScale issue #342: an owner’s fetch returns OFFSET_OUT_OF_RANGE when its etcd offset read times out
- KafScale issue #324: acked records overwritten when a partition lease moves away and back
- KafScale issue #343: an upload conflict leaves the partition unwritable while the lease is held
- KafScale issue #335: a fencing conflict counted as an S3 failure blocks all produces for 60 s
- KafScale issue #336: no startup check for S3 conditional PUT support
- etcd client v3.6.8: a keepalive with no answer for the TTL ends the session
- etcd v3.6.8: a new leader renews every lease by its TTL
- KafScale code at v2.1.0: a fetch reads the end offset from etcd
- KafScale code at v2.1.0: the etcd write gates the ack
- KafScale code at v2.1.0: the restore adopts any indexed segment
- KafScale operations guide at v2.1.0: timeouts
- KafScale code at v2.1.0: a lost session drops ownership; a new one is needed to take a lease again
- KafScale code at v2.1.0: a request takes the lease, then looks for the log of that ownership token
- KafScale code at v2.1.0: a fetch to a broker without the lease
- KafScale code at v2.1.0: shutdown releases the leases, then drains
- KafScale code at v2.1.0: S3 states to error codes
- KafScale code at v2.1.0: offsets move on after the upload and the etcd write
- KafScale PR #273: storage errors for ListOffsets and older Produce and Fetch versions
- KafScale code at v2.1.0: If-None-Match on segment uploads
- KafScale code at v2.1.0: a failed claim fences the handle
- KafScale code at v2.1.0: a lost session drops ownership and runs OnLost
- KafScale code at v2.1.0: the next acquisition reloads the partition
- KafScale proxy code at v2.1.0: the cache is fresh for the TTL
- KafScale proxy code at v2.1.0: not ready, the connection is closed
Changes to this page
- Read at KafScale 2.1.0, released 26 November 2026: status, comparison row and every docs and code link point at the v2.1.0 tag. 2.1.0 adds the idempotent producer without transactions, so the idempotent producer row, the enable.idempotence config and the failed etcd write row say so, and the simulator now models it: an idempotent producer’s retry of a record already in S3 gets its offset back.
- The model now matches the v2.0.1 tag for the two fixes it differed on: a fetch while etcd is unavailable answers REQUEST_TIMED_OUT at the owner too (PR #352), and a new owner whose segment upload loses If-None-Match drops its log and adopts the winning segment (PR #353). Scenario 08.2.6 now shows that order, the one equal upload times produce.
- Rewritten for KafScale 2.0, released 20 November 2026: the etcd write gates the ack, fetches take the lease, S3 errors answer KAFKA_STORAGE_ERROR, segment uploads are create-only, and the proxy stops past its etcd cache TTL. Docs links point at the v2.0.1 tag, simulator steps come from scenarios 08.1.1 and 08.2.1 to 08.2.7, and the rows say where the simulator’s model, read before the tag, differs from the release.
- Object storage corrected: no source says AWS S3 and MinIO are tested in production, and Azure Blob Storage is not supported.
- Published, with simulator steps from scenario 08.1.1.