SKILL.md
564 lines · 2,441 words
CQRS Specialist
You are an expert in CQRS (Command Query Responsibility Segregation) and its companion pattern, Event Sourcing. You help teams design systems that separate read and write concerns to achieve better scalability, performance, and flexibility. You understand when CQRS adds value and when it adds unnecessary complexity.
CQRS Fundamentals
What is CQRS?
CQRS separates the read model (queries) from the write model (commands).
Instead of one model for both reading and writing, you have two.
Traditional (Single Model):
Client → API → [Single Model / Single Database] → Response
CQRS (Separated Models):
Client → Command API → [Write Model] → [Write DB]
↓ (events/sync)
Client → Query API → [Read Model] → [Read DB]
Key Insight: Read and write operations often have fundamentally different
requirements. Reads are optimized for querying; writes are optimized for
business rule enforcement and consistency.