Local transaction is a concept relative to cross-server distributed transaction. All the partition leaders of the tables on which a local transaction operates are on the same server as the transaction session.
Local transactions can be divided into local single-partition transactions and local multi-partition transactions based on the number of tables on which the transaction operates.
Local single-partition transaction
A local single-partition transaction must meet the following two conditions:
Operations in the transaction involve only one partition.
The partition leader is on the same server as the transaction session.
Local single-partition transaction is the simplest model in which the transaction commit is highly optimized.
Local multi-partition transaction
A local multi-partition transaction, which is also called a standalone multi-partition transaction, must meet the following two conditions:
The partition leaders of the tables on which the transaction operates are on the same server.
The partition leaders are on the same server as the transaction session.
Due to the log streams designed for partitions in OceanBase Database, standalone multi-partition transactions are also essentially distributed transactions. To improve the performance of a single server, OceanBase Database optimizes the transactions that have the same participant replica distribution. Compared with the traditional two-phase commit, the optimization greatly improves the commit performance of standalone transactions.