#📝 Note: Event Sourcing

#Overview

Event Sourcing is a pattern where all changes to application state are stored as a sequence of immutable events. Instead of storing the current state, you store the history of state transitions and derive the current state by replaying events.

#Core Idea

#Event Sourcing vs Traditional CRUD

Aspect CRUD Event Sourcing
Storage Current state only Full history of changes
Updates Overwrite existing record Append new event
Audit Trail Requires explicit logging Built-in by design
Debugging "Why is the state wrong?" Replay events to see exactly what happened
Storage Cost Lower Higher (all events retained)

#Key Components

#When to Use

#When NOT to Use

#Trade-offs

#Used In This Repo