ACID
ACID (Atomicity, Consistency, Isolation, Durability) is a set of properties that guarantee database transactions are processed reliably even in the face of errors, power failures, or system crashes. These four properties ensure that data remains accurate and consistent, making ACID compliance a fundamental requirement for relational databases, distributed systems, and financial APIs.
APIs
PostgreSQL Transaction API
PostgreSQL provides full ACID compliance through its transaction management system including BEGIN, COMMIT, ROLLBACK, SAVEPOINT, and isolation level controls (READ COMMITTED, RE...
CockroachDB Distributed SQL API
CockroachDB is a distributed SQL database providing serializable ACID transactions across multiple nodes and regions. It uses the Raft consensus algorithm and supports the Postg...
Google Spanner API
Google Spanner is a globally distributed, externally consistent database providing ACID transactions at global scale using TrueTime clock synchronization (GPS receivers and atom...
Amazon Aurora Transactions API
Amazon Aurora provides ACID-compliant transactions for both MySQL-compatible and PostgreSQL-compatible editions. Aurora's distributed storage layer provides durability across 3 ...
Atomikos Transaction API
Atomikos provides ACID transaction management middleware for distributed microservices, supporting XA transactions across REST services using the Try-Confirm/Cancel (TCC) patter...
Features
Transactions are all-or-nothing: either all operations in a transaction succeed and are committed, or none are applied and the database is rolled back to its prior state.
A transaction brings the database from one valid, consistent state to another, enforcing all defined constraints, triggers, and cascades. No transaction can leave data in an invalid state.
Concurrent transactions execute as if they were serialized, preventing interference. Isolation levels (READ COMMITTED, REPEATABLE READ, SERIALIZABLE) control the degree of visibility between concurrent transactions.
Once a transaction is committed, it remains committed even in the event of system crashes, power failures, or other errors, typically achieved through write-ahead logging (WAL) and replication.
Modern distributed databases extend ACID guarantees across multiple nodes, regions, and data centers using consensus algorithms (Raft, Paxos) and synchronized clocks (TrueTime).
Design patterns for ACID-like guarantees in REST APIs include Two-Phase Commit (2PC), Try-Confirm/Cancel (TCC), and Saga patterns for managing distributed transactions across microservices.
Use Cases
Banking and payment systems require ACID compliance to ensure monetary transfers are atomic — debits and credits always balance — and durable across system failures.
E-commerce and supply chain systems use ACID transactions to prevent overselling by ensuring inventory decrements and order creation are atomic.
Microservices architectures use Saga and TCC patterns to achieve eventual consistency with compensating transactions when full ACID across services is not feasible.
Global applications use databases like Google Spanner and CockroachDB to maintain ACID consistency across geographic regions without sacrificing availability.
REST APIs use database transactions to implement idempotency keys, ensuring duplicate requests produce the same result without double processing.
Integrations
The most widely deployed open-source RDBMS with full ACID compliance via MVCC and configurable transaction isolation levels.
Popular open-source databases providing ACID compliance through the InnoDB storage engine with row-level locking and MVCC.
MongoDB added multi-document ACID transactions in version 4.0, extending its document model with ACID guarantees across documents and collections.
Kafka's transactional API (since 0.11) enables exactly-once semantics with atomic writes to multiple partitions, providing ACID-like guarantees for stream processing pipelines.
The Saga pattern decomposes long-running transactions into a series of local transactions with compensating actions for distributed consistency without 2PC overhead.