Event Streams

Summary: An event stream is a sequence of small, self-contained, and immutable objects called events, representing something that happened at a point in time.

Sources: chapter11

Last updated: 2026-04-18


Characteristics

  • Immutability: Once an event has happened, it cannot be changed. Any subsequent change (like a cancellation) is a separate event.
  • Unboundedness: Unlike files or databases, streams never “finish.” Data arrives gradually over time (source: chapter11, page 439).
  • Encoding: Events can be encoded as JSON, XML, or binary formats like Avro or Protocol Buffers.

Producers and Consumers

  • Producer (also known as publisher or sender): Generates an event once.
  • Consumer (also known as subscriber or recipient): Processes events generated by producers.
  • Events are often grouped into topics or streams.

Delivery Mechanisms

  1. Direct Messaging: Direct network communication between producer and consumer (e.g., UDP multicast, ZeroMQ).
  2. Message Brokers: Intermediary nodes that store and distribute events (e.g., RabbitMQ, Kafka).