Some transactions of all partition leaders where transactions operate data are on the same server. These transactions are called standalone transactions or local transactions. To maximize the commit performance of standalone transactions, OceanBase conducts different optimizations for different scenarios.
Single-partition transaction
Transactions that perform write operations on only one partition are called single-partition transactions. For single-partition transactions, the commit does not require two PCs. Instead, OceanBase commits the transaction by writing a log.
Standalone multi-partition transaction
Transactions may perform write operations on multiple partitions, and leaders are on the same server. These transactions are called standalone multi-partition transactions. Due to the design of the partition-level log stream in OceanBase Database, standalone multi-partition transactions are also essentially distributed transactions. To improve the performance of a single server, OceanBase Database adopts a one-phase commit for transactions with the same participant replica distribution. This mechanism greatly improves the commit performance of standalone transactions.