ACID
ACID is an acronym describing four properties — Atomicity, Consistency, Isolation, and Durability — that guarantee database transactions are processed reliably.
Overview
ACID is shorthand for four guarantees that a transactional database makes about how it processes work. Together they ensure that transactions behave predictably even in the presence of concurrent access, crashes, or hardware failures.
The Four Properties
- Atomicity — a transaction's operations either all succeed or none do; there's no partial commit.
- Consistency — a transaction moves the database from one valid state to another, respecting constraints, types, and referential integrity rules.
- Isolation — concurrent transactions don't see each other's uncommitted changes; the effective isolation level determines exactly what anomalies are prevented.
- Durability — once a transaction commits, its changes survive crashes and power loss, typically because they were written to a write-ahead log before the commit was acknowledged.
Why ACID Matters
ACID guarantees are what make it safe to build applications on top of a shared database without reasoning about every possible interleaving of concurrent operations. Without them, a crash mid-write or two simultaneous updates could silently corrupt or lose data.
ACID in DuckDB
DuckDB is a fully ACID-compliant database. It implements a variant of MVCC inspired by the HyPer research system, tailored for hybrid analytical workloads: updates are applied in place and prior versions are kept in an undo buffer so concurrent readers and writers don't block each other. Durability is provided by a write-ahead log that records changes before they're applied to the main database file, and CHECKPOINT periodically merges the WAL into the database file. Because DuckDB uses optimistic concurrency control, isolation is enforced by aborting a transaction with a conflict error if it tries to commit changes that overlap with another transaction's writes, rather than by blocking with locks.
Related terms
An isolation level defines how much one transaction's in-progress changes are visible to other concurrently running transactions, trading off consistency against concurrency.
Transactions →A database transaction is a sequence of one or more operations that are executed as a single logical unit of work, either fully applied or fully rolled back.
Concurrency control →Concurrency control is the set of techniques a database uses to let multiple transactions execute at the same time without violating data consistency or isolation guarantees.
Write-ahead log (WAL) →A write-ahead log (WAL) is a durability mechanism where every change is recorded in an append-only log before it's applied to the main data files, enabling crash recovery.
Delta Lake →Delta Lake is an open table format, originally developed by Databricks, that adds ACID transactions, schema enforcement, and time travel to Parquet data stored in a data lake.
OLTP →OLTP (Online Transaction Processing) refers to systems designed for fast, high-concurrency, small read/write transactions — like inserting an order or updating an account balance — typically backed by normalized relational schemas.
FAQS
Yes. DuckDB provides atomicity, consistency, isolation, and durability through MVCC, an undo buffer for in-flight transactions, and a write-ahead log for crash recovery.
ACID prioritizes strong consistency and isolation, common in relational databases. BASE (Basically Available, Soft state, Eventually consistent) trades strict consistency for availability and scale, common in some distributed NoSQL systems.
