read-model-design

Design denormalized Read Models for CQRS architectures by projecting Domain Events into API response shapes.

1|Updated Jun 20, 2026
One-click install
npx skills add https://github.com/shafibabar/SDLC-Artifact-Factory --skill read-model-design
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: read-model-design
Source: https://github.com/shafibabar/SDLC-Artifact-Factory/tree/main/skills/read-model-design
Command: npx skills add https://github.com/shafibabar/SDLC-Artifact-Factory --skill read-model-design

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill solves the challenge of coupling query requirements to domain models by providing a structured approach to designing denormalized, query-optimized Read Models that remain decoupled from write-side Aggregate logic.

Core Features & Use Cases

  • Denormalization Strategy: Learn how to flatten nested structures and embed display data to eliminate read-time JOINs.
  • Eventual Consistency Management: Implement version-header polling and AsOf timestamps to handle projection lag without sacrificing user experience.
  • Use Case: When building a high-performance dashboard that requires data from multiple Aggregates, use this Skill to design a single, pre-computed Read Model that serves the exact API response shape needed.

Quick Start

Use the read-model-design skill to generate a design document for a new DataAssetView read model based on the provided domain events.

Frequently Asked Questions about read-model-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is a read model in CQRS and when do I need denormalization?

A read model in CQRS is a denormalized, query-optimized data structure that decouples query requirements from domain models. You need denormalization when building high-performance APIs that require flattening nested structures and embedding display data to eliminate read-time JOINs.

How do I design a read model that handles eventual consistency in event-sourced systems?

Design read models for eventual consistency by implementing version-header polling and AsOf timestamps to manage projection lag. This approach handles delays in projecting domain events without sacrificing the user experience of your query-optimized API responses.

How to project domain events into specific API response shapes for CQRS?

Project domain events into specific API response shapes by designing denormalized read models that match your exact API requirements. This involves flattening nested structures and embedding display data from multiple aggregates into a single pre-computed view.

How do I ensure idempotent projection when building read models from domain events?

Ensure idempotent projection by designing read models that safely handle replaying domain events. This Skill provides structured approaches for idempotent projections, allowing your denormalized views to process duplicate events without creating inconsistent query data.

What is the best way to rebuild read models atomically without query downtime?

Rebuild read models atomically using shadow tables to construct new projections while the current view remains active. This approach allows safe atomic rebuild procedures, ensuring continuous query availability while updating denormalized data structures.

Can I use this read model design approach for backend systems without event sourcing?

Yes, this approach applies to backend engineering and domain modeling tasks where query performance and domain decoupling are critical. While designed for CQRS architectures projecting domain events, the denormalization strategies benefit any system needing query-optimized API response shapes.