Event Streaming Systems¶
Event streaming systems are designed to capture, distribute, and process continuous streams of events in real time. They have become popular in modern architectures because they make it easy to connect services, build reactive workflows, and analyze data as it flows through the system. Given these strengths, it is common for teams to ask whether such systems could serve as an event store for event sourcing.
The Strengths¶
Event streaming systems provide capabilities that appear attractive for event sourcing:
- High throughput: Built to handle massive numbers of events per second across distributed infrastructures.
- Low latency: Events can be delivered to consumers almost immediately after being produced.
- Scalability: Designed to run across clusters, supporting large data volumes and high levels of concurrency.
- Durable messaging: Streams often persist events for a configurable period, ensuring that consumers can catch up if they fall behind.
- Integration: Streaming systems naturally connect multiple services and enable event-driven architectures.
These strengths make them ideal for real-time processing and integration scenarios.
The Limitations¶
However, using an event streaming system as an event store for event sourcing introduces fundamental problems:
- Temporary retention: Streams are not designed for permanent storage – events are usually kept only for a limited time before expiring.
- Replay limitations: While consumers can re-read events within the retention window, there is no guarantee of long-term replayability.
- Immutability gaps: Some systems allow compaction or log cleaning, which can remove historical events and compromise the event history.
- Ordering constraints: Ordering is typically guaranteed only within partitions, not globally across a stream.
- Observability mismatch: Although streaming systems provide event feeds by design, they are optimized for message delivery, not for long-term event observability and querying.
- Querying difficulties: Streaming platforms are not optimized for ad-hoc event queries or projections; specialized processing frameworks are required to achieve similar functionality.
In short, streaming systems are excellent at moving events, but not at safely storing them forever.
Conclusion¶
Event streaming systems are powerful tools for distributing and processing events in real time. They are indispensable in many event-driven architectures, but they are not substitutes for event stores. Treating them as such often results in data loss, replay limitations, and complex workarounds to maintain long-term consistency.
Next up: Specialized Event Stores – databases designed from the ground up to meet the unique requirements of event sourcing.