With a box, how can you maintain a reliable transaction across multiple database servers?
For example, if I had a table with a name AccountLedgeron one database server (MySQL instance) and a table with a name Useron another database server, is it possible to start a transaction through both database instances that will be securely committed or rolled back in case of failure?
Transaction Example:
AccountLedger Database Server:
START TRANSACTION;
INSERT INTO AccountLedger SET
UserID = @UserID,
Date = @Date,
Debit = @Debit,
Balance = @Balance;
User Database Server:
START TRANSACTION;
UPDATE User SET
Balance = @Balance
WHERE UserID = @UserID;
AccountLedger Database Server:
COMMIT;
User Database Server:
COMMIT;
I read quite a lot about sharding, but I cannot find any information about using transactions with sharding. Can someone point me in the right direction?
source
share