An order is confirmed. Inventory needs to reserve stock, fulfillment needs to prepare a shipment, and analytics needs to update demand estimates. One design makes the order service call every downstream system and wait. Another publishes a fact that interested consumers can process independently.
Event-driven architecture organizes work around those facts and reactions. It can reduce direct dependencies and absorb bursts, but it does not remove coordination. The coordination moves into event contracts, delivery semantics, state transitions, ownership, and operational recovery.
The title’s contrast with polling describes a common application-level benefit: services can react to events instead of repeatedly asking whether something changed. It does not mean every component in an event-driven system stops polling. Kafka consumers, for example, fetch records from brokers. Architectural decoupling and transport implementation are different questions.
Begin with the distinction between an event and a command
An event states that something happened: OrderConfirmed, PaymentAuthorized, or ShipmentDispatched. A command requests an action: authorize a payment or cancel a reservation. Both can travel through messaging infrastructure, but their meaning and ownership differ.
The producer of an event owns the fact it declares. A consumer decides how to react within its own responsibilities. A command usually names an intended action and has an explicit recipient or handling responsibility. Calling every message an event can conceal these differences.
Martin Fowler’s discussion of event-driven styles distinguishes several patterns that are often grouped together. Event notification, event-carried state transfer, event sourcing, and CQRS solve related but different problems. Choosing a message broker does not automatically commit a system to all of them.
For the order example, an event should make clear whether confirmation means payment has already been authorized or merely that a customer submitted a request. Ambiguous names spread inconsistent assumptions across consumers.
Decoupling changes the dependency rather than eliminating it
With synchronous calls, the caller commonly needs the downstream service to respond within its request budget. With asynchronous messaging, a producer can complete after publishing, while consumers process later. This can isolate timing and availability requirements when the business workflow permits it.
The services still depend on the event’s meaning, schema, and delivery behavior. They may also depend on the messaging platform’s availability and retention. A producer can be loosely coupled to consumer timing while remaining tightly coupled to a poorly defined shared contract.
Event-carried state transfer includes enough information for a consumer to act without repeatedly querying the producer. A small notification contains less data but may trigger additional calls. Choose deliberately: minimizing payload size can accidentally recreate a synchronous dependency through follow-up requests.
The broader article on systems thinking in DevOps helps explain this tradeoff. Local independence is useful when the interactions across the whole delivery and operating system remain understandable.
Kafka architecture patterns: a durable log and independent consumers
Kafka organizes records into partitioned topics. Producers write records, and consumers track their progress. A consumer group distributes partition processing among its members, while separate groups can consume the same topic independently. This supports multiple downstream uses without requiring the producer to call each one.
Ordering is scoped to a partition rather than guaranteed globally across a whole topic. A partition key can place related records together when their order matters. The choice also affects load distribution: an extremely active key can concentrate work on one partition.
The Kafka design documentation explains delivery semantics and the scope of transaction-based guarantees. Kafka can support exactly-once processing within specific read-process-write arrangements, but that phrase should not be extended automatically to arbitrary external side effects.
A consumer charging a card through an external provider still needs a safe strategy for retry and deduplication. A broker transaction does not, by itself, make an unrelated API call participate in that same transaction.
EventBridge: routing events to managed targets
EventBridge provides managed event routing with rules and target integrations. It can suit workloads where managed delivery and integration with services are more important than operating a general-purpose streaming log. The fit depends on retention, ordering, replay, throughput, and integration requirements.
Do not treat every EventBridge feature as having identical behavior. Event buses, pipes, and particular target arrangements can have different contracts. Read the documentation for the exact path being deployed and record the retry and failure-handling settings explicitly.
The EventBridge rule retry documentation explains configurable retry behavior and the role of dead-letter queues. A failed delivery eventually reaches a limit. Without a recovery arrangement, a transient infrastructure problem can become a permanently missed business action.
Managed infrastructure reduces some operating work while leaving application correctness with the team. Someone must still own event meaning, invalid payloads, consumer failures, reconciliation, and the decision to replay an event.
Make a database change and an event publication agree
A common failure appears when an application updates its database and then publishes an event. If it crashes between those actions, state changes without notification. Reversing the order can produce an event for a state change that never commits.
A transactional outbox addresses this dual-write problem by storing the state change and an outbox record within one local database transaction. A separate relay publishes outbox records to the messaging system. The exact implementation depends on the database and deployment architecture.
The AWS transactional outbox guidance describes this pattern and its consequences. A relay can publish a record more than once, so consumers still need to handle duplicates. The outbox makes one boundary atomic; it does not create an unlimited distributed transaction.
Monitor the oldest unpublished outbox record and the rate at which the relay falls behind. A healthy application endpoint can coexist with a stalled publishing path. That is a business consistency problem even when every process remains running.
Design idempotent consumers before relying on retries
An operation is idempotent when repeating it has the same intended effect as applying it once. For event processing, the practical aim is to prevent a duplicate delivery from repeating a consequential side effect.
Use a stable event identifier or a domain-specific operation key, then make the deduplication check consistent with the local state update. A check performed separately from the action can race with another worker. The right transaction boundary matters.
For an external payment, use the payment provider’s supported idempotency mechanism where available and persist the relationship between the business operation and that key. After an uncertain timeout, blindly issuing a new payment operation can be dangerous even if the first request appeared to fail locally.
Deduplication history needs a retention policy that matches replay and delivery expectations. If records expire before an old event can be replayed, the system may treat an already completed operation as new. Document what “safe to repeat” means for each consumer.
Event sourcing and CQRS are separate design choices
Event sourcing stores an entity’s changes as a sequence of events from which state can be reconstructed. It is a persistence model. A system can publish events while keeping ordinary current-state tables, so event-driven communication does not require event sourcing.
CQRS separates the model used for commands from the model used for queries. It can support specialized read views, but also introduces synchronization and operational work. Event sourcing and CQRS are frequently combined, while neither implies the other.
Fowler’s event sourcing description and his CQRS discussion are useful starting points for these distinctions. The decision should follow requirements such as auditability, reconstruction, query shape, and the team’s ability to manage evolving event history.
An audit log attached to a mutable table is not automatically a complete event-sourced model. If the recorded events lack information needed to reconstruct state reliably, replay cannot deliver the promise associated with event sourcing.
Eventual consistency needs a user-facing contract
Asynchronous processing creates intervals during which different views disagree. After an order is confirmed, a shipment view may still show no record. The interface should communicate the actual state, such as “preparing,” rather than imply that every downstream action has completed.
Define how long a normal transition should take and what happens when it exceeds that expectation. A stuck workflow needs an owner and a recovery path. “Eventually” is not a useful operating deadline when a customer is waiting for a consequential outcome.
For multi-step business processes, a saga can coordinate local transactions and compensating actions. A compensation is a new business action intended to counter an earlier effect; it is not always an exact technical rollback. A shipped parcel, for instance, cannot be made unshipped by reversing a database flag.
Write the state machine explicitly enough to handle partial success, duplicate events, and late arrivals. This is where many reliability requirements become visible before implementation.
A worked failure: the order that was paid but not fulfilled
Imagine an illustrative shop where payment succeeds and a fulfillment consumer then fails because its inventory reference is missing. The broker retries delivery, but the event is still invalid. Repeating the same processing step does not repair the missing business relationship.
A dead-letter queue preserves the failed event for investigation. The operations view shows the affected order, the failure reason, and whether payment has already completed. An authorized operator can correct the reference and replay the intended fulfillment step without creating a second payment.
The recovery process must distinguish replaying a fact from reissuing every action in the original workflow. Consumers should use stable identifiers and state checks so a recovery operation does not duplicate effects that already succeeded.
After recovery, investigate why confirmation allowed an unusable reference and why the consumer could not identify the problem earlier. The incident may require a contract or validation change, rather than a larger retry limit.
Trace causal relationships across asynchronous boundaries
A request identifier that works only inside one HTTP call is insufficient for a long workflow. Include stable domain identifiers, event identifiers, causation relationships, and relevant trace context. These fields serve different purposes and should not be collapsed into one overloaded identifier.
The article on distributed tracing and OpenTelemetry explains spans, propagation, and links. In an event-driven workflow, tracing should preserve causal evidence without assuming that every consumer operation is a nested synchronous call.
Monitor queue or consumer lag, event age, retry volume, dead-letter growth, and completed business transitions. Broker availability alone does not show that customers are receiving the intended outcome. A consumer can be alive and making no useful progress.
Keep sensitive information out of event metadata unless it is necessary and properly controlled. Events may be retained, copied, replayed, and consumed by more systems than the original producer anticipated.
Design contracts for events that will outlive today’s code
An event can remain in a retained stream after the producer and consumer have both changed. Define what its fields meant when it was emitted. An amount needs a currency and a clear representation; a timestamp needs a defined meaning, such as occurrence time rather than ingestion time. Ambiguity becomes expensive during replay.
Separate syntactic compatibility from semantic compatibility. Adding a field may leave old parsers working, yet changing the interpretation of an existing status can still break business behavior. Review event meaning with the teams that depend on it, rather than treating schema validation as complete contract governance.
State whether a consumer may depend on fields being present, whether unknown values are allowed, and how corrections are represented. If an earlier fact was wrong, silently editing history can undermine consumers that already acted. A correction event with a clear relationship to the original may be more appropriate, depending on the domain.
Ownership also needs an operating path. A consumer team should know whom to contact when a contract is unclear and how a producer announces a consequential change. Independent deployment becomes more credible when these responsibilities are explicit.
Control backpressure before a backlog becomes a second outage
Asynchronous delivery can absorb a burst, but a queue does not create unlimited processing capacity. If arrivals exceed useful completion for long enough, event age grows. The business consequence depends on the workflow: delayed analytics differs from an order reservation that expires.
Decide how consumers respond to downstream throttling. Increasing consumer parallelism can worsen overload if the real constraint is a shared database or external API. Rate limits, bounded concurrency, and retry backoff should reflect the dependency’s capacity.
After an outage, replaying the entire backlog at maximum speed can trigger another failure. Plan recovery rates and prioritize work according to business rules. Monitor whether the age of the oldest relevant event is improving, rather than only whether the consumer process is busy.
These decisions make the architecture’s buffering behavior deliberate. The queue buys time for a mismatch between arrival and service; it does not remove the need to manage that mismatch.
Prefer an event boundary that corresponds to a meaningful domain transition. Publishing every internal database change can expose implementation details and leave consumers guessing which changes matter. A deliberate domain event expresses a fact the producer is prepared to own, while a change-data-capture record serves a different integration purpose. Either can be useful when its contract is understood.
Real-time event processing also needs an explicit timeliness requirement. An event-driven transport does not guarantee that a business action completes before its deadline. Measure event age and end-to-end completion against that requirement, including time spent waiting behind other work.
Test the failure modes that define the architecture
Exercise duplicate delivery, out-of-order arrival, consumer restart, relay interruption, and an external side effect whose response times out. Verify the resulting business state, not only whether the handler returned successfully.
Test schema evolution with old consumers and retained events. Adding an optional field can be easier to accommodate than changing the meaning of an existing one. A syntactically valid event can still violate a consumer’s semantic assumptions.
Document replay permissions and procedures. A replay can create substantial load or trigger external actions, so it deserves the same design attention as normal processing. Practice on controlled data before relying on it during an incident.
Event-driven systems succeed when asynchronous boundaries match real business needs and their consequences remain observable. Kafka and EventBridge can provide valuable infrastructure. Correctness comes from explicit contracts, safe repetition, bounded recovery, and a shared understanding of what each event actually means.