Live data from Hacker News

The Reactive Monolith – How to Move from CRUD to Event Sourcing

wix.engineering

91–100 of 112 posts

Re: The Reactive Monolith – How to Move from CRUD to Event Sourcing

#91
post #88

Earlier quoted context omitted.

Correct, and many applications are using WAL via CDC (Change Data Capture) to gain some of the benefits of the CQRS/ES. The problem is that the CRUD is only recording "What" change/mutation was done, but not "Why" by "Whom", and "When" it was done. With tailing WAL / CDC you can also capture the "When". This can be partially mitigated by adding audit fields like: Why (reason for change): created_bc ("because") / crea…

Yup a few fields gets you a long way, though I would recommend an audit log updated by triggers, rather than audit fields. For example on my CRUD rails app, we use audit triggers in combination with setting a postgres local config variable with the username, the audit triggers pull the user info from the variables and record them into the DB. With a little more work I could probably also pull a backtrace of what line…

What kind of technology/data model do you use for the audit log? A timeseries db, just another table, or something else?

Re: The Reactive Monolith – How to Move from CRUD to Event Sourcing

#92
post #71
post #58

Earlier quoted context omitted.

I understand this thread is about dumping on ES... However, I must notice in your case it was an audit log. An ES system wouldn't work at all without access to events.

Yeah, the ES side of the system worked but was completely unnecessary. So loads of extra complexity, with no value for the business.

If the ES is "unnecessary", then it's not ES by definition. If events are not your source of truth, it's not event sourcing, just event logging.

Re: The Reactive Monolith – How to Move from CRUD to Event Sourcing

#93
post #65
post #56

Earlier quoted context omitted.

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.

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 conse…

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 Sourcing

#94
post #65
post #56

Earlier quoted context omitted.

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.

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 conse…

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 Sourcing

#95
post #37

As a proponent of Radical Simplicity, I'm always sceptical about event sourcing. There are some benefits (I found it useful to replay events for example), but where I have seen it at work it makes things much more complex, the understanding of the system and the development of new features takes much longer. This already starts with a command framework instead of method calls.

A competent dev experienced in event sourcing can build a system that leverages this without taking on so much cost. But… they’re expensive and hard to find. So most experiences of event sourcing look exactly like you describe.

What do they do differently in their implementations that make them produce faster?

Re: The Reactive Monolith – How to Move from CRUD to Event Sourcing

#96
post #92
post #71

Earlier quoted context omitted.

Yeah, the ES side of the system worked but was completely unnecessary. So loads of extra complexity, with no value for the business.

If the ES is "unnecessary", then it's not ES by definition. If events are not your source of truth, it's not event sourcing , just event logging.

I’m not sure what you mean. A car that sits in the driveway never being driven is still a car.

Re: The Reactive Monolith – How to Move from CRUD to Event Sourcing

#97
post #34

Earlier quoted context omitted.

I work on a bog standard ERP that was originally CRUD, but a whole module was refactored to event sourcing so clients could have a log and rollback. A couple of months back, a QA review reported a bug - the log system didn’t work. Turns out it’s never worked. Nobody has ever done a rollback either.

this is absolutely terrifying

not if nobody uses it ¯\_(ツ)_/¯

Re: The Reactive Monolith – How to Move from CRUD to Event Sourcing

#99
post #96
post #92

Earlier quoted context omitted.

If the ES is "unnecessary", then it's not ES by definition. If events are not your source of truth, it's not event sourcing , just event logging.

I’m not sure what you mean. A car that sits in the driveway never being driven is still a car.

It's a cargo-cult car;)

Re: The Reactive Monolith – How to Move from CRUD to Event Sourcing

#100
post #27

I've done a few Tech DDs on companies who have very CRUD-like operations and oddly chose to CQRS. Mind you, these are software companies doing about $3~$10M in revenue after 10 or so years (i.e. not rapid growth, but still valuable). Honestly, my big question is...why? I can find thousands (millions?) of CRUD and MVC developers in pretty much any major language, but how many developers can I find to write CQRS based…

> Honestly, my big question is...why?

CV oriented development.

Post reply on HN