Single Model vs CQRS: One Data Model vs Split Read/Write Models

Overview A single model uses one unified set of classes and one schema for both reading and writing data, while CQRS (Command Query Responsibility Segregation) splits the system into separate write models (commands) and read models (queries) that can use different schemas, storage, or even databases. The choice matters because it trades simplicity and consistency for scalability and query flexibility as read and write demands diverge. Comparison Diagram Single ModelCQRSRead ReqWrite ReqModelreads + writesOne DB / SchemaQueryCommandRead Modeloptimized viewWrite Modeldomain logicRead StoreWrite Storesync / events Comparison Table Aspect Single Model CQRS Request entry point One API/service handles reads and writes through the same code path Requests are split upfront into command handlers and query handlers Data model shape One set of classes/entities represents the domain for every operation Separate write model (rich domain logic) and read model (denormalized, query-optimized) Write path Write validates and persists directly to the shared schema Command handler validates, applies business rules, persists to the write store Read path Read queries the same schema writes use, often requiring joins Query handler reads from a precomputed, often denormalized read store Sync between models Not applicable — there is only one model, so no sync is needed Read store is updated via events or projections after each write, introducing lag Consistency guarantee Strong consistency by default since reads see writes immediately Eventual consistency between write and read sides unless engineered otherwise Scaling behavior Read and write load scale together since they share infrastructure Read and write sides scale independently to match different load profiles Operational complexity Low — one schema, one deployment, one mental model to maintain Higher — multiple stores, projection/event pipelines, and eventual-consistency debugging Key Differences Single model keeps one schema for everything; CQRS splits into a write model and a read model CQRS trades immediate consistency for eventual consistency via projections or events Single model is simpler to reason about; CQRS adds operational overhead from syncing multiple stores CQRS enables independent scaling of reads and writes; single model scales them together Query flexibility is higher in CQRS since read models can be shaped per use case When to Use Each Single Model ...

September 6, 2026 · 3 min · 478 words · jeonck

Event Sourcing vs State-Based Persistence: Storing Changes vs Storing Current State

Overview Event sourcing persists every change to an entity as an immutable, ordered event log, deriving current state by replaying that history. State-based persistence instead stores and overwrites a single current record, discarding prior values on each update. The choice affects auditability, storage growth, and how much replay/projection machinery you need to build. Comparison Diagram Event SourcingAccountOpenedDeposited $100Withdrew $30Deposited $50replayBalance: $120Full history preservedState-Based PersistenceBalance: $0Balance: $100Balance: $70overwriteBalance: $120Only latest state kept Comparison Table Aspect Event Sourcing State-Based Persistence Write operation Appends a new immutable event to the log; nothing is ever modified in place Updates or overwrites the existing row/record with new values Data representation Sequence of domain events describing what happened Single current snapshot of the entity’s fields Reading current state Replay events from the start (or from a snapshot) to derive current state Direct read of the stored row, no reconstruction needed Concurrency conflicts Detected by checking the expected event stream version before appending Detected via optimistic locking (row version/timestamp) or DB-level locks Historical/audit trail Native and complete — every past state is reconstructable Not retained by default; requires a separate audit log or triggers Schema evolution Old event versions must be upcast or handled explicitly by consumers Existing rows are migrated or altered directly to the new shape Storage growth Grows unbounded with every change; needs snapshotting/compaction to stay fast Stays roughly proportional to the number of entities, not their history Query complexity Ad-hoc queries need dedicated projections/read models built from the events Supports direct ad-hoc SQL queries against the current data Key Differences Event sourcing stores an append-only event log; state-based persistence stores only the current row Rebuilding state requires replay in event sourcing, versus a simple read in state-based systems Event sourcing gives a native audit trail; state-based needs bolt-on logging to recover history Concurrency is resolved via event versioning instead of row-level locking Storage grows unbounded without snapshots in event sourcing, while state-based storage stays compact When to Use Each Event Sourcing ...

August 4, 2026 · 3 min · 437 words · jeonck

CQRS vs CRUD: Splitting Reads and Writes vs One Unified Model

Overview CRUD (Create, Read, Update, Delete) models an application around a single data model that handles both reads and writes through uniform operations. CQRS (Command Query Responsibility Segregation) instead splits reads and writes into separate paths, often with different models and stores optimized for each. The choice matters most as a system’s read/write patterns diverge or its business logic grows too complex for a single model to represent cleanly. Comparison Diagram CRUDCQRSClientModel / APIDatabaseone path, one modelClientCommandQueryWrite ModelRead ModelWrite DBRead DBsync via eventssplit paths, split models Comparison Table Aspect CRUD CQRS Request handling Single endpoint set (GET/POST/PUT/DELETE) hits one code path for both reads and writes Requests split into distinct Command (write) and Query (read) channels with separate handlers Data model One model represents the entity for both reading and writing Separate write model (domain/aggregate) and read model (denormalized view) per side Storage Single database or table serves both reads and writes Optional separate stores per side, e.g. relational for writes, cache or search index for reads Consistency Strongly consistent by default since reads hit the same store just written to Read side is often eventually consistent, synced from the write side via events Business logic placement Validation and rules scattered across create/update handlers Rules concentrated in command handlers that enforce invariants before state changes Scaling Read and write load scale together since they share the same path Read and write sides can be scaled and optimized independently Implementation overhead Minimal; straightforward to build, test, and reason about Higher; requires sync mechanism and handling of eventual consistency Key Differences CRUD uses a unified model for reads and writes; CQRS separates commands and queries into distinct paths CRUD read-after-write is immediate since storage is shared; CQRS’s read side is often eventually consistent CRUD business logic lives in generic handlers; CQRS pushes rules into explicit command handlers CQRS allows independent scaling of reads and writes; CRUD scales both together CRUD is simpler to build; CQRS trades that simplicity for flexibility at the cost of architectural complexity When to Use Each CRUD ...

August 4, 2026 · 3 min · 473 words · jeonck