Engineering notes from the StoatFlow team — launch announcements, design choices, benchmarks, and product updates.
Deep Dive

Why a stream processor must never reorder a partition

StoatFlow used to sort each partition's buffered records by timestamp, so the oldest event went first. Under the right timing that lost a record for good after a crash, under exactly-once and at-least-once alike, without a log line or a metric. This post walks the sequence from a buffered record to a committed offset that runs past it, why the obvious patch would have broken exactly-once, and how the one stall that offset order introduced was removed as well.

Deep Dive

Your timer fired on another thread

StoatFlow runs a key's timers on the same lane as its records, so onTimer never races process() for that key. The lane is chosen by hashing key bytes — and a timer key is serialised again, by its own serde. Behind a Processor API source declared with only a deserializer, that serde was the default, and when the default wrote different bytes than the topic, a key's timer fired on another lane, concurrently with its records, without a word. How it happens, why Kafka Streams never meets it, and how StoatFlow now refuses to run a proven split.

Engineering

The self-join that emitted nothing

On Kafka Streams, s.join(s) over two records of one key emits four results. On StoatFlow it emitted none — no error, no log line, no metric. A stream–stream join chose which side a record belonged to by the name of the source it came from, and a self-join's records all come from one source. The same rule dropped records in chained joins, merged legs and cogroups. How we found every affected shape by running Kafka Streams' own test driver as the oracle, and how the fix makes the edge carry the input.

Deep Dive

Testing and operating event time

The TopologyTestDriver's stream time is the maximum it has seen, with no out-of-orderness lag and no cross-partition minimum; production keeps a 10-second lag and the minimum. A window-close test that passes in the driver emits later on a real broker, and can count a record the driver dropped. Part 4 of the event-time series: which tests transfer, how to read /watermarks, the meters that matter, the one alert to set on day one, and what a restart does to the watermark.

Engineering

A use-after-free in a RocksDB iterator, and the test that passed on Linux

A StoatFlow state store layers each epoch's uncommitted writes over RocksDB in native write batches, and an iterator reads through all of them. Four defects let a batch be freed, or rewritten, under an iterator still reading it: segmentation faults, keys read twice, a value read back as garbage. None was reachable through a store StoatFlow builds. The interesting part is how we proved them — one JVM per scenario, the allocator scribbling freed memory — and why the first version of that test passed on Linux.

Deep Dive

Closing a window under exactly-once

In StoatFlow a window's final result is not emitted the instant the watermark passes its close — it is emitted at a commit barrier, judged against the watermark stamped on the barrier before, up to two commit intervals later. Part 3 of the event-time series follows one watermark advance from the consumer thread to the committed result: what listens, the one clock that drops and closes, the committed-watermark frontier, and what survives a restart.

Deep Dive

Making the watermark move: sources, idleness, and the partition that stopped the world

StoatFlow's watermark is a minimum across partitions, so one source decides for all of them. Part 2 of the event-time series is the configuration discipline that follows: what each source declares about its own time, what idleness does and the two bugs it took to get it right, the one strategy StoatFlow refuses beside a window, how to give a single source a Kafka Streams-style watermark, and why ordered dispatch already does most of what Flink needs watermark alignment for.

Deep Dive

Three clocks: stream time, Flink watermarks, and the one watermark StoatFlow computes

Kafka Streams, Flink and StoatFlow answer "is this window done?" with three different clocks. StoatFlow runs two of them: it accepts a late record the way Kafka Streams does, on the operator's stream time, and closes the window the way Flink does, on a single global watermark. Part 1 of a four-part series on event time — including two corrections to a claim our own compatibility matrix made about grace.

Engineering

Scheduled sources: a topology source that isn't a topic

Every source in a Kafka Streams topology is a topic. The calendar and your own state — a snapshot across keys, a sweep over what you hold — needed a job outside the topology or a punctuator bent into a source. StoatFlow's scheduled sources run your code on a schedule and turn what it forwards into an ordinary KStream: keyed, processed in parallel on the lanes, committed with the stream. What that opens up, how it works, two verified examples, and the catch — the emitter's view is read-only, a run does not yield to live traffic on its own, and a read from outside the engine is not in the transaction.

Engineering

Cutting CI from 50 minutes to 16: choosing a runner platform

Our CI p90 hit 54 minutes and the constraint was RAM, not CPU — a faster runner was the wrong instinct. We built a self-hosted Hetzner fleet, validated it, chose Blacksmith on a head-to-head benchmark, then took another eight minutes off by deleting four lines of YAML. Four weeks on: the speed held, the cost model did not.

Announcement

From first alpha to release candidate: the road to StoatFlow 1.0.0

StoatFlow 1.0.0-rc.1 is cut and the feature set is frozen — what separates the candidate from GA is proof, not features. The twelve weeks from the first alpha: 26 releases, 1,086 commits, a compatibility matrix grown from 417 to 619 tracked entries, three full-codebase review rounds — and the framework integration that kept us honest.

Deep Dive

Three gates, one transaction: error handling in StoatFlow

A record can fail on the way in, in the middle, or on the way out. StoatFlow gives every gate the same verdicts — continue, fail, or dead-letter — and settles them all inside the exactly-once transaction: DLQ records commit on the same barrier as your output, and what cannot be handled kills the epoch, never the guarantee. The full model, from one bad record to a Kubernetes restart.

Deep Dive

Internal consistency on Kafka: emitting a correct answer at every commit

Money can only be moved, never created — so a stream that tracks balances should read total = 0 at every consistent cut. The Flink Table API gets it right 0.035% of the time; our Kafka Streams twin sends total to −1,619 … +1,792. StoatFlow holds it at exactly 0, at every one of its committed cuts. Here is why, and the measured proof.

Engineering

In-place engine restart: the primitive behind multi-standby HA

The failover-testing post ended on an exploratory idea — rebuild the processing engine in the same process, no JVM exit — and a constraint: stay at two standbys. Both have moved. The in-place restart shipped, and a lag-aware leader election shipped on top, so a StoatFlow HA cluster now runs one active and any number of warm standbys, scaling past two elects exactly one successor instead of crash-looping, and a graceful role swap no longer bounces the pod.

Engineering

Measuring StoatFlow failover: four scenarios, from the logs

The obvious way to test HA failover — kubectl delete pod — is a graceful SIGTERM handoff, not a crash. Here are the four real failover scenarios, the millisecond timing measured from pod logs (because a 10-second Prometheus scrape cannot resolve a one-second event), and what the numbers revealed: a single JVM crash recovers in place without failing over, and stop-the-world is not the latency blip.