Articles published on this website summarize publicly available information, industry research and educational materials.
Event-Driven Architecture Concepts
In an event-driven architecture (EDA), components communicate by producing and consuming events rather than by making direct synchronous calls. An event represents a fact about something that has happened — for example, an order being placed, a record being updated, or a sensor reading being recorded. The producer of the event does not need to know which consumers will process it, and consumers do not need to know which producer generated it.
This decoupling has practical consequences for system design. Services can be deployed, scaled, and modified independently, as long as the event schema they produce or consume remains compatible. New consumers can be added to an event stream without modifying the producer. Processing can happen asynchronously, allowing producers to continue their work without waiting for downstream processing to complete.
Event Brokers and Streaming Platforms
Event brokers are middleware components that receive events from producers, store them durably, and deliver them to consumers. The specifics of how they do this vary significantly between platforms.
Traditional message brokers such as RabbitMQ use queue and exchange models where messages are typically removed from the broker after being consumed. Event streaming platforms such as Apache Kafka use an append-only log model where events are retained for a configurable period, allowing consumers to replay events and supporting multiple consumer groups independently reading the same stream.
The log-based model of event streaming platforms makes them suitable not only for real-time processing but also for event sourcing patterns, where the log of events itself serves as the authoritative record of state changes in a system.
Messaging Patterns
Publish-Subscribe
In the publish-subscribe pattern, producers publish events to a topic or exchange, and all subscribed consumers receive each event. This is appropriate when multiple independent systems need to react to the same event — for example, order confirmation events that trigger both a warehouse fulfillment service and a customer notification service.
Event Streaming
Event streaming involves processing events as they arrive, typically using stream processing frameworks that can apply transformations, aggregations, or joins across event streams in near real time. Stream processing frameworks can filter events, enrich them with reference data, compute running aggregations, and detect patterns across sequences of events.
Command Events
In some event-driven designs, events carry an implicit command — a request for another service to perform an action. This pattern is sometimes called event-carried state transfer, where the event contains the data needed for downstream processing rather than requiring consumers to look up additional state. It reduces coupling to the producing service but increases message payload size.
Design Considerations
Event schema design requires careful attention to backward compatibility. Consumers across an enterprise may be running different versions of their code, and events must be interpretable across those versions. Schema registries provide a centralized store for event schemas and enforce compatibility rules when new versions of a schema are registered.
Ordering guarantees vary between platforms and configurations. Apache Kafka provides ordering within a partition but not across partitions. Designing partition keys appropriately — so that events that must be processed in order are routed to the same partition — is necessary to preserve ordering for related events.
Observability in Event-Driven Systems
Debugging event-driven systems is more complex than debugging synchronous request-response systems because the flow of a logical operation spans multiple asynchronous messages. Distributed tracing, where a trace context is propagated through event headers, enables reconstruction of end-to-end flows across producer and consumer services. Dead letter queues capture events that could not be processed successfully, providing a mechanism for error inspection and reprocessing.