How to run two-phase commit transaction
ScalarDB GraphQL supports two-phase commit style transactions
called Two-phase Commit Transactions.
With Two-phase Commit Transactions, you can execute a transaction that spans multiple
processes/applications (e.g., Microservices).
We name the application that starts a transaction "coordinator" while the applications that
join the transaction are named "participants".
Every two-phase commit operation requires annotating the mutation or query operation with
a @twoPhaseCommit
directive. Below is a description of such operations.
Start a transaction
To start a transaction, add the @twoPhaseCommit
directive without setting parameters.
query some_query @twoPhaseCommit {
# some query
}