In
computer science
Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
and
data management
Data management comprises all disciplines related to handling data as a valuable resource, it is the practice of managing an organization's data so it can be analyzed for decision making.
Concept
The concept of data management emerged alongsi ...
, a commit is a behavior that marks the end of a transaction and provides
Atomicity,
Consistency
In deductive logic, a consistent theory is one that does not lead to a logical contradiction. A theory T is consistent if there is no formula \varphi such that both \varphi and its negation \lnot\varphi are elements of the set of consequences ...
,
Isolation, and
Durability
Durability is the ability of a physical product to remain functional, without requiring excessive maintenance or repair, when faced with the challenges of normal operation over its design lifetime. There are several measures of durability in us ...
(ACID) in transactions. The submission records are stored in the submission
log for recovery and consistency in case of failure. In terms of transactions, the opposite of committing is giving up tentative changes to the transaction, which is rolled back.
Due to the rise of
distributed computing
Distributed computing is a field of computer science that studies distributed systems, defined as computer systems whose inter-communicating components are located on different networked computers.
The components of a distributed system commu ...
and the need to ensure
data consistency
Data inconsistency refers to whether the same data kept at different places do or do not match.
Point-in-time consistency
Point-in-time consistency is an important property of backup files and a critical objective of software that creates backups. ...
across multiple systems, commit protocols have been evolving since their emergence in the 1970s. The main developments include the
Two-Phase Commit Two-phase may refer to:
* Two-phase electric power
* Two-phase commit protocol
* Two-phase flow
* Two-phase locking
* Binary phase, chemical compounds composed of two elements
{{Disambig ...
(2PC) first proposed by
Jim Gray, which is the fundamental core of distributed transaction management. Subsequently, the
Three-phase Commit (3PC), Hypothesis Commit (PC), Hypothesis Abort (PA), and Optimistic Commit protocols gradually emerged, solving the problems of blocking and
fault recovery.
Today, new fields such as
e-commerce
E-commerce (electronic commerce) refers to commercial activities including the electronic buying or selling products and services which are conducted on online platforms or over the Internet. E-commerce draws on technologies such as mobile co ...
payment and
blockchain
The blockchain is a distributed ledger with growing lists of Record (computer science), records (''blocks'') that are securely linked together via Cryptographic hash function, cryptographic hashes. Each block contains a cryptographic hash of th ...
technology are emerging, and submission protocols play a significant role in various business areas. By effectively handling transactions, resolving faults and recovering problems, the commit protocol becomes crucial in ensuring the
reliability
Reliability, reliable, or unreliable may refer to:
Science, technology, and mathematics Computing
* Data reliability (disambiguation), a property of some disk arrays in computer storage
* Reliability (computer networking), a category used to des ...
and consistency of data management.
History

The concept of Commit originated in the late 1960s and early 1970s, when computer technology was rapidly advancing and data management was becoming an important requirement in business and finance. Enterprises have gradually replaced the traditional paper records with computers, which has fully improved the work efficiency. The reliability and consistency of data have become a necessary requirement.
Transaction management at this stage is relatively simple, limited to using a single computer for processing. It merely effectively records the changes in data to ensure that the data remains stable after the transaction is completed or terminated. In the late 1970s, as database systems moved from a single calculator operation to multiple distributed collaborations, ensuring data consistency and reliability became a new challenge. In 1978, computer scientist Jim Gray proposed the famous two-phase Commit Protocol (2PC), which became an effective solution for distributed transaction management, successfully managing data synchronization problems between multiple nodes.
However, this commit protocol has some potential transaction blocking problems when nodes fail.
In the early 1980s, researchers discovered that although the two-step commit protocol was effective at synchronizing data, there could be long waits and even system crashes, with limitations. To improve this problem, people have begun to explore new and effective methods, including enhancing efficiency by reducing message communication during the protocol process. IBM's R* database introduced the Assumed Commit and Assumed abort protocols, which contributed significantly to transaction management efficiency.
These two protocols have greatly improved the processing efficiency of distributed transactions by reducing
communication
Communication is commonly defined as the transmission of information. Its precise definition is disputed and there are disagreements about whether Intention, unintentional or failed transmissions are included and whether communication not onl ...
overhead and have become an important breakthrough in the technology of transaction commit protocols.
By the early 1990s, with the increase in business demands and the complexity of transactions, enterprises required higher efficiency in distributed transaction processing. In order to adapt to the needs of different environments, the scientific community has gradually developed various variants of commit protocols to provide more flexible transaction management options for different needs.
For example, the three-phase commit protocol promotes the commit of transactions more effectively and reduces the occurrence of blocking problems by adding a pre-commit protocol and a timeout mechanism.
In the 21st century, with the popularization of mobile Internet and wireless technology, the commit protocol has been further developed, and researchers have begun to pay attention to how to reduce the blocking in the transaction process to solve the problem of broadband limitation, battery life and network instability in the mobile environment. The proposal of optimistic commit protocol marks the extension of commit technology from traditional database to the emerging mobile data field.
This protocol allows transactions to temporarily use unconfirmed data, improving the user experience in cases of poor network conditions.
In recent years, with the rise of blockchain and decentralized technologies, submission protocols and consensus mechanisms have gradually merged. These consensus algorithms play a role in tamper-proofing and preventing malicious attacks on node pairs in a decentralized environment. This enables commit to no longer be confined to the scope of traditional database management, but to become the core technology of trust computing and distributed ledgers, further expanding the application field of commit in the
digital age
The Information Age is a History by period, historical period that began in the mid-20th century. It is characterized by a rapid shift from traditional industries, as established during the Industrial Revolution, to an economy centered on info ...
. This integration has brought about extensive application impacts. Each transaction can achieve the effect of tracking global submissions through the verification of the consensus mechanism, becoming an important technical foundation for promoting the circulation of digital assets, the operation of cryptocurrencies and decentralized applications.
Commit Protocol Types
In the world of data management, a transaction is a series of database operations, such as
bank transfer
Wire transfer, bank transfer, or credit transfer, is a method of electronic funds transfer from one person or entity to another. A wire transfer can be made from one bank account to another bank account, or through a transfer of cash at a cash ...
s and order submission. In order to ensure the accuracy, consistency, and security of the data, transactions are usually completed completely, or cancelled completely, leaving no partially completed results.
Commit protocol is the method used to coordinate this process. Different protocols are applicable to different submission scenarios and have their own advantages and disadvantages. There are four major commit protocols.
Two-Phase Commit (2PC)
The two-phase commit protocol is the most classic and broadest approach to distributed transactions, which includes both a preparation phase and a commit phase.
This commit protocol is designed to allow the database coordinator to determine if all participating nodes agree. The preparation phase is the phase in which the coordination node sends a ready to commit request to all nodes participating in the transaction. The commit phase is a global commit after all participating nodes are ready, and if no agreement is reached, all nodes
roll back the transaction and undo all previous operations.
Although the two-phase commit protocol is the easiest to operate and widely used, its obvious drawback is that it can cause transactions to be blocked for a long time when nodes fail, resulting in a decline in system performance and making it difficult to terminate or continue immediately.
Three-Phase Commit (3PC)
The three-phase commit protocol is an improved non-blocking protocol based on 2PC, which is divided into three stages: preparation, pre-commit and commit. Firstly, each node sends a "preparation" request. After confirmation, a "pre-submission" stage is added. At this point, each node has completed most of the preparatory work and is waiting for the final confirmation. Finally, in the formal commit stage, after all nodes send the "commit" request, the transaction is completed and committed. Compared with 2PC, it increases the timeout mechanism, avoids the
blocking problem caused by single point of failure, and improves the reliability of the system.
The three-phase commit protocol significantly optimizes transaction reliability, but adds additional
overhead for message transmission and state maintenance. It is more suitable for distributed application scenarios with high transaction sensitivity and no acceptance of long waiting times.
Presumed Commit (PC) and Presumed Abort (PA)
Presumed Commit (PC) is the default that the transaction will be committed successfully and rollback will be notified unless an anomaly is encountered. This commit reduces the message overhead and logging costs of a normal commits. Presumed Abort (PA) is assumed that the
default state of the transaction is a rollback and will only be committed when all nodes have explicitly agreed.
This commit is applicable to transactions that are not updated frequently or have a low probability of successful commit. The IBM R* Distributed Database management System was the first to propose and practice the PC and PA protocols, handling distributed transaction management very efficiently and becoming a classic case in the field of database transaction management.
Optimistic Commit Protocol
With the rise of the Internet, the previous commit protocols are facing new challenges, especially in mobile scenarios with unstable networks. Excessively long transaction waiting times can affect the user experience. The Optimistic Commit Protocol allows a transaction to temporarily access uncommitted data before committing to avoid wait times.
This type of commit is suitable for high-contention environments, but if a transaction fails, additional compensatory transactions need to be executed to achieve semantic atomicity to ensure final data consistency.
Once the compensation thing detects a transaction failure, it will promptly execute another special transaction and undo the previous temporary operation to restore the data to the consistent state before the transaction. The optimistic commit protocol developed by Levy et al. (1991) uses compensation transactions to solve the problem of indefinite waiting that traditional two-phase commit protocols may face, and improves the system performance.
Failures and Recovery in Commit Protocols
Commit protocol is mainly used to ensure the consistency and integrity of data during transaction processing. However, in actual operation, node failure or abnormal shutdown is inevitable, which may cause data confusion and loss. Common failures include network outages, server failures or transaction operation conflicts.
The following mechanisms can help the Commit protocol effectively deal with anomalies, maintain data consistency, and ensure that the transaction submission can be completed efficiently.
Logging and Recovery
Logging is one of the important means of fault recovery. Each participating database node records every step of a transaction in real time, including transaction initiation, data update, commit, or transaction termination. These
records are called logs. When the system malfunctions or terminates abnormally, the data will become inconsistent and chaotic. At this time, logs play an important role. In this case, the database system can quickly recover to the consistent state before the fault by reading the logs recorded before the fault. This recovery method is divided into redo and undo. To make sure the updated material is saved correctly, the system uses a technique known as "redo" to re-execute the transaction steps that were documented in the log after a transaction has been verified as committed.
The system uses a feature known as "undo" to make sure that all actions have been completely rolled back in the event that a transaction commit mistake occurs.
Log recording is widely used in various mainstream database systems, including IBM's R* database, effectively ensuring the reliability of data.
Compensating Transactions
In the Optimistic Commit Protocol, a transaction may use data before it is committed, which improves efficiency, but only if it is committed successfully. When a transaction eventually fails or aborts, the data that has been modified may be inconsistent. Therefore, the concept of compensating transactions is introduced.
The meaning of a compensated transaction is that when a transaction fails or terminates, the system does not cancel the transaction, but executes a special transaction to compensate or undo the operation done by the previous transaction, so that the data is restored consistently. For example, in e-commerce, if the original transaction is to create an order and deduct inventory, when this transaction fails, the compensation transaction will cancel the order and restore the inventory. Compensation transactions have independence and
persistence
Persistence or Persist may refer to:
Math and computers
* Image persistence, in LCD monitors
* Persistence (computer science), the characteristic of data that outlives the execution of the program that created it
* Persistence of a number, a ma ...
, that is, they can be executed without relying on the original transaction and still maintain the final successful execution when the system crashes. This method effectively avoids the Cascading Aborts problem that may occur due to traditional transaction revocation. It is applicable to scenarios where instability frequently occurs in mobile networks and ensures the performance and stability of transaction processing.
Timeout Mechanism
Commit protocols typically wait for confirmation from multiple nodes. If one of the nodes fails or the network fails, the entire transaction can stop for a long time, seriously affecting efficiency, a situation known as a blocking problem.
The timeout mechanism provides a solution to the blocking problem. A maximum timeout threshold will be set in this mechanism. When the transaction waiting time exceeds the preset time, the system automatically determines that the transaction fails, rolls back the transaction, and releases the occupied data resources, effectively preventing the entire system waiting time from being too long. The time-out mechanism is typically used by the three-phase Commit protocol (3PC), which effectively reduces the problem of long waiting time and blocking in distributed transactions and avoids the phenomenon of system resources being occupied for a long time.
The timeout mechanism is usually carried out in combination with the status inquiry mechanism to detect whether the node is still active, increasing the fault tolerance of the system.
Applications of Commit Protocols
Commit protocols are widely used in all areas of life and business. Although most users do not have direct contact with these technologies, they effectively ensure the accuracy and consistency of user data. Financial transaction payments, e-commerce transactions, flight and
hotel reservations, blockchain and currency transactions are some typical
application scenarios of submission protocols.
Banking and Financial Transactions
Transactions processed by the banking system typically need to generate money flows between multiple accounts, and each transaction must be very accurate, especially in cross-regional transfer and payment businesses. Any error in data or nodes will lead to a loss of funds. For example, when you transfer money to a friend via
mobile banking, the bank's processing system is actually operating on multiple database servers at the same time to complete the transaction.
The commit protocol ensures that each
bank transfer
Wire transfer, bank transfer, or credit transfer, is a method of electronic funds transfer from one person or entity to another. A wire transfer can be made from one bank account to another bank account, or through a transfer of cash at a cash ...
will only be a complete success and a complete non-execution of the transfer. This mechanism maintains the rigor of banking operations and prevents the loss of funds or account data. The classic Two-phase Commit Protocol (2PC) is typically used in banking systems around the world and is recognized as a standard solution by banks and
financial system
A financial system is a system that allows the exchange of funds between financial market participants such as lenders, investors, and borrowers. Financial systems operate at national and global levels. Financial institutions consist of comple ...
s to ensure the accuracy and reliability of transactions, especially in cross-border transfer transactions.
Through this agreement, the bank can avoid differences in the
balance
Balance may refer to:
Common meanings
* Balance (ability) in biomechanics
* Balance (accounting)
* Balance or weighing scale
* Balance, as in equality (mathematics) or equilibrium
Arts and entertainment Film
* Balance (1983 film), ''Balance'' ( ...
of users' accounts and significantly reduce the risk of customers' property loss.
E-commerce and Mobile Applications
With the rapid development of mobile Internet, commit protocols are widely used in
online shopping
Online shopping is a form of electronic commerce which allows consumers to directly buy goods or services from a seller over the Internet using a web browser or a mobile app. Consumers find a product of interest by visiting the website of th ...
and mobile payment scenarios. For example, when a user places an order to pay on the platform, the backend system needs to use a commit protocol to ensure that order information, inventory data, and payment amounts are always consistent and accurate.
However,
electronic devices
Electronics is a scientific and engineering discipline that studies and applies the principles of physics to design, create, and operate devices that manipulate electrons and other electrically charged particles. It is a subfield of physics and ...
often encounter network disconnections or instability, and optimistic commit protocols are widely used in this context. This protocol allows transactions to use short-term data first and then compensate for the changes made before the transaction is rolled back after verification fails. This method enables things to be successfully submitted even under poor network conditions, effectively reducing waiting time, ensuring the smooth progress of transactions, and significantly improving user experience and satisfaction.
Airline and Hotel Reservations
Airlines and hotels need to ensure that the inventory data on multiple
servers remains consistent when handling
reservations. Once the data is not synchronized in
real time, problems such as
overselling and duplicate reservations will occur. For example, when passengers book flights, the system must ensure that the number of remaining seats is updated in real time on all platforms.
The thing submission protocol avoids the overselling problem caused by data desynchronization by simultaneously controlling the data information on multiple servers. IBM 's R* database management system uses the Presumed Commit protocol to handle such booking services efficiently, ensuring the accuracy and efficiency of customer booking.
Blockchain and Cryptocurrencies
In recent years, the rise of blockchain technology has made the commit protocol have a new application scenario. Blockchain is essentially a decentralized data management system that allows transactions and data updates to achieve data consistency through consensus among multiple decentralized nodes.
Commit protocol, combined with the Consensus Mechanism in the blockchain, provides the necessary
data security
Data security or data protection means protecting digital data, such as those in a database, from destructive forces and from the unwanted actions of unauthorized users, such as a cyberattack or a data breach.
Technologies
Disk encryption
...
for decentralized applications such as
cryptocurrency
A cryptocurrency (colloquially crypto) is a digital currency designed to work through a computer network that is not reliant on any central authority, such as a government or bank, to uphold or maintain it.
Individual coin ownership record ...
transactions and
Smart Contracts
A smart contract is a computer program or a transaction protocol that is intended to automatically execute, control or document events and actions according to the terms of a contract or an agreement. The objectives of smart contracts are the re ...
.
In addition, this combination ensures that the results of transaction execution in the blockchain network are consistent across all nodes, thus becoming an essential
infrastructure
Infrastructure is the set of facilities and systems that serve a country, city, or other area, and encompasses the services and facilities necessary for its economy, households and firms to function. Infrastructure is composed of public and pri ...
for the
digital economy
The digital economy is a portmanteau of digital computing and economy, and is an umbrella term that describes how traditional Brick and mortar, brick-and-mortar economic activities (production, distribution, trade) are being transformed by the ...
.
For example, the special commit protocol adopted by the
Hyperledger Fabric platform directly emphyses the consensus mechanism into the transaction verification process to enhance the robustness against malicious nodes and network partitions.
See also
*
Atomic commit
In the field of computer science, an atomic Commit (data management), commit is an operation that applies a set of distinct changes as a single operation. If the changes are applied, then the atomic commit is said to have succeeded. If there is a f ...
*
Two-phase commit protocol
In transaction processing, databases, and computer networking, the two-phase commit protocol (2PC, ''tupac'') is a type of Atomic commit, atomic commitment protocol (ACP). It is a distributed algorithm that coordinates all the processes that pa ...
*
Three-phase commit protocol
In computer networking and distributed databases, the three-phase commit protocol (3PC) is a distributed algorithm that ensures all nodes in a system agree to commit or abort a transaction. It improves upon the two-phase commit protocol (2PC) by ...
References
{{databases
Data management
SQL
Transaction processing
Database management systems