What problem does it solve?
This skill addresses the limitations of traditional CRUD architectures for systems that require immutable audit trails, independent scaling of read and write workloads, and coordination of complex multi-step event-driven workflows. It eliminates the overhead of manually tracking state changes, rebuilding read models, and managing cross-service process failures.
Core Features & Use Cases
- Command/Query Separation: Isolate write operations (commands) from read operations (queries) to optimize each for their specific performance and scaling requirements.
- Event Sourcing: Use an append-only event log as the single source of truth to enable full audit trails, time-travel debugging, and on-demand projection rebuilds.
- Saga Orchestration: Coordinate multi-step workflows across aggregates and services with built-in compensating actions for failure recovery.
- Use Case: For an e-commerce order processing system, use this skill to implement an immutable record of all order state changes, scale product search performance independently of order write throughput, and coordinate inventory reservation, payment processing, and shipping steps with automatic rollbacks on payment failure.
Quick Start
Use the cqrs-event-sourcing skill to design an event-sourced order processing system with separate write and read models, including a saga to coordinate order fulfillment steps and handle payment failures with compensating actions.