Local transaction is a concept relative to cross-server distributed transaction. All the log stream 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-log stream transactions and local multi-log stream transactions based on the number of tables on which the transaction operates.
Single-log stream transactions
A local single-log stream transaction must meet the following two conditions:
Operations in the transaction involve only one log stream.
The log stream leader is on the same server as the transaction session.
Local single-log stream transaction is the simplest model in which the transaction commit is highly optimized.
Standalone multi-log stream transactions
A local multi-log stream transaction, which is also called a standalone multi-log stream transaction, must meet the following two conditions:
The log stream leaders of the tables on which the transaction operates are on the same server.
The log stream leader is on the same server as the transaction session.
Due to the log streams in OceanBase Database, standalone multi-log stream 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.