Messages may duplicate. Idempotent consumers required. Default for most ML pipelines.
Exactly-Once
No duplicates, no loss. 2x overhead. Required for financial, dedup-sensitive models.
Pipeline Controls
Event Rate
events/sec10k/s
1k100k
Consumer Groups
Fault Injection
Delivery Semantics
Consumer lag is the key health metric - it tells you if your ML pipeline is falling behind the event stream.
Event-Driven ML Architecture - Interactive Visualization
Event-driven ML pipelines decouple data producers from ML consumers through a persistent event log (Kafka). Events flow from sources - user actions, IoT sensors, financial transactions - into Kafka topics, then through a stream processor (Flink or Spark Streaming) that computes features, calls the model, and emits predictions. Consumer lag is the critical health metric: when lag grows, your ML pipeline is falling behind the event stream, meaning predictions are delivered late. Multiple consumer groups allow multiple models to independently consume the same event stream.
Consumer lag: the number of events in the Kafka queue that have not yet been processed - zero lag means real-time
At-least-once delivery: messages may be delivered more than once; consumers must be idempotent
Exactly-once semantics: transactional Kafka + idempotent producers guarantee no duplicates and no loss - 2x overhead
Backpressure: when processing rate falls below event rate, lag grows - circuit breakers or auto-scaling are required
Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.