Event Sourcing with Elixir
summary
Explains how to record every state change as events, store them in Postgres using Commanded eventstore, and recover or replay state to audit, debug, run time travel simulations, or rebuild after corruption. Shows a demo repo and an extended example with five services, gives concrete code patterns for an event publisher and a per-consumer GenServer event consumer, recommends storing payloads as jsonb, describes causation/correlation ids, versioning, snapshots and using RabbitMQ or Kafka as an agnostic bus.
AI-written summary · about
chapters (13)
- 0:00Intro
- 0:26Why use event sourcing
- 4:17What is event sourcing
- 5:21Example
- 8:49Streams
- 12:46GitHub
- 13:46Event Store
- 16:05Event Publisher
- 19:01How to recreate the functionality
- 22:30Event Consumer
- 26:21Event Store Architecture
- 30:13Questions
- 32:42Best Practices
related talks
51mThings I Wish I knew Before I Started with Event Sourcing
43mEvent Sourcing dealing with an eventful past
48mEvent Sourcing - what could possibly go wrong?
52mEvent-driven vs event sourcing: what's really the difference?
01h 25mBuilding microservices with event sourcing and CQRS
52mEvent Sourcing for the Cloud Developer
52mUse the Source, Luke: High-fidelity history with event-sourced data
01h 07mAn Architecture with CQRS and Event Sourcing
