Cladding and transactions with MySQL

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; -- What happens if the COMMIT fails here (power goes out or whatever)

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?

+5
source share
3 answers

. InnoDB. MySQL: XA Transactions

. ypur, , . Java EE .

, , , . CAP , .

+8

, , ( MySQL). Google Percolator CockroachDB MySQL.

. , .

, RAMP . MySQL.

+3

: ScaleBase (http://www.scalebase.com),

ScaleBase XA InnoDB, , ... , , ( ..), , " 2- ", XA ... " " "", SELECT() , . , " ScaleBase", ( , , - XA).

0
source

All Articles