Atomic Commit

Data System Architecture

About

An Atomic commit is a commit that implements atomicity for a transaction.

Either all the tasks in a transaction must happen, or none of them. The transaction must be completed, or else it must be undone (rolled back).

A transaction groups task (such as SQL statements) so that they are either all committed, which means they are applied to the data, or all rolled back, which means they are undone from the data.

Atomicity (or atomicness) is one of the ACID transaction properties. In an atomic transaction, a series of operations either all occur, or nothing occurs.

It means that either all changes within a single transaction occur or none of them occur.

The transactions should be atomic even if the transaction is interrupted by an operating system crash or power failure.

Implementation

Atomic commit is implemented via a rollback journal

Hardware and Atomicity

Atomic commit cannot be implemented with the hardware disk because:

  • a transaction may write data in different sector (different place)
  • writing a single sector is serial and takes a finite amount of time
  • the action can't therefore be instantaneous

Therefore the application needs to creates the illusion of atomic commit (ie the transactions appear to be atomic)





Discover More
Data System Architecture
Data - (Transaction|Action) Atomicity

An atomic action is one that effectively happens all at once. An atomic action cannot stop in the middle: it either happens completely, or it doesn't happen at all. No side effects of an atomic action...
Data System Architecture
Transaction - Commit

A commit preserve the changes by creating a new version of the data. See also: Two-phase_commit_protocol A commit occurs by appending a special record into the WAL. A commit request that the changes...
Data System Architecture
Transactions - Rollback Journal (Undo journal)

A rollback journal consists of records of the actions of transactions, primarily before they are committed. Its name comes from the fact that its primary function is to roll back (undo) changes from...



Share this page:
Follow us:
Task Runner