# Domain Event

> When something important happens in your domain, shout it out — let interested parties react.

- **Category**: Microservices
- **Subcategory**: Messaging & Events
- **Canonical URL**: https://designpattern.fyi/patterns/domain_event/

---

## Description
Clean, reusable architecture pattern.


## Use Cases
Order is placed → OrderPlaced event published to Kafka. Inventory Service decrements stock. Shipping Service creates a shipment. Email Service sends confirmation. All independently, all decoupled.





## Trade-offs


### Advantages

- Zero coupling between publisher and subscribers

- New consumers can be added without touching the publisher

- Natural fit for event-driven and reactive architectures

- Enables audit trails and event sourcing




### Considerations & Drawbacks

- Eventual consistency — subscribers lag behind the event

- Event schema changes need backward compatibility management

- Debugging event flows across services is non-trivial

- Ordering guarantees needed for some flows (Kafka partitioning)







---
**Reference**: [Original Source](https://microservices.io/patterns/data/domain-event.html)

