Skip to main content
Interactive 3D/Event-Driven ML Architecture
Streaming ML Pipeline
Event Sources
user actions, IoT, tx
Kafka Topics
durable log, partitioned
1 consumer group
Stream Processor
Flink / Spark Streaming
Feature Store
Redis / online features
Model Server
real-time inference
Output
recommendation / alert
event flow
Event Rate
10k ev/s
Processing Rate
9.5k ev/s
Consumer Groups
1
Consumer Throughput
9.5k/s
Consumer Lag
1000 events
Lag (time)
105ms
Kafka Consumer Lag
1.0k messages behind
Delivery Semantics: at-least-once
At-Least-Once
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.