1 minute read · architecture
CQRS separates reads from writes. Event Sourcing stores state as a sequence of events.
CQRS in Practice
// Write side
class PlaceOrderCommand { constructor(public orderId: string) {} }
// Read side — optimised query model
const orders = await readDb.query('SELECT * FROM order_summary WHERE userId=$1', [id]);Event Sourcing
const events = await eventStore.load(orderId);
const order = events.reduce(applyEvent, initialState);When to Use
Only on complex domains where audit trail or temporal queries are required.
Conclusion
Powerful but complex. Prefer simple CRUD until you genuinely need this.