Key Concepts

What are Distributed ACID Transactions?

Build business-critical applications with high data integrity across multiple cloud regions and zones

Distributed ACID transactions are transactions that modify multiple rows in more than one shard. A transaction symbolizes a unit of work performed within a database. It is often composed of multiple operations. 

A distributed ACID transaction has four key properties, as defined by its name:

  • Atomicity — All work in a transaction is treated as a single atomic unit — it performs all of it or nothing.
  • Consistency — The database is always in a consistent, internal state. 
  • Isolation — Determines how and when changes made by one transaction become visible to others. 
  • Durability — Ensures all transaction results permanently remain in the system. Any modifications must persist even in case of power loss or system failures.

Why ACID Transactions?

ACID transactions are a fundamental building block when developing business-critical, user-facing applications. They simplify the complex task of ensuring data integrity while supporting highly concurrent operations.

More specifically, the benefits of using distributed ACID transactions breaks down as follows:

  • Absolute data integrity and safety—Avoid lost updates, dirty reads, stale reads, and enforce application-specific integrity constraints.
  • Simplified concurrency control—Developers can treat transactions as if they were executed sequentially, even when they’re executed concurrently. 
  • Intuitive data access logic—By allowing complex schema modeling and native support for multi-step data manipulation operations, the application code represents business logic more directly.
  • Future-proofing database needs—Durability is rarely up for debate in databases where stable persistence is a must-have. Enhance applications quickly without making any trade-offs.

Three Varieties of ACID Transactions

In the context of distributed databases, ACID transactions can be classified into the following three varieties.

1. Single-Row ACID Transactions

Three varieties of distributed ACID transactions - single-row ACID transactions.

Single-row ACID transactions are transactions where all the operations impact only a single row (i.e., a key). These transactions are easier to achieve since the data for a single row doesn’t cross the boundary of a single node in most distributed databases.

2. Single-Shard ACID Transactions

Three varieties of distributed ACID transactions - single-shard ACID transactions.

Single-shard ACID transactions are transactions where all rows involved in the operations of a transaction exist in a single shard of a distributed database. Since a single shard is always located inside a single node, there are no coordinating transaction operations across multiple nodes.

3. Distributed ACID Transactions

Three varieties of distributed ACID transactions - distributed ACID transaction.

In auto-sharded distributed databases, shards spread across multiple nodes by design on cluster creation. A distributed ACID transaction is a transaction that impacts a set of rows distributed across shards on multiple nodes.

Ensure Data Integrity and High Performance at Scale

A large percentage of application workloads require high performance with single-row ACID guarantees. However, a growing percentage of workloads also need distributed ACID transactions with extreme data integrity. 

YugabyteDB strikes the right balance in addressing both scenarios. Learn more about this powerful, open source database today through our free, self-paced courses: Introduction to Distributed SQL and Introduction to YugabyteDB. And join the YugabyteDB community to answer any and all of your distributed ACID transaction questions.