Skip to content

read-model

Query-optimized projection of Events. See Concepts: Read Model.

Fields

Field Required Description
apiVersion yes schema.esdm.io/core/v1
kind yes read-model
name yes The Read Model name.
scope yes scope.boundedContext reference.
paradigm no Optional hint naming the paradigm used to describe schema (tabular, document, graph, search-index, time-series, vector, ...). Non-binding for the linter.
schema yes JSON Schema describing the entire materialized Read Model. For tabular/document paradigms this is commonly a collection shape (type: array with items, or a keyed map).
projections yes Non-empty list of { event, rule } entries describing how each consumed Event updates the Read Model.
description no Free-form prose.
metadata no Non-semantic labels and annotations.

projections[]

Each projection references an Event and carries a prose rule describing how the Event updates the Read Model.

Field Required Description
event yes Event reference (Aggregate-bound or BC-scoped, mirroring consults).
rule yes Prose description of the projection step.

Example

apiVersion: schema.esdm.io/core/v1
kind: read-model
name: rounds
scope:
  domain: golf-club-management
  boundedContext: round-play
paradigm: tabular
schema:
  type: object
  properties:
    roundId: { type: string }
    playerId: { type: string }
    status: { type: string }
  required: [roundId, playerId, status]
projections:
  - event:
      boundedContext: round-play
      aggregate: round
      event: round-started
    rule: Insert a new row keyed by `roundId` with `status: in-progress`.