5 exercises on CQRS and event sourcing vocabulary.
0 / 5 completed
1 / 5
What does CQRS stand for, and what is its core idea?
CQRS: Command Query Responsibility Segregation separates the write side (commands that change state) from the read side (queries that return data). Each side can be independently scaled, optimized, and deployed.
2 / 5
In event sourcing, what is stored as the primary source of truth?
Event sourcing: instead of storing the current state, the system stores every event that changed state (e.g., OrderPlaced, ItemAdded, OrderShipped). Current state is rebuilt by replaying events from the log.
3 / 5
What is a projection in event sourcing?
Projection: subscribes to the event stream and maintains a denormalized read model tailored for specific queries. Multiple projections can serve different read concerns (e.g., order summary, shipping status) from the same events.
4 / 5
What is a snapshot in the context of event sourcing?
Snapshot: as the event log grows, replaying thousands of events to hydrate an aggregate becomes slow. Saving a snapshot of the state at a point in time lets the system load the snapshot and replay only subsequent events.
5 / 5
What is eventual consistency in a CQRS system?
Eventual consistency: after a command updates the write model and publishes an event, projections (read models) update asynchronously. There is a brief window where reads return stale data. The system converges to consistency once events are processed.