nw-sd-patterns-advanced

Solid

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

AI & Automation 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

# Advanced Distributed Patterns ## Event Sourcing **Problem**: need audit trail, state reconstruction, temporal queries. **Core idea**: store every state change as immutable event, not current state. ``` Events: [WalletCreated: balance=0] [Deposited: +100] [Transferred: -30] [Deposited: +50] Current state: 0 + 100 - 30 + 50 = 120 ``` **Benefits**: complete audit trail | temporal queries ("balance on Jan 15?") | rebuild state from scratch | debug by replay | event-driven architecture **Challenges**: computing state requires replaying all events -- use snapshots | schema evolution (events immutable) | store grows indefinitely -- compaction/archiving | eventual consistency for read models **Snapshots**: periodically save computed state | current state = latest snapshot + events after it | trade-off: recovery speed vs storage **Used in**: payment systems, banking, trading platforms, audit-critical systems ## CQRS (Command Query Responsibility Segregation) **Problem**: read and write models have different optimization needs. **Architecture**: Commands -> Write Model (normalized, consistency) -> events/CDC -> Read Model (denormalized, query-optimized) <- Queries **When**: very different read/write patterns | read model needs heavy denormalization | different scaling for reads vs writes | paired with Event Sourcing **Trade-offs**: eventual consistency between models | increased complexity (two models) | sync lag ## Saga Pattern **Problem**: distributed transactions ac...

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
DevOps & Infrastructure Solid

nw-ddd-eventsourcing

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

526 Updated 1 weeks ago
nWave-ai
AI & Automation Solid

nw-sd-patterns

Core distributed systems patterns - load balancing, caching, sharding, consistent hashing, message queues, rate limiting, CDN, Bloom filters, ID generation, replication, conflict resolution, CAP theorem

526 Updated 1 weeks ago
nWave-ai
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