Skip to content

Instantly share code, notes, and snippets.

@juanpaco
Created May 23, 2017 16:49
Show Gist options
  • Save juanpaco/1b6c937cadee7378e733f86a8d54dbf5 to your computer and use it in GitHub Desktop.
Save juanpaco/1b6c937cadee7378e733f86a8d54dbf5 to your computer and use it in GitHub Desktop.
Blurb about event sourcing
I get into it here https://www.youtube.com/watch?v=h8ihxzfqH0A&t=1123.
But the gist is, in an event-sourced system, your *write* data by just writing events. That is super simple and great for writing, but it isn't a great read model. A good read model would look like a user row in a table, or a user document in a doc store of some sort.
In work I'm doing this morning, we have some user docs, and updating them is really a pain (CouchDB-- that's a different discussion). It would be swell to just write an event of the flavor "userAttributeUpdated" with a payload that describes what was changed or something. Then I could shape that into whatever I need for a read rather than having to maintain the read model while I'm writing.
Not sure if this is glossing over too much or not, so please let me know. The above video link will help with that, and I think you could safely play it at 2x speed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment