News for hackers. Stuff that matters.
Re:The Reactive Monolith – How to Move from CRUD to Event So... by nuclearnice1 on Wednesday September 29, 2021 @10:49PM (#28702638)
What makes event sourcing poor for general purpose stuff?
Re:The Reactive Monolith – How to Move from CRUD to Event So... by mr_tristan on Wednesday September 29, 2021 @11:13PM (#28702797)
This seemed like a great rundown on why event sourcing is complicated: https://medium.com/@hugo.oliveira.rocha/what-they-dont-tell-...
Re:The Reactive Monolith – How to Move from CRUD to Event So... by Spartan-S63 on Wednesday September 29, 2021 @10:56PM (#28702690)
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.
Re:The Reactive Monolith – How to Move from CRUD to Event So... by 88913527 on Wednesday September 29, 2021 @11:01PM (#28702713)
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.
Re:The Reactive Monolith – How to Move from CRUD to Event So... by Spivak on Wednesday September 29, 2021 @11:43PM (#28702957)
Eh, two-way binding is still alive and well it’s just implemented explicitly on top of one-way bindings. It seems most developers find this easier to reason about but the relationship is still there.

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 So... by square_usual on Thursday September 30, 2021 @12:10AM (#28703090)
2-way bindings are still alive and well in the big "next gen" web frameworks, Vue and Svelte.
Re:The Reactive Monolith – How to Move from CRUD to Event So... by btown on Wednesday September 29, 2021 @11:36PM (#28702925)
Can this be mitigated by ensuring that historical/legacy events are all transformed to more modern equivalents? Similar in theory to https://stripe.com/blog/api-versioning ? Then you at least have a chain of testable transformations and a reduced cardinality for the actual interactions that reflects the cardinality of all the ways your business users actually use your product today.

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 So... by wrwatson on Thursday September 30, 2021 @12:09AM (#28703088)
The first rule of data modelling is that you should model only what you care about. A good model allows you to store and retrieve what you need to meet your requirements.

Maybe you care about all the events that have ever happened on your incredible journey to reach a list of the customers you have today.

Or maybe it would be sufficient to have been mutating a customers table all along. If that is sufficient, then it would be faster and more straightforward to have done so.

Re:The Reactive Monolith – How to Move from CRUD to Event So... by mistahenry on Thursday September 30, 2021 @03:03AM (#28703893)
This is why I always like to have a `status_history` or `audit` table. You don't have to have event sourcing to still want a trail of who changed what in the system when.
Re:The Reactive Monolith – How to Move from CRUD to Event So... by _3u10 on Wednesday September 29, 2021 @11:03PM (#28702734)
Event sourced systems are actually great, as long as they aren’t branded as such. Most of the time it’s totally stupid and the state of the system isn’t reproducible anyway unless the event code is never modified.
Re:The Reactive Monolith – How to Move from CRUD to Event So... by holoduke on Thursday September 30, 2021 @12:45AM (#28703281)
Extra layer of complexity. More development time. More tech dependencies. Don't use it when not needed.
Re:The Reactive Monolith – How to Move from CRUD to Event So... by bsder on Wednesday September 29, 2021 @11:36PM (#28702929)
Event sourcing is decent when you ingest a lot of things that are mostly one way and immutable once they come into your system.

If you have bidirectional communication, you wind up contorting yourself into a pretzel to bury "state" into your event streams.