Hacker News new | ask | show | jobs
by Misdicorl 2274 days ago
Step 1) Generate a GUID

Step 2) Send a message to all the `downstream` systems (i.e. not the Source of Truth systems) with the change description and GUID

Step 3a) Update source of truth with the new info, write the GUID to a log table in source of truth in the same transaction

Step 3b,c,d) Downstream systems poll the source of truth for existence of the GUID in the log table indicating the change has been committed to source of truth. Load latest value from source of truth and commit the change to the downstream system.

Step 4) If GUID never shows up, transaction was rolled back in source of truth (or an error occurred trying to send to one of the other downstreams, aborting before transaction)- do something relevant for your use case. Alert somebody, carry on, whatever.

3 comments

This seems entirely reasonable, but you forgot the 0'th step.

Create a source of truth. I'd bet a 'source of truth' internal to the bank doesn't exist right now, and they're probably pulling something manually from an external 3rd party.

And on with the regress..

Step -1) What form will this internal source of truth take, how much will it cost, and who builds that system?

Step -2) Who gets to make that decision?

My uncle used to do this kind of work and man, he has some horror stories. The common thread among his clients seemed to be 'We know we need to do something, we know it will cost a lot of time and money, and it absolutely cannot fail.' The hard part always seemed to be finding the person within the org who had both the authority to spend the money, the political clout to make the decision. Nobody wants to own something like that going wrong. The actual technical part of the work, they had that down pretty well as it was all they did.

That's table stakes as far as I'm concerned. If it can't be done quickly and correctly, you're in for a world of hurt. An organization in that position shouldn't be doing their own engineering. An individual in that situation should be brushing up their resume.
It's amazing how hard the "system of record" conversation can be.
Note that downstream systems can skip updates with this system, but will always be eventually consistent. Buyer beware
Is this a known pattern in distributed systems?
Found that SOT, SOR and "distributed transactions" are the related topics.
It's basically a generational cache pattern