Lab 03: Event Sourcing & CQRS
🎯 Objective
📚 Background
Event Sourcing
Traditional CRUD: Event Sourcing:
account: {balance: 700} → [Deposited(1000), Withdrew(200), Withdrew(100)]
Replay events → current state = 700CQRS (Command Query Responsibility Segregation)
Step 1: Set Up PostgreSQL Event Store
Step 2: Write Events (Command Side)
Step 3: Event Replay — Reconstruct Current State
Step 4: Time Travel — Replay to Any Point
Step 5: Create Snapshot for Performance
Step 6: CQRS — Build Read Model Projection
Step 7: Compare Event Sourcing vs CRUD
Step 8: Capstone — Python Event Sourcing Framework
Summary
Concept
Key Takeaway
Last updated
