CQRS with event sourcing
c4v1/01 Views
/02 About
Separate write and read paths: commands append events to an event store; projections build read models for queries.
Command Query Responsibility Segregation splits the model that changes state from the models that answer questions. With event sourcing, the write side stores every change as an event, and read models are projections of that history. When to use: domains with complex rules and very different read and write loads, a need for a complete audit history, or several read shapes of the same data. Trade-offs: a full history, fast tailored reads and independent scaling, at the cost of eventual consistency between writes and reads, more components, and careful handling of event versioning and replays. Overkill for simple CRUD.
Published by Lattix · 9 elements · 9 relationships · validated on publish
/03 Contents
- Business Actor
- Client
- API
- Command API, Query API
- Application Component
- Command handler, Projector, Query service
- Data Store
- Event store, Read model
- System Software
- Event bus