by socketcluster · 1y ago · 0 comments
You can have a really simple two-phase commit system where you initially mark all records as 'pending' and then update them as 'settled' once all the necessary associated rows have been inserted into their respective tables. You can record a timestamp so that you know where to resume the settlement process from. I once had multiple processes doing settlement in parallel by hashing the ids to map to specific processes so it scales really well.
Two-phase commit is a particular way of implementing transaction when system is distributed. There is no "instead" here