Kafka Streams Needs Real Timers
Hartmut Armbruster, StoatFlow
Wed, Nov 4, 4:15–5:00 PMRoom 2012
Kafka Streams gives you punctuators: callbacks that fire on an interval, per task. If you need a per-key timeout, you typically scan a state store, find whatever is due, trigger side effects, and remember to delete or reschedule it yourself. Every team that needs cart abandonment, session expiry, SLA deadlines, or delayed retries eventually reinvents this pattern.
Flink’s keyed TimerService solves the same problem differently: register a one-shot timer for the current key and timestamp, get an onTimer() callback for that exact key, and let the runtime handle deduplication, deletion, and dispatch. In Kafka Streams you emulate timers; in Flink you ask for them.
This talk compares the two models honestly: where Kafka Streams’ punctuators are simple and powerful, where they break down, and what bugs hide inside the common state-store-scan idiom. Then it sketches a first-class per-key timer API for the Kafka Streams Processor API: stream-time and wall-clock timers, automatic per-key serialisation, deletable one-shot registrations, and callbacks that fire for the key that registered them.
The goal is not to turn Kafka Streams into Flink. It is to ask what Kafka Streams would look like if per-key timeouts were treated as a runtime primitive rather than an application-level workaround.
Speaker
-
Hartmut Armbruster
Software Architect, Developer., StoatFlow
Hartmut is a software engineer and tech lead with a strong passion for architecture, data streaming, and distributed systems. He has designed and delivered solutions for mission-critical platforms, working with clients including HSBC, NEX Group plc, Raiffeisen Switzerland, Deutsche Bahn, and eu-LISA. He is now building StoatFlow.io, a stream processing engine born from years of work on systems like these.