HeadlinesBriefing favicon HeadlinesBriefing.com

Event Driven vs Message Driven Design Explained

DEV Community •
×

Software architects distinguish between Event Driven Design (EDD) and Message Driven Design (MDD). EDD systems react to immutable past events, where producers publish facts without knowing who consumes them. This achieves high decoupling, as services like Order, Inventory, and Email operate independently. A key misconception is expecting replies; events are one-way notifications, not conversations.

Conversely, MDD sends intent-based messages like `ProcessPayment` to request specific work from another system. The sender expects processing to occur, with optional responses. This contrasts with EDD's reactive nature. Modern architectures often combine both, using commands to initiate work and events to announce results, creating robust, decoupled systems.

Choosing between them depends on the task. Use EDD to announce what happened and MDD to request what should happen. For instance, a Checkout Service sends a `ProcessPayment` message and later publishes a `PaymentCompleted` event. This hybrid approach is standard in microservices, balancing instruction with decoupled reaction.