Write Model
ELI5 — The Vibe Check
The write model is the authoritative version of your data that handles all the business rules and commands. It's the master copy in the vault. It might be normalized, it might be event-sourced, but it's always the source of truth.
Real Talk
In CQRS, the write model (or command model) handles all state-changing operations, encapsulating business rules, validations, and invariants. The write model is optimized for transactional consistency rather than query performance, and can use event sourcing or traditional persistence strategies.
When You'll Hear This
"The write model enforces all business rules — the read model just displays the results." / "We event-source the write model and project into multiple read models for different views."
Related Terms
Aggregate
An aggregate is a cluster of domain objects that are treated as one unit for data changes.
CQRS
CQRS says: the way you write data and the way you read data should be separate systems. Writing (commands) goes to one model optimized for transactions.
Event Sourcing
Instead of storing 'balance: $100', event sourcing stores 'deposited $200, withdrew $50, withdrew $50'.
Read Model
A read model is a database view optimized specifically for reading — denormalized, pre-computed, and shaped exactly how the UI needs it.