nw-ddd-eventsourcing

Solid

Event Sourcing and CQRS as DDD implementation patterns — when to use, aggregate event streams, projections, snapshots, sagas, upcasting, conflict resolution

DevOps & Infrastructure 526 stars 55 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 92/100

Stars 20%
91
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Event Sourcing and CQRS Implementation patterns for DDD. Event Sourcing stores every state change as an immutable event and derives current state from replay. CQRS separates write and read models. These are tools, not mandatory architecture -- apply selectively to domains where they add value. ## When to Use Event Sourcing **ES adds value when**: - Complete audit trail required (financial, regulatory, medical) - Temporal queries needed ("what was the state on January 15?") - Multiple views of same data (different read models for different consumers) - Complex domain with rich business rules (natural fit with DDD aggregates) - Event-driven integration with other systems - Debugging requires replay ("what exactly happened?") **ES is overkill when**: - Simple CRUD with no audit requirements - Team unfamiliar and project has no learning budget - No business value from history - Domain has no behavior (data in, data out) **Key question**: "Does knowing the history of how we got here provide business value?" Yes -> consider ES. No -> traditional CRUD is simpler. ## Core Concepts ### Events as Facts Events are immutable records of things that happened. Past tense: `OrderPlaced`, `PaymentReceived`, `ItemShipped`. **Event structure**: Include all data needed to understand what happened (self-contained) | Use domain language | One event per meaningful business fact | Events carry data only, no behavior **Granularity**: Too coarse (`OrderUpdated { order: {...} }`) loses what...

Details

Author
nWave-ai
Repository
nWave-ai/nWave
Created
3 months ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

cqrs-event-sourcing

CQRS and Event Sourcing patterns for scalable, auditable systems with separated read/write models. Use when building audit-required systems, implementing temporal queries, or designing high-scale applications with complex domain logic.

15 Updated 2 days ago
NickCrew
Code & Development Listed

principle-event-driven

Event-driven architecture — event sourcing, CQRS, sagas, choreography vs orchestration, schema evolution, consumer groups, partitions, ordering, idempotent handlers, outbox pattern, dead letter queues. Auto-load when designing event-driven systems, evaluating event sourcing or CQRS, planning saga workflows, evolving event schemas across consumers, configuring consumer groups or partitions, implementing idempotent consumers or the outbox pattern, managing dead letter queues, or assessing whether event-driven architecture fits the problem.

2 Updated today
lugassawan
AI & Automation Solid

architecture-paradigm-cqrs-es

Applies CQRS and Event Sourcing for read/write separation and audit trails. Use when designing systems with complex domain logic or full state-change history.

297 Updated today
athola
AI & Automation Solid

nw-sd-patterns-advanced

Advanced distributed patterns - event sourcing, CQRS, saga, stream processing, append-only log, exactly-once delivery, sequencer, double-entry ledger, erasure coding, order book, watermarks

526 Updated 1 weeks ago
nWave-ai
DevOps & Infrastructure Listed

event-sourcing-architect

Expert in event sourcing, CQRS, and event-driven architecture patterns. Masters event store design, projection building, saga orchestration, and eventual consistency patterns. Use PROACTIVELY for event-sourced systems, audit trails, or temporal queries.

335 Updated today
aiskillstore