본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)41k · #6637

cqrs-implementation

하는 일

이 가이드는 시스템에서 데이터 쓰기 작업과 읽기 작업을 분리하는 방법을 가르칩니다. 특히 많은 정보가 조회되거나 수정될 때, 시스템을 더 빠르고 체계적으로 만드는 데 도움이 됩니다.

사용하는 경우

  • ✓데이터 쓰기와 읽기가 서로 다른 방식으로 작동해야 할 때.
  • ✓쓰기에 영향을 주지 않으면서 시스템의 읽기 부분을 더 빠르게 만들려는 경우.
  • ✓모든 변경을 이벤트로 기록하는 시스템을 만들 때.

스킬 링크

https://github.com/wshobson/agents/blob/main/plugins/backend-development/skills/cqrs-implementation/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/wshobson/agents/blob/main/plugins/backend-development/skills/cqrs-implementation/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“CQRS를 사용해 복잡한 보고서의 속도를 최적화하려면 어떻게 하면 좋을까요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

작업을 두 부분, 즉 명령(데이터 변경)과 질의(데이터 읽기)로 나눕니다. 각 부분은 서로 다른 데이터 모델을 사용해 따로 최적화할 수 있으며, 성능에 집중합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

CQRS Implementation

Comprehensive guide to implementing CQRS (Command Query Responsibility Segregation) patterns.

When to Use This Skill

  • Separating read and write concerns
  • Scaling reads independently from writes
  • Building event-sourced systems
  • Optimizing complex query scenarios
  • Different read/write data models needed
  • High-performance reporting requirements

Core Concepts

1. CQRS Architecture

                    ┌─────────────┐
                    │   Client    │
                    └──────┬──────┘
                           │
              ┌────────────┴────────────┐
              │                         │
              ▼                         ▼
       ┌─────────────┐          ┌─────────────┐
       │  Commands   │          │   Queries   │
       │    API      │          │    API      │
       └──────┬──────┘          └──────┬──────┘
              │                         │
              ▼                         ▼
       ┌─────────────┐          ┌─────────────┐
       │  Command    │          │   Query     │
       │  Handlers   │          │  Handlers   │
       └──────┬──────┘          └──────┬──────┘
              │                         │
              ▼                         ▼
       ┌─────────────┐          ┌─────────────┐
       │   Write     │─────────►│    Read     │
       │   Model     │  Events  │   Model     │
       └─────────────┘          └─────────────┘

2. Key Components

Component Responsibility
Command Intent to change state
Command Handler Validates and executes commands
Event Record of state change
Query Request for data
Query Handler Retrieves data from read model
Projector Updates read model from events

Templates and detailed worked examples

Full template library and detailed worked examples live in references/details.md. Read that file when you need the concrete templates.

Best Practices

Do's

  • Separate command and query models - Different needs
  • Use eventual consistency - Accept propagation delay
  • Validate in command handlers - Before state change
  • Denormalize read models - Optimize for queries
  • Version your events - For schema evolution

Don'ts

  • Don't query in commands - Use only for writes
  • Don't couple read/write schemas - Independent evolution
  • Don't over-engineer - Start simple
  • Don't ignore consistency SLAs - Define acceptable lag
자주 묻는 질문

'최종 일관성(eventual consistency)'이란 무엇인가요?

데이터가 시스템의 모든 부분에 업데이트되기까지 잠시 걸릴 수 있지만, 결국에는 올바르게 된다는 뜻입니다.

읽기 모델과 쓰기 모델을 왜 나누나요?

요구 사항이 다르기 때문입니다. 쓰기 모델은 데이터 무결성을 보장해야 하고, 읽기 모델은 질문에 빠르게 답해야 합니다.

간단한 구현으로 시작할 수 있나요?

네. 간단하게 시작하고, 정말 필요할 때만 복잡성을 더하는 것을 권장합니다.

상세 정보

작성자의 원본 설명

Implement Command Query Responsibility Segregation for scalable architectures. Use when separating read and write models, optimizing query performance, or building event-sourced systems.

repo: wshobson/agents

인기도

GitHub 스타
41k
순위
#6637
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬