4 ms·
Another approach to this kind of thing would be storing most of your data as a log of events ("event sourcing") and having "Retroactive Address Change" as its o
by Terr_ 3y ago
Another approach to this kind of thing would be storing most of your data as a log of events ("event sourcing") and having "Retroactive Address Change" as its own business-process, one which can be linked to the other steps like sending a refund check or crediting an account.
In that architecture, the database-row will often remain plain and boring with just one "current address." That "projection" (a result of events-so-far) would simply switch whenever the "Retroactive Address Change" event comes down the pipeline, which would be good enough for, say, the system that is sending out monthly statements.
Anybody needing more, like the exact history of changes and realizations, would be running their own processor and projection, scanning the event-stream in a way suitable to their specific use-case.
- gtramont 3y agoCame here looking for this comment. It seems that Kent's re-discovering (re-inventing?) event sourcing…?
- svilen_dobrev 3y agoit's event-sourcing re-discovering accounting, back to ~1500 Luca Pacioly maybe..
- iamwil 3y agoHe readily admits it as a rebranding of an old concept. Sometimes, we need things reframed so we can tell the story to people that aren't engineers.
- skrebbel 3y agoI have never seen a productive application of event sourcing at scale. The idea is super elegant but there’s so much extra overhead. Your data size is easily 10x bigger, unless things nearly never change anyway (and then why do it, right?). Even simple things such as fixing a typo require a Command to be stored as an Event etc etc. Fixing fuckups by manual database edits / script runs gets harder because it means you’ll create a mismatch between the events and the main db, so you ought to inject events instead, but you’re under time pressure so what to do, and the list goes on. I wish these things weren’t issues because in a very real way event sourcing feels like the “obviously best way” to deal with pretty much any kind of structured data storage. I want it to succeed. Does anyone know of a system that successfully did/does event sourcing at scale? How did you deal with these downsides?
- bob1029 3y ago> Even simple things such as fixing a typo require a Command to be stored as an Event etc etc. Fixing fuckups ... Event sourcing is a completely different way of thinking about business information. Of course you are going to run into things that look like "downsides". Consider the desired semantics of event sourcing and how your concerns run directly in the face of these semantics. If you aren't comfortable with what qualitatively seem like "trivial" updates, then I don't think a large enough leap of faith has been made. We like to empathize with the machine but sometimes we take it a bit too far. Event sourcing absolutely works and it works at the most massive scales the best. If you can dedicate an entire wing of your 15th floor office to "enterprise messaging and events", this stuff 5000% works. It seems to be at the small scale that it fails most frequently. At small scale, it's usually just one developer who has enough motivation to see it through, and the moment they shift their focus it falls apart. I saw it work in manufacturing in ways I cannot do justice in HN comment size limits.
- turnsout 3y agoYes, the event model is the only thing that makes sense. Just wanted to say, I don't think Kent's idea is in conflict with the Event Sourcing pattern, as long as these "Effective/Posting" events are stored append-only. Once you start updating the "Effective" date, you're losing data (a customer might call back and ask what the old Effective date was, to understand a paper bill, and you've lost it).
- bbkane 3y agoI would *love* to read a blog post/Google Doc/GitHub Gist/??? about this if you get the time to write one
- cratermoon 3y ago> Does anyone know of a system that successfully did/does event sourcing at scale? The git version control system. > Even simple things such as fixing a typo require a Command to be stored as an Event etc etc Yup. It's a commit in git, but yes, there's a command and it's store in the git history as an event.