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

projection-patterns

하는 일

이 도구는 과거 이벤트 정보를 정리해 빠르게 조회할 수 있도록 돕습니다. 데이터의 최적화된 '뷰'를 만듭니다.

사용하는 경우

  • ✓실시간으로 사물의 현재 상태를 보고 싶을 때.
  • ✓이벤트 기록에서 정보를 다시 만들어야 할 때.
  • ✓데이터 조회를 더 빠르고 효율적으로 만드는 경우.

스킬 링크

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

AI에게 요청하는 예시

“거래 이벤트로부터 제 판매 데이터의 최적화된 뷰를 어떻게 만들 수 있을까요?”

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

작동 방식

이벤트들의 순서(행동 기록)를 받아 처리해, 더 단순하고 직접적인 데이터 모델을 만듭니다. 이 모델로 질문에 빠르게 답합니다.

기술 내용 (원본 SKILL.md)

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

Projection Patterns

Comprehensive guide to building projections and read models for event-sourced systems.

When to Use This Skill

  • Building CQRS read models
  • Creating materialized views from events
  • Optimizing query performance
  • Implementing real-time dashboards
  • Building search indexes from events
  • Aggregating data across streams

Core Concepts

1. Projection Architecture

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│ Event Store │────►│ Projector   │────►│ Read Model  │
│             │     │             │     │ (Database)  │
│ ┌─────────┐ │     │ ┌─────────┐ │     │ ┌─────────┐ │
│ │ Events  │ │     │ │ Handler │ │     │ │ Tables  │ │
│ └─────────┘ │     │ │ Logic   │ │     │ │ Views   │ │
│             │     │ └─────────┘ │     │ │ Cache   │ │
└─────────────┘     └─────────────┘     └─────────────┘

2. Projection Types

Type Description Use Case
Live Real-time from subscription Current state queries
Catchup Process historical events Rebuilding read models
Persistent Stores checkpoint Resume after restart
Inline Same transaction as write Strong consistency

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

  • Make projections idempotent - Safe to replay
  • Use transactions - For multi-table updates
  • Store checkpoints - Resume after failures
  • Monitor lag - Alert on projection delays
  • Plan for rebuilds - Design for reconstruction

Don'ts

  • Don't couple projections - Each is independent
  • Don't skip error handling - Log and alert on failures
  • Don't ignore ordering - Events must be processed in order
  • Don't over-normalize - Denormalize for query patterns
자주 묻는 질문

'이벤트'란 무엇인가요?

'사용자가 가입했다'나 '주문이 접수되었다'처럼 과거에 일어난 일의 기록입니다.

'읽기 모델'이란 무엇인가요?

데이터가 처음 기록된 방식과 달리, 질문에 답하기 위해 특별히 만든 데이터 보기 방식입니다.

왜 성능을 최적화하나요?

데이터가 많아도 시스템이 질의에 더 빨리 응답하고 속도 저하를 피할 수 있도록 하기 위해서입니다.

상세 정보

작성자의 원본 설명

Build read models and projections from event streams. Use when implementing CQRS read sides, building materialized views, or optimizing query performance in event-sourced systems.

repo: wshobson/agents

인기도

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

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬