Four Refactors and a Funeral: Migrating a Live System to Event Sourcing (in depth)
Posted by Xerax@reddit | programming | View on Reddit | 9 comments
I've spent the last few months working on this project and now it's done i've done a writeup of alllll the learnings (mistakes). Hope a few of you find it nice!
haloll@reddit
How does the reactor pattern prevent the need for an outbox? I’m struggling to map how the reactor pattern deals with a post write but pre-reactor processing crash. If reactors aren’t polled by an an outbox, then a crash means reactors are missed. But if reactors are inside the same transaction as the initial write, then an error in a reactor either crashes the main write or requires rolling back that reactors progress thus far.
turturtles@reddit
It’s just a slop article, just like the vibe coded website.
Xerax@reddit (OP)
really isn't ai slop actually, i'm sorry you think it is, but ja it was a large project and wanted to share what we learned.
turturtles@reddit
As someone pointed out, the link in the article, and then trying to do anything on mobile.
Xerax@reddit (OP)
oh i didn't realise i wrote an article about the shitty framer site, my bad
Xerax@reddit (OP)
also i do agree with the website, damn. it's a framer website but i'v used it on my phone before, fuck me it felt like the ultimate captcha. just go get out of the menu
RustOnTheEdge@reddit
Yeah, the link to part 1 in the first sentence is to
http://linklolXerax@reddit (OP)
i made a mistake, oh no
Xerax@reddit (OP)
yeah this is a fair question. honestly i just liked the reactor kills joke haha. i think they're just slightly different versions of the same thing. we get guaranteed delivery of both the db write and the reactor hit from the queue. everything is idempotent so if anything fails we default to fail backwards and try again, so that is how we handle the "atomic/transactional" aspect of db/reactor writes.
it all comes down to requirements right?
i think the main differences are:
1) there is no db record for outbox items directly (they may trigger an event tho)
2) who is in charge of the dispatching of outbox items. instead of a worker/cron/etc. the queue just ignored the job until the time has come.
2.5) as well as the subtle difference, some outbox patterns fetch from the db when they send, but this implementation of the reactor carries the event and fold/map outcome from the projector, so it's very much a print in time affair. but like i said, you can do the same with an outbox ofc.