News for hackers. Stuff that matters.
Re:The Reactive Monolith – How to Move from CRUD to Event So... by vegai_ on Thursday September 30, 2021 @02:37AM (#28703777)
Two examples of systems that use a variant of event sourcing:

- relational database systems (their journals and async replication in particular)

- git

Perhaps not so shit. Perhaps a bit practical. It's just a bad fit for some problems and architectologists like to say it's good for everything for obvious reasons.

And it's should be pretty obvious that architecture doesn't matter at all if it's implemented poorly.

Re:The Reactive Monolith – How to Move from CRUD to Event So... by _3u10 on Thursday September 30, 2021 @03:22AM (#28703963)
Here's the key, all the systems in which event sourcing works have clear immutable definitions of what an event does / means.

eg. Git ALWAYS applies a commit in a consistent way (and where it doesn't it's a disaster)

eg. If you modify the transaction replay code from one version to the next of a DB, it creates a mess. (and why many databases won't replay transactions from previous versions, or even boot at all, see Postgres)

The problem with event sourcing is that the same bad practices that came from the CRUD system are recreated using events, which makes the system inherently worse because now the state of your system is unstable, instead of just the manner in which you got to the current state.

Imagine if everytime your rebooted your Postgresql cluster and it replayed Postgres 7 transaction logs, even though your running on Postgres 13, and generated an objectively different state, except, now your using CI and every commit from every developer will boot your system into a different state. Also, your database now takes 2 months to start as every transaction gets replayed.

Take rails db migrations for example, the best practice is, every 6 months or so, to just dump the schema from production, create one large initial "migration" and add migrations from there, because eventually they become desynced, and you can't cleanly replay your migrations into a schema that mirrors prod.

If you are extremely careful, and follow a bunch of best practices you can, but in the general case it costs less to just dump schemas.

Re:The Reactive Monolith – How to Move from CRUD to Event So... by codeflo on Thursday September 30, 2021 @03:16AM (#28703938)
We have to be very precise here I think.

Git doesn't really store file changes as events, rather, it's a long chain of state snapshots, in something like a persistent data structure. Sure, the history is all there, but so is the current state in its most efficient form.

DB transaction logs might be considered event sourcing by some definition, but their use is very different. It's purely a technical trick. As a consequence, logs are truncated as often as possible/reasonable, and you never rerun the transaction log from time zero. Very different from the event sourcing idea to keep events as long as possible.

Re:The Reactive Monolith – How to Move from CRUD to Event So... by dtech on Thursday September 30, 2021 @04:29AM (#28704250)
Event sourcing with snapshotting and deleting old events - like DB transaction logs - is still event sourcing. In fact I'd say it's the only way ES makes practical sense.
Re:The Reactive Monolith – How to Move from CRUD to Event So... by kephasp on Thursday September 30, 2021 @08:36AM (#28705589)
ES is always a technical trick. It's a way to store data, it's unrelated to the business domain…
Re:The Reactive Monolith – How to Move from CRUD to Event So... by vegai_ on Thursday September 30, 2021 @08:52AM (#28705710)
I believe ES allows taking snapshots (they call them projections, perhaps?) and removing all logs before the snapshot, which I think is kinda what dbs do?
Re:The Reactive Monolith – How to Move from CRUD to Event So... by antod on Thursday September 30, 2021 @11:50PM (#28714268)
yeah, describing git as a stream of change events sounds more like the way svn or mercurial worked than git.