I done some search but can't find proper terms to search.

There is two completely separated, but trusted databases. They have unreliable (but safe) connection. Both databases run on different servers with some probability of server failure.

Both databases operates with money and need to 'transfer' some amount from one account (database #1, server #1) to other (database #2, server #2).

That should be done in the way it will never cause 'lost money', or 'duplicated money', even if both servers crash and restore in worst moment.

I think someone generic algorithm should be for that.

有帮助吗?

解决方案

You're right, the is such an algorithm. It's called two-phase commit. It usually requires both DBMSs be the same.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top