Home / Market / architecture-paradigm-cqrs-es

architecture-paradigm-cqrs-es

CQRS and Event Sourcing

skill★ 00 dlclawhubMIT-0Install in CosmosUpstream Source

Documentation & Preview

--- name: architecture-paradigm-cqrs-es description: CQRS and Event Sourcing version: 1.10.3 triggers:

metadata: {"openclaw": {"homepage": "https://github.com/athola/claude-night-market/tree/master/plugins/archetypes", "emoji": "\ud83c\udfd7\ufe0f"}} source: claude-night-market source_plugin: archetypes

---

> Night Market Skill: ported from claude-night-market/archetypes. For the full experience with agents, hooks, and commands, install the Claude Code plugin.

The CQRS and Event Sourcing Paradigm

When To Use

When NOT To Use

When to Employ This Paradigm

Adoption Steps

  1. Identify Aggregates: Following Domain-Driven Design principles, specify the bounded contexts and the business invariants that each command must enforce on an aggregate.
  2. Model Commands and Events: Define the schemas and validation rules for all commands and the events they produce. Document a clear strategy for versioning and schema evolution.
  3. Implement the Write Side (Command Side): Command handlers are responsible for loading an aggregate's event stream, executing business logic, and atomically appending new events to the stream.
  4. Build Projections to the Read Side: Create separate read models (projections) that are fed by subscriptions to the event stream. Implement back-pressure and retry policies for these subscriptions.
  5. validate Full Observability: Implement detailed logging that includes event IDs, sequence numbers, and metrics for tracking the lag time of each projection.

Key Deliverables

Risks & Mitigations

Concrete Components

Vocabulary for the tools and abstractions an implementation of this paradigm tends to carry. Not dependencies, and not `tools:` frontmatter.

Exit Criteria

strategy, and the eventual-consistency SLA for each read model.

is wired.

prevents emission of event versions not registered in that policy.

before the write-side is declared production-ready.