Store all changes as events
Event Sourcing stores every change to application state as a sequence of events, never updating records. Traditional: User balance = $100. Event Sourcing: [Deposited $50, Withdrew $20, Deposited $70] → current balance derived from events. Benefits: full audit trail, time travel (replay to any point), easy debugging. Costs: complexity, eventual consistency, more storage. Useful for finance, compliance, complex domains.
Use Event Sourcing when you need full audit trails (finance, healthcare, legal compliance), when you need to rebuild state at any point in time, or when business logic is complex and benefits from event replay. Don't use for simple CRUD apps—it adds significant complexity. Most apps don't need event sourcing, an audit log table is simpler.
System Design Patterns