A database transaction, sometimes referred to as a DB transaction, is a unit of work performed within a database management system (DBMS) or other transaction processing system. Transactions generally represent any change in a database’s persistent state, such as the insertion, deletion, or updating of data. Database transactions enable multiple users to access and update the database through a transaction-oriented application.
Database transactions typically consist of groups of programming statements that are run in an atomic, all-or-nothing fashion. Specifically, an all-or-nothing fashion means that either all of the associated programming statements will be performed, or none of them will be performed. This ensures that, even in the event of system failure (crash, power interruption, etc.), the data will remain consistent in the database and users will not be able to view unfinished changes.
The concept of database transactions is usually implemented using the ACID (Atomic, Consistent, Isolated, and Durable) properties. The ACID properties ensure that database transactions are reliable and committed in a consistent and reliable manner, regardless of the circumstances.
Database transactions enable multiple users to reliably and securely update and access a database in a safe and reliable manner. Database transactions are a fundamental concept in database management systems, and as such, all databases must ensure that transactions are committed in a consistent and reliable manner.