The Reactive Monolith – How to Move from CRUD to Event Sourcing
11–20 of 112 posts
Re: The Reactive Monolith – How to Move from CRUD to Event Sourcing
#12I feel bad for anyone who got sucked into event sourcing for general purpose applications. Like... I'm burning a candle for you right now. The event stream stuff makes sense in some specialized use cases (LMAX?) but for general purpose stuff? Oof, no. EDIT: Also, don't hate me folks, but any article that references Fowler should be looked at with just a little bit of suspicion. Not hating the guy but he's blown quite…
What makes event sourcing poor for general purpose stuff?
Re: The Reactive Monolith – How to Move from CRUD to Event Sourcing
#13I feel bad for anyone who got sucked into event sourcing for general purpose applications. Like... I'm burning a candle for you right now. The event stream stuff makes sense in some specialized use cases (LMAX?) but for general purpose stuff? Oof, no. EDIT: Also, don't hate me folks, but any article that references Fowler should be looked at with just a little bit of suspicion. Not hating the guy but he's blown quite…
What makes event sourcing poor for general purpose stuff?
Re: The Reactive Monolith – How to Move from CRUD to Event Sourcing
#14This is the only practical book on event sourcing and cqrs I have ever seen.
After hearing about it all the time on HN I had never seen an actual implementation of it, this book uses JS so its easy to understand for any software engineer.
Re: The Reactive Monolith – How to Move from CRUD to Event Sourcing
#15Earlier quoted context omitted.
What makes event sourcing poor for general purpose stuff?
Not OP, but the number of variants in the events makes the cardinality of the state of the system extremely large. Probably too large to be able to reason about fully. It makes weird bugs in the event schema likely impossible to debug should they occur.
Of course, this can be lossy, but is it any more lossy than the non-event-sourced CRUD system which is essentially transforming historical events into "overwrite these fields" events that can only be used for their original purpose?
To me, the reason not to use event sourcing is more that the tooling and developer experience is just really poor - and so decisions like the above, while valuable to think through directly, rapidly become overwhelming. Visualizations of system state are only as good as the code you bring yourself. I'm hopeful that people building tools on top of things like https://materialize.com will start to change this though!
Re: The Reactive Monolith – How to Move from CRUD to Event Sourcing
#16I feel bad for anyone who got sucked into event sourcing for general purpose applications. Like... I'm burning a candle for you right now. The event stream stuff makes sense in some specialized use cases (LMAX?) but for general purpose stuff? Oof, no. EDIT: Also, don't hate me folks, but any article that references Fowler should be looked at with just a little bit of suspicion. Not hating the guy but he's blown quite…
What makes event sourcing poor for general purpose stuff?
If you have bidirectional communication, you wind up contorting yourself into a pretzel to bury "state" into your event streams.
Re: The Reactive Monolith – How to Move from CRUD to Event Sourcing
#17I feel bad for anyone who got sucked into event sourcing for general purpose applications. Like... I'm burning a candle for you right now. The event stream stuff makes sense in some specialized use cases (LMAX?) but for general purpose stuff? Oof, no. EDIT: Also, don't hate me folks, but any article that references Fowler should be looked at with just a little bit of suspicion. Not hating the guy but he's blown quite…
Some features that would be needed:
* Automatic , schema based event and aggregate versioning
* A combined event and aggregate data store with ACID guarantees, schema validation and indexes
* event migrations (so you don't have to carry around old event versions forever)
* Event stream migrations that allow re-writing streams for purging data, gdpr cleanup, etc
* Copy on write based stream clones that can be used for testing with production data
As it stands, such a solution is nowhere to be seen. So you have to cobble together a working system with lots of custom work , which often ends in a complete mess.
Re: The Reactive Monolith – How to Move from CRUD to Event Sourcing
#18Earlier quoted context omitted.
Not OP, but the number of variants in the events makes the cardinality of the state of the system extremely large. Probably too large to be able to reason about fully. It makes weird bugs in the event schema likely impossible to debug should they occur.
This is exactly why 2-way data binding fell out of favor in modern UI development. Describing the problem as "the cardinality of the state of the system extremely large" is a succinct way of putting it. The non-linear increase in possible state quickly makes testing an uphill battle. And it's over when you can't have a comprehensive testing strategy, forget about it.
Like if all you’re doing is using the event to take the value from the UI and shove it into the model with setState and re-render then you made a two-way binding.
Wouldn’t it be helpful if you could tell React to just do this for you and save you the boilerplate? Boom you invented ng-model.
Re: The Reactive Monolith – How to Move from CRUD to Event Sourcing
#19I feel bad for anyone who got sucked into event sourcing for general purpose applications. Like... I'm burning a candle for you right now. The event stream stuff makes sense in some specialized use cases (LMAX?) but for general purpose stuff? Oof, no. EDIT: Also, don't hate me folks, but any article that references Fowler should be looked at with just a little bit of suspicion. Not hating the guy but he's blown quite…
I'm the kind of person who learns by my making my own mistakes (as opposed to learning from others', which is what smart people do)—and boy, did I learn a lot from the mistake of trying to build a general purpose application with event sourcing.
Theoretically, event sourcing is the way all applications should be built. I was first taken by this methodology by Martin Kleppmann's talk "Turning the Database Inside Out" (2014)[0]. Looking back, I think I had always subconsciously felt like there was something wrong with mutating state in place. You lose information. You lose accountability. After all, "accountants don't use erasers," and Martin's talk validated many of my obsessive-compulsive insecurities about data. As Charity Majors points out on Twitter [1]:
> ...while storing raw events may be "expensive" compared to any single optimization, all optimizations can be derived from raw events. The reverse is impossible.
And that's true. The table-stream duality [2][3] means that if you store events, you can later project those events into the exact perfect table for any use-case. But if you transform those events into a projection and store that projection, well, whatever table you store is data you have. You wind up having just an aggregate.
Unfortunately, the technical costs you incur when you attempt to store events instead of tabular data are tremendous. The problems and questions that arise are basically endless. Tons of things you wouldn't even think about with a relational database become complicated design decisions [4]. If there were tooling and frameworks that made this easy, it would be one thing. But, there are not!
Kafka Streams is very cool. If you already have a running business with well-developed models and a large team, event sourcing with Kafka Streams could possibly go quite well. But if you need to get an MVP off the ground, it's just not what you need. What you need is PostgreSQL, perhaps with something like Hasura or postgraphile in front of it. What you need is a lightning-fast way to iterate and flesh out your idea. If that's you, and you're reading this, and you're smart: learn from me—event sourcing: don't do it!
[0] https://www.youtube.com/watch?v=fU9hR3kiOK0
[1] https://twitter.com/mipsytipsy/status/1115537408705957888
[2] https://docs.confluent.io/platform/current/streams/concepts....
[3] https://news.ycombinator.com/item?id=23207123
[4] https://softwareengineering.stackexchange.com/questions/3801...
Re: The Reactive Monolith – How to Move from CRUD to Event Sourcing
#20Maybe I'm a bit slow but I'm not seeing how any of their line-of-business operations are improved through this architecture.