Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

What is Event Streaming?

Event streaming is a data architecture paradigm where data is captured, stored, and processed as continuous streams of events.


Traditional application architectures are request-driven: a client sends a request, the server processes it, and returns a response. Data is stored in databases and queried on demand.

Event-driven architectures invert this model: systems emit events as things happen, and other systems react to those events. Events are stored in order and can be replayed, enabling new capabilities that request-response architectures cannot provide.

Request-response architecture compared with event-driven architecture

ConceptDefinitionExample
EventImmutable fact that something occurred"OrderPlaced", "PaymentReceived", "UserLoggedIn"
CommandRequest for something to happen"PlaceOrder", "ProcessPayment", "SendEmail"

Events are named in past tense because they represent facts that have already happened. Commands are named in imperative form because they request future action.

Key distinction: Events describe what happened. Commands can be accepted or rejected based on business rules; if a command is rejected, no event is emitted (or a rejection event is emitted).


At its core, Kafka is a distributed commit log: an ordered, append-only sequence of records. This simple data structure provides powerful guarantees.

Append-only commit log with readers at independent offsets

PropertyDescription
Append-onlyNew records are only added to the end; existing records are never modified
ImmutableOnce written, records cannot be changed
OrderedRecords have a strict sequence (offset)
DurableRecords are persisted to disk and replicated when configured
ReplayableReaders can start from any retained position and replay forward

The append-only constraint enables:

  1. Sequential I/O: Writing to the end of a file is orders of magnitude faster than random writes
  2. Easy replication: Followers simply append whatever the leader appends
  3. Consumer independence: Readers track their own position without modifying the log
  4. Point-in-time recovery: Start from any offset to replay history

Traditional message queues (RabbitMQ, ActiveMQ, IBM MQ) implement a push-based model where the broker actively delivers messages to consumers.

Message queue model with competing consumers Queue characteristics:

AspectBehavior
DeliveryPush-based—broker sends to consumers
LifetimeMessage deleted after successful delivery
ConsumersCompeting—each message goes to one consumer
OrderingUsually FIFO across entire queue
ReplayNot possible—messages are deleted

Traditional pub/sub systems deliver messages to all subscribers of a topic.

Publish-subscribe model delivering a copy to each subscriber Pub/sub characteristics:

AspectBehavior
DeliveryPush-based or pull-based depending on implementation
LifetimeOften transient—no retention
ConsumersIndependent—all subscribers receive everything
OrderingOften not guaranteed
ReplayLimited or not supported

Kafka combines log-based streaming with two coordination models: consumer groups for ordered partition processing and share groups for queue-style processing.

Kafka log model with two consumer groups reading the same topic Kafka characteristics:

AspectBehavior
DeliveryPull-based—consumers fetch at their own pace
LifetimeRetained based on time or size policy
ConsumersSeparate groups provide pub/sub; consumer groups or share groups distribute work within an application
OrderingConsumer groups preserve partition order; share groups trade strict ordering for concurrent record processing
ReplayFull replay from any retained offset

Share groups (Kafka 4.2+)

Share groups allow multiple consumers to process records from the same partition concurrently. The broker tracks per-record acquisition, acknowledgement, and delivery attempts. Use them for independent work items; use a consumer group when processing must follow partition order.


Kafka uses a pull-based model where consumers request data from brokers, rather than brokers pushing data to consumers.

AdvantageExplanation
Consumer-controlled rateConsumers fetch only what they can process, preventing overload
Batching efficiencyConsumers can batch requests for efficient network utilization
Simple brokerBroker does not track consumer state or manage delivery retries
Replay supportConsumers control their position and can re-read data

In push-based systems:

  • Broker must track each consumer's state
  • Slow consumers can back up the entire system
  • Broker must implement complex flow control
  • Replay requires special infrastructure

Producers and consumers do not need to be online simultaneously. A consumer can process events hours or days after they were produced.

Temporal decoupling between producer and consumer

Events can be replayed to:

  • Rebuild materialized views
  • Fix bugs in processing logic and reprocess
  • Bootstrap new consumers with historical data
  • Perform what-if analysis on historical events

The same topic can serve different use cases simultaneously:

Consumer GroupUse CaseProcessing Pattern
analyticsReal-time dashboardsStreaming aggregation
search-indexerSearch updatesIndex on every event
data-warehouseBatch analyticsPeriodic bulk loads
audit-logComplianceLong-term archival

Producers and consumers are decoupled:

  • Producers do not know who consumes their events
  • Consumers do not know who produces events
  • New consumers can be added without producer changes
  • Processing logic can be changed without affecting producers

Event sourcing stores the sequence of events that led to current state, rather than just the current state itself.

Storing current state compared with storing the event history

BenefitDescription
Complete audit trailEvery state change is recorded
Temporal queries"What was the state at time T?"
DebuggingReplay events to understand what happened
FlexibilityDerive new views from historical events

Kafka's log retention and compaction features make it suitable as an event store for event-sourced systems.


Event streaming enables stream processing: continuous computation over unbounded data.

Data TypeCharacteristicsProcessing
BoundedFixed size, completeBatch processing
UnboundedInfinite, never completeStream processing

Traditional batch processing operates on bounded datasets. Stream processing operates on unbounded streams, processing events as they arrive.

Since streams are unbounded, aggregations require windows—bounded subsets of the stream.

Tumbling and hopping windows over an event stream

Window TypeDescriptionUse Case
TumblingFixed size, non-overlappingHourly aggregations
HoppingFixed size, overlappingMoving averages
SlidingFixed size, event-triggeredContinuous monitoring
SessionActivity-based, variable sizeUser session analytics