EOS in Streams & Interactive Queries

Turn your stream processor into a queryable, crash-proof microservice.

0/3 done

EOS transactions + queryable state

Two superpowers of Kafka Streams

1. Exactly-once (processing.guarantee=exactly_once_v2). A Streams app reads, updates state stores, and writes output. EOS wraps all three — the output records, the state-store changelog writes, and the input offset commits — into a single Kafka transaction. A crash mid-processing rolls back atomically; on restart the app resumes as if the failed attempt never happened. _v2 (KIP-447) made this cheap by sharing one producer per instance instead of one per task.

2. Interactive Queries (IQ). A state store isn't a black box — you can expose it over HTTP and serve point lookups directly from the app's local RocksDB, no external database. Because the store is sharded across instances by the same partitioning as the input, IQ includes metadata to find which instance owns a given key, so you can proxy the request to the right node. The result: a stream processor that is also a low-latency, horizontally-sharded read API — with failover for free via changelog replay.

Expose a Streams state store over HTTP (Python/Faust-style)

Materialise per-user order totals into a table, then serve them via a web route. The processing guarantee is exactly-once; the route is the interactive query.

Reflect

Find a microservice that wraps Kafka + a database for read-after-write.

  • Could interactive queries replace that database entirely for point lookups?
  • What's your tolerance for the rebalance window during which a key's owner moves?
  • Is the extra latency of EOS transactions acceptable for that path, or is at-least-once fine?

Reading in progress · 0 of 3 activities done