Home

readmodels

Read models are representations of application data optimized for read operations. In architecture terms, they are the query side in a Command Query Responsibility Segregation (CQRS) pattern, separating the models used to modify data from those used to read it. Read models are typically projections built from domain events or from the write model, and they provide query-optimized structures rather than fully normalized domain entities.

Construction and maintenance: Read models are usually created by projections or materialized views that subscribe to

Design characteristics: Read models are often denormalized and tailored for specific query patterns. They may contain

Advantages and trade-offs: Read models reduce query latency and simplify complex reads, but they add complexity,

Alternatives: A single model serving both reads and writes, or caches and materialized views within a monolithic

changes
on
the
write
side.
Each
update
to
the
write
model
produces
one
or
more
read-model
updates.
They
may
be
stored
in
a
variety
of
data
stores,
including
relational
databases,
document
stores,
key-value
stores,
or
search
indexes,
chosen
to
suit
the
queries
they
must
support.
Updates
can
be
synchronous
to
achieve
strong
consistency
or
asynchronous
to
improve
throughput
and
scalability;
most
implementations
use
eventual
consistency.
computed
fields,
aggregated
totals,
or
pre-joined
data
to
avoid
expensive
joins
at
query
time.
They
usually
carry
versioning
or
timestamps
to
help
detect
out-of-date
data,
and
update
logic
is
designed
to
be
idempotent.
require
synchronization
between
write
and
read
sides,
and
increase
data
duplication.
Monitoring,
testing,
and
schema
evolution
are
essential.
system,
can
be
used
when
CQRS
overhead
is
undesirable.