Problem Statement
Differentiate event-driven architecture (EDA) from event sourcing. When would you choose each?
Explanation
EDA means services react to events to decouple producers and consumers. The database of record can still be state-based; events are integration messages and may be disposable after processing. It shines when multiple downstream actions or workflows must react to the same change with loose coupling.
Event sourcing persists the append-only sequence of domain events as the system of record, and current state is derived by replay. Choose it when auditability, temporal queries, and reconstructing past state are central, and when the domain naturally fits an event log.
Code Solution
SolutionRead Only
EDA: order.created → email, billing ES: store domain events; Read models build via projection
Practice Sets
This question appears in the following practice sets:
