Catalog My learning Blog
Event-Driven Architecture Course: Event Sourcing and CQRS · Phase 3 · Lesson 17 · 8 min read

CQRS Without Event Sourcing

On this page
  1. Learning Objective
  2. Concept Explanation
  3. Worked Example: CQRS Over a Conventional Relational Write Model
  4. Real-World Examples
  5. Review Questions & Answers

Learning Objective

Apply CQRS independently of event sourcing, recognize the hybrid combinations that appear most often in production systems, and select the combination that matches a specific problem rather than adopting a full stack of patterns as a bundle.

Concept Explanation

The four patterns this course covers, event-driven integration, event sourcing, CQRS, and the outbox and saga mechanics of the final phase, are independent choices that are almost always presented together. In practice they combine in several stable configurations, and knowing which configuration you are in is more useful than knowing all four in the abstract. The most common production configuration by a wide margin is CQRS without event sourcing.

That configuration looks like this: the write side is an ordinary normalized relational database with transactions and constraints, exactly as it would be without any of these patterns. Changes to it produce events, either through an outbox or through change data capture, and those events maintain denormalized read models elsewhere. The system gets separate read and write models, independently scalable reads, freedom in read store technology, and asynchronous view maintenance, without acquiring event-store tooling, rehydration performance concerns, upcaster chains, or the difficulty of ad hoc querying that event sourcing brings. For most teams this is the sweet spot, and it is what a great many systems described as event-driven actually are.

The reverse configuration, event sourcing without CQRS, is rarer but coherent. The write side keeps an event log for audit, temporal query, and replay, and reads are served by folding streams directly or by a snapshot cache, with no separate read model at all. It works when read volume is low and queries are naturally by aggregate id, which describes a surprising number of internal and regulated systems. It stops working the moment somebody needs to query across aggregates, which is why the two patterns are so often found together: event sourcing makes cross-aggregate querying hard, and CQRS is the standard remedy.

A third configuration worth naming explicitly is partial adoption, and it is what mature systems tend to converge on. A single application will often have one bounded context that is event-sourced because its history is regulated or valuable, several contexts using CQRS with a conventional write database because their read workloads are heavy or oddly shaped, and a majority of contexts that are plain create-read-update-delete because nothing about them justifies anything else. The architecture is not uniform, and uniformity would be a mistake, since it would mean either paying event-sourcing costs in the user preferences module or forgoing an audit trail in the ledger.

The selection rule that makes this tractable is to decide each pattern independently against a specific question. Do read and write workloads have genuinely different shapes, volumes, or scaling needs? That question alone decides CQRS. Is the history of changes valuable as data, required by regulation, or needed to explain past decisions? That question alone decides event sourcing. Do other services need to react to changes here without being called? That decides event-driven integration. Does a workflow span multiple services or aggregates that cannot be updated atomically? That decides sagas. Four questions, four independent answers, and the resulting architecture is whatever combination those answers produce rather than a package chosen up front.

ConfigurationWrite sideRead sideBest suited to
Neither patternNormalized database, direct readsThe same tablesMost systems; the correct default
CQRS without event sourcingNormalized database with transactionsDenormalized models fed by outbox or change data captureHeavy or oddly shaped read workloads; the most common production choice
Event sourcing without CQRSEvent log with snapshotsFolded from streams by aggregate idLow read volume, regulated history, key-based access only
Both togetherEvent log as the source of truthProjections rebuilt from the logRegulated domains with heavy and varied read needs
Partial adoption across contextsDifferent per contextDifferent per contextMature systems; the realistic end state

Worked Example: CQRS Over a Conventional Relational Write Model

No event store, no rehydration, no upcasters. The write side is an ordinary transactional database and the read models are maintained from events emitted through an outbox, which is the configuration most production CQRS systems actually run.

JavaScript
-- WRITE SIDE: completely conventional. Constraints, foreign keys, and a
-- transaction do the work. Nothing here would look unusual in any codebase.
CREATE TABLE orders (
  id            TEXT PRIMARY KEY,
  customer_id   TEXT NOT NULL REFERENCES customers(id),
  status        TEXT NOT NULL CHECK (status IN ('draft','placed','paid','shipped','cancelled')),
  total_cents   BIGINT NOT NULL CHECK (total_cents >= 0),
  version       INT    NOT NULL DEFAULT 0,
  placed_at     TIMESTAMPTZ
);

async function placeOrder(cmd) {
  return db.transaction(async (tx) => {
    const order = await tx.one(
      `UPDATE orders SET status = 'placed', placed_at = now(), version = version + 1
        WHERE id = $1 AND status = 'draft' AND version = $2
      RETURNING *`,
      [cmd.orderId, cmd.expectedVersion],
    );
    if (!order) throw new ConcurrencyError(cmd.orderId, cmd.expectedVersion);

    // The event is a notification of a change, NOT the source of truth.
    // The orders row is still authoritative. Same transaction, so it cannot
    // be lost if the process dies a moment later.
    await tx.query(
      `INSERT INTO outbox (event_type, aggregate_id, payload) VALUES ($1, $2, $3)`,
      ['OrderPlaced', order.id, { orderId: order.id, customerId: order.customer_id,
                                  totalCents: order.total_cents }],
    );
    return order;
  });
}

-- READ SIDE: maintained by a projection consuming the relayed outbox events.
CREATE TABLE rm_customer_orders (
  customer_id  TEXT NOT NULL,
  order_id     TEXT NOT NULL,
  customer_name TEXT NOT NULL,
  status       TEXT NOT NULL,
  total_cents  BIGINT NOT NULL,
  placed_at    TIMESTAMPTZ NOT NULL,
  PRIMARY KEY (customer_id, placed_at DESC, order_id)
);

-- What was NOT acquired here: an event store, rehydration cost, snapshots,
-- upcaster chains, or the loss of ad hoc SQL against the authoritative data.
-- What WAS acquired: separate read models, an independent read store choice,
-- and reads that scale without touching the write database.
A matrix of the four patterns, event-driven integration, event sourcing, CQRS, and sagas, shown as independent axes rather than a bundle, with the common production configurations marked and CQRS without event sourcing highlighted as the most frequent.
A matrix of the four patterns, event-driven integration, event sourcing, CQRS, and sagas, shown as independent axes rather than a bundle, with the common production configurations marked and CQRS without event sourcing highlighted as the most frequent.

Real-World Examples

  • Debezium, an open-source change data capture platform built on Kafka Connect and widely deployed since 2016, exists largely to serve the CQRS-without-event-sourcing configuration: it streams changes out of a conventional PostgreSQL, MySQL, or MongoDB database into Kafka so that downstream read models and search indexes stay current, without the source application being modified at all. Its adoption is direct evidence of how common it is to want derived read models over an ordinary transactional write side.
  • The near-universal pattern of keeping authoritative data in a relational database while serving search from Elasticsearch is CQRS without event sourcing, practiced by a large fraction of the industry under a different name. The write model enforces constraints in PostgreSQL or MySQL, an indexing pipeline maintains a denormalized search document, and the resulting eventual consistency is accepted and usually labeled in the interface. Almost none of those teams describe themselves as doing CQRS, which is a fair indication that the pattern is more common than the terminology.
Key TakeawaysDecide each pattern separately against its own question. Different read and write workloads argue for CQRS; valuable or regulated history argues for event sourcing; other services needing to react argues for event-driven integration; cross-service workflows argue for sagas. Adopting all four because they appear together in diagrams is how teams end up paying for capabilities they never needed.

Review Questions & Answers

Because it captures the benefit most systems actually need while avoiding the cost most systems cannot justify. The benefit teams want is separately scalable, differently shaped read models in stores suited to their queries, and that requires only a reliable way to emit changes, which an outbox or change data capture provides over any ordinary database. The event-sourcing costs, rehydration performance, snapshots, upcasters, projection-only querying, and the loss of ad hoc SQL against the authoritative data, buy audit history and replay, which is genuinely valuable in some domains and worth nothing in most. Taking one without the other is a deliberate match of cost to benefit.

A query that spans aggregates. Folding streams works well when every read is by aggregate id, since the stream is exactly the right unit. The moment someone needs all orders placed last week over a certain value, or a dashboard grouping by region, or a search across customer names, there is no way to answer it from the event store without scanning the entire history and folding every stream. At that point a projection is the only reasonable answer, and adding a projection is adding the read side of CQRS, which is why the two patterns are so frequently found together.

Because the contexts have different requirements and the patterns have real costs. Applying event sourcing everywhere means paying versioning, projection, and onboarding costs in the modules where history is worthless, such as user preferences or content pages. Applying nothing anywhere means the ledger has no audit trail and the search-heavy context is joining six tables on every request. Uniformity optimizes for architectural tidiness, which nobody experiences, at the expense of fit, which everybody does. A mature system with a regulated event-sourced core, several CQRS contexts, and a majority of plain create-read-update-delete modules is not inconsistent; it is correctly calibrated.

Because it determines what happens when the event and the table disagree, and what a rebuild means. With the table authoritative, the events are notifications used to maintain derived views, so a lost or duplicated event degrades a read model that can be rebuilt from the table, and the truth is never in doubt. Under event sourcing the log is the truth and the table would not exist, so a lost event is actual data loss. The practical consequences follow directly: the example system can be reconciled against its own write tables at any time, can be queried ad hoc with ordinary SQL, and has no need for upcasters, precisely because the events are secondary.