What problem does it solve?
This Skill tackles the limitations of state-based persistence in complex domains by enabling event sourcing, providing a complete audit trail, temporal queries, and seamless integration with CQRS for better domain modeling and debugging.
Core Features & Use Cases
- Domain-Pure Aggregates: Maintains unchanged aggregate logic while replaying events via infrastructure state rebuilders for reconstitution without polluting the domain.
- Custom SQL Event Store: Implements an append-only store with optimistic concurrency, snapshots, and primitive payloads for SQL Server or PostgreSQL.
- Projections and Read Models: Builds read-optimized views through inline or async event handlers, feeding the existing Read stack.
- Use Case: In a game domain like managing 'Partie' aggregates, convert from EF Core persistence to event sourcing to track all state changes as immutable events, enabling conflict resolution in collaborative scenarios.
Quick Start
Scaffold event sourcing for the Partie bounded context by implementing the state rebuilder and repository as described in the references.