Atomicity (database systems)

Atomicity (database systems)

In database systems, atomicity (or atomicness) is one of the ACID transaction properties. In an atomic transaction, a series of database operations either "all" occur, or "nothing" occurs. A guarantee of atomicity prevents updates to the database occurring only partially, which can cause greater problems than rejecting the whole series outright.

The etymology of the phrase originates in the Classical Greek concept of a fundamental and indivisible component; see atom.

One example of atomicity comes from ordering airline-tickets. Potential passengers must either:
# both pay for and reserve seats on a flight; OR
# neither pay for nor reserve seatsThe booking-system does not treat it as acceptable for customers to pay for tickets without securing their requested flight or to reserve tickets without payment succeeding.

Orthogonality

Atomicity does not behave completely orthogonally with regard to the other ACID properties of the transactions. For example, isolation relies on atomicity to roll back changes in the event of isolation failures such as deadlock; consistency also relies on rollback in the event of a consistency-violation by an illegal transaction. Finally, atomicity itself relies on durability to ensure the atomicity of transactions even in the face of external failures.

As a result of this, failure to detect errors and manually roll back the enclosing transaction may cause failures of isolation and consistency.

Implementation

Typically, systems implement atomicity by providing some mechanism to indicate which transactions have started and which finished; or by keeping a copy of the data before any changes occurred. Several filesystems have developed methods for avoiding the need to keep multiple copies of data, using journaling (see journaling file system). Many databases also support a commit-rollback mechanism aiding in the implementation of atomic transactions. Databases usually implement this using some form of logging/journaling to track changes. The system synchronizes the logs (often the metadata) as necessary once the actual changes have successfully taken place. Afterwards, crash recovery simply ignores incomplete entries. Although implementations vary depending on factors such as concurrency issues, the principle of atomicity — i.e. complete success or complete failure — remain.

Ultimately, any application-level implementation relies on operating-system functionality, which in turn makes use of specialized hardware to guarantee that an operation remains non-interruptible: either by software attempting to re-divert system resources (see pre-emptive multitasking) or by resource-unavailability (such as power-outages). For example, POSIX-compliant systems provide the open(2) system call which allows applications to atomically open a file. Other popular system-calls that may assist in achieving atomic operations from userspace include mkdir(2), flock(2), fcntl(2), rasctl(2) (NetBSD re-startable sequences), semop(2), sem_wait(2), sem_post(2), fdatasync(2), fsync(2) and rename(2).

The hardware level requires atomic operations such as test-and-set (TAS), and/or atomic increment/decrement operations. In their absence, or when necessary, raising the interrupt level to disable all possible interrupts (of hardware and software origin) may serve to implement the atomic synchronization function primitives. Systems often implement these low-level operations in machine language or in assembly language.

See also

* Atomic operation
* Transaction processing


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Isolation (database systems) — In database systems, isolation is a property that defines how/when the changes made by one operation become visible to other concurrent operations. Isolation is one of the ACID (Atomicity, Consistency, Isolation, Durability) properties.Isolation… …   Wikipedia

  • Consistency (database systems) — In database systems, a consistent transaction is one that does not violate any integrity constraints during its execution. If a transaction leaves the database in an illegal state, it is aborted and an error is reported.Consistency is one of the… …   Wikipedia

  • Durability (database systems) — In database systems, durability is the ACID property which guarantees that transactions that have committed will survive permanently. For example, if a flight booking reports that a seat has successfully been booked, then the seat will remain… …   Wikipedia

  • Atomicity — (database systems) is a property of database transactions which are guaranteed to either completely occur, or have no effects.In chemistry, atomicity is a synonym for valence.Atomicity may also refer to: * Linearizability, in computer science,… …   Wikipedia

  • Database — A database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality (for example, the availability of rooms in hotels), in a way that supports… …   Wikipedia

  • In-memory database — An in memory database (IMDB; also main memory database system or MMDB) is a database management system that primarily relies on main memory for computer data storage. It is contrasted with database management systems which employ a disk storage… …   Wikipedia

  • Microsoft Jet Database Engine — This article is about JET Red used in Microsoft Access. For the JET Blue ISAM implementation, see Extensible Storage Engine. The Microsoft Jet Database Engine is a database engine on which several Microsoft products have been built. A database… …   Wikipedia

  • Distributed database — A distributed database is a database in which storage devices are not all attached to a common CPU. It may be stored in multiple computers located in the same physical location, or may be dispersed over a network of interconnected computers.… …   Wikipedia

  • Enterprise database management — system requires enterprises to evaluate their data Management strategies and enable them to manage relentless data growth and regulatory compliances which are a crucial foundation for the unwired enterprise.The goal of enterprise database is to… …   Wikipedia

  • ACID — For other uses, see Acid (disambiguation). In computer science, ACID (atomicity, consistency, isolation, durability) is a set of properties that guarantee database transactions are processed reliably. In the context of databases, a single logical …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”