For anyone that’s interested in Event Sourcing and/or Domain Driven Design, I’ve created a demo ToDo app that uses the eventsourcing library.
It depends on a resuable ‘anvil_event_sourcing’ app, so you’ll need to clone both and sort out the dependencies in order for it to work.
Here’s the ToDo demo:
https://anvil.works/ide#clone:XYEMUB56MVYAO3WE=VVQXIBCHF76GI3EJ2LB2CA5J
And the dependency:
https://anvil.works/ide#clone:7T4AYEPHWLKX7ZCR=2M32Q3C5RYQPKYO7JVLLZZHC
1 Like
Looks great - wish I knew what it did 
1 Like
The gist is that only events get persisted in the database. The current state of any object (or state at any other point in time) is generated on the fly by replaying the relevant events.
There’s a talk on why this might be a good idea at https://www.youtube.com/watch?v=JHGkaShoyNs
1 Like
UPDATE
I’ve refactored both apps to use a more functional approach and far less code as a result.
1 Like
@owen.campbell 
The clone link for ToDo Demo app is no longer valid. Mind sharing a new link for the updated version?
Sorry, that no longer exists and I don’t maintain it.
Ok. Thanks for the quick response 