1What does the 'I' in ACID stand for, and what does it guarantee?
ACID and BASE represent two contrasting philosophies for data consistency in databases. ACID guarantees strict transactional correctness; BASE accepts eventual consistency for higher availability and scalability. Understanding both is essential for choosing the right database model.
ACID and BASE are two contrasting models for how databases handle data consistency and transactional guarantees. ACID -- Atomicity, Consistency, Isolation, Durability -- has been the gold standard for relational databases since Jim Gray formalized transaction processing in the 1970s. Atomicity ensures that a transaction either completes entirely or has no effect. Consistency ensures that transactions move the database from one valid state to another, maintaining all defined constraints and invariants. Isolation ensures that concurrent transactions do not interfere with each other, as if they executed serially. Durability ensures that once a transaction commits, the data survives even hardware failures.
BASE -- Basically Available, Soft state, Eventually consistent -- emerged as an alternative philosophy driven by the needs of internet-scale systems in the early 2000s. When companies like Amazon, Google, and Facebook needed to serve millions of concurrent users across globally distributed infrastructure, strict ACID guarantees became a bottleneck. Synchronous replication for consistency added unacceptable latency. Distributed transactions across shards (two-phase commit) were fragile and slow. BASE accepts that data may be temporarily inconsistent across nodes (soft state) and that the system will converge to a consistent state given enough time (eventual consistency), in exchange for higher availability and lower latency. Basically Available means the system guarantees a response to every request, even if the data is not yet consistent.
The industry narrative has evolved beyond a simple ACID-vs-BASE dichotomy. In the early NoSQL era (2008-2015), the prevailing wisdom was that you must sacrifice ACID to achieve distributed scale. Systems like Cassandra, DynamoDB, and MongoDB (in early versions) embraced BASE as a deliberate design choice. However, the NewSQL movement (starting around 2012) demonstrated that ACID guarantees could be maintained at distributed scale using consensus protocols like Raft and Paxos. CockroachDB provides serializable isolation across distributed nodes using Raft. Google Spanner provides external consistency (stronger than serializable) across global data centers using TrueTime. These systems pay a latency cost for strong guarantees but prove that ACID and distribution are not mutually exclusive.
Choosing between ACID and BASE depends on the specific consistency requirements of each data type in your system. Financial transactions, inventory management, and user account operations typically require ACID because incorrect intermediate states have real business consequences -- double-charging a credit card, overselling inventory, or losing an account update. Social media feeds, product recommendations, analytics dashboards, and session data can tolerate BASE because briefly stale data has minimal business impact and the performance benefits are substantial. Many production systems use both: an ACID relational database for core transactional data and a BASE NoSQL store for high-throughput, eventually-consistent workloads.
The Bank Transfer Analogy
Consider transferring $100 from Account A to Account B. With ACID, the database guarantees that both the debit from A and the credit to B happen as one atomic unit -- if the system crashes after the debit but before the credit, the entire transaction is rolled back and no money is lost. With BASE, the debit and credit might happen at slightly different times on different nodes. For a brief moment, the $100 might appear to vanish (debited from A but not yet credited to B) or be duplicated (credited to B before being debited from A). The system will eventually converge to the correct state, but the intermediate inconsistency makes BASE unsuitable for financial operations where every cent must be accounted for at every moment.
PostgreSQL
PostgreSQL is a fully ACID-compliant relational database, providing serializable isolation via Serializable Snapshot Isolation (SSI). It uses Write-Ahead Logging (WAL) for durability, MVCC for concurrent transaction isolation, and constraint enforcement for consistency. PostgreSQL is the default choice for workloads that require transactional correctness -- financial systems, e-commerce orders, and user account management.
Apache Cassandra
Cassandra is a BASE system designed for write-heavy, globally distributed workloads. It uses tunable consistency (ONE, QUORUM, ALL) to let developers choose their position on the consistency-availability spectrum per query. By default, Cassandra provides eventual consistency with last-writer-wins conflict resolution. It sacrifices ACID properties like isolation and atomicity across partitions in exchange for linear write scalability and multi-datacenter availability.
CockroachDB
CockroachDB is a NewSQL database that provides full ACID guarantees -- including serializable isolation -- across a distributed, horizontally-sharded architecture. It uses the Raft consensus protocol to replicate data across nodes, ensuring that committed transactions survive node failures. CockroachDB demonstrates that ACID at distributed scale is achievable, though with higher per-transaction latency (typically 10-50ms for cross-range writes) compared to single-node PostgreSQL.
| Aspect | Description |
|---|---|
| Correctness vs Performance | ACID guarantees strict correctness but imposes performance overhead: locking for isolation, synchronous writes for durability, and constraint checking for consistency. BASE trades correctness during a convergence window for significantly higher throughput and lower latency, which can be a 10-100x difference for write-heavy workloads. |
| Scalability Ceiling | Traditional ACID databases on a single node have a vertical scaling ceiling. Distributed ACID (NewSQL) removes this ceiling but adds per-transaction latency for consensus. BASE systems scale horizontally with minimal coordination overhead, making them the natural choice for write-heavy workloads exceeding millions of operations per second. |
| Developer Complexity | ACID simplifies application code because the database handles rollbacks, isolation, and constraint enforcement. BASE pushes complexity to the application layer: developers must handle eventual consistency, idempotency, conflict resolution, and compensating transactions. The reduced database complexity comes at the cost of increased application complexity. |
| Failure Recovery | ACID databases recover cleanly from crashes by replaying the write-ahead log, guaranteeing that committed transactions survive and uncommitted ones are rolled back. BASE systems must run anti-entropy processes (read repair, merkle trees, hinted handoff) to detect and resolve inconsistencies after failures, which adds operational complexity. |
Uber's Migration from PostgreSQL to Schemaless (and Back)
Scenario
Uber initially ran on PostgreSQL for its core trip and driver data. As ride volume grew to millions of trips per day across hundreds of cities, the single PostgreSQL instance became a bottleneck. Write-amplification from PostgreSQL's MVCC implementation and the complexity of sharding a fully ACID database led to performance degradation and operational challenges.
Solution
Uber built Schemaless, a custom BASE datastore on top of MySQL that provided eventual consistency and horizontal write scalability. Trip data was sharded by city and time range. Schemaless sacrificed joins, foreign keys, and multi-row transactions (ACID properties) in exchange for append-only writes and linear scalability. For operations requiring consistency (payment settlement), Uber used a separate ACID-compliant system with idempotency keys and compensating transactions.
Outcome
Schemaless scaled to handle billions of rows and millions of writes per second across Uber's global infrastructure. The hybrid approach -- BASE for high-volume trip data, ACID for financial operations -- allowed Uber to apply each model where it was most appropriate. However, the complexity of managing eventual consistency in application code was significant, and Uber has since explored CockroachDB (ACID at scale) for workloads where strong consistency simplifies application logic.
See ACID vs BASE in action
Explore system design templates that use acid vs base and run traffic simulations to see how these concepts perform under real load.
Browse Templates1What does the 'I' in ACID stand for, and what does it guarantee?
2Why did large internet companies adopt BASE over ACID for many workloads?
3Which statement about NewSQL databases is correct?