Composable event sourcing with monads
summary
Claims that event sourcing becomes an implementation detail by lifting command results into a Sourced monad that replays each emitted event immediately, accumulates them like a writer monad, and threads the in-memory state through for composition. Implements helpers and a case class in Scala (references cats / scalaz) and a turtle demo to show composing commands into atomic multi-event persistence, enabling optimistic locking and declarative, testable mutation; code and slides live in the repo.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:47Building blocks
- 6:31Recap
- 6:41What we want
- 7:13Why compose
- 8:12Alternative approach
- 8:47Multiple events
- 10:13Limitations
- 11:07Replaying intermediate events
- 11:29Automating replies
- 13:13Flatmap method
- 17:18update multiple instances
related talks
39mEvent Sourcing with Elixir
47mTransactional Event Sourcing Using Slick (Audit Log for Free!)
52mEvent Sourcing for the Cloud Developer
40mTransactional Event Sourcing using Slick audit log for free
51mThings I Wish I knew Before I Started with Event Sourcing
10mEvent sourcing
24mHow To Combine Event Sourcing Architecture In Your Node.js Server
52mEvent Sourcing – the what, why & how
