ACID vs BASE
What a transaction promises, how databases keep that promise (isolation levels, MVCC, locks, the write-ahead log), and how to stay correct when one transaction is not enough.
Overview
A transaction is a group of reads and writes that the database treats as one unit. ACID names four promises a transaction can make: atomicity, consistency, isolation and durability. Theo Härder and Andreas Reuter coined the term in 1983. These promises let application code pretend that each change happens all at once, alone, and forever.
BASE stands for basically available, soft state, eventually consistent. Dan Pritchett of eBay described it in 2008 as a way to scale partitioned databases: give up the idea that every change is complete and visible at the end of one operation, and instead let related changes finish in the background, in steps that are safe to repeat.
The two are not rival products. They are two ways of reaching correctness. ACID puts the work in the database; BASE puts it in the application design. Most real systems use both: a transaction inside each database, and eventual consistency between databases and services.
What you will be able to do
- Say what each ACID letter guarantees, and what it does not.
- Pick an isolation level and name the anomalies it allows.
- Explain MVCC, snapshot isolation and write skew with a small example.
- Choose between locking, version checks and serializable retries.
- Keep a multi-service flow correct with a saga or an outbox instead of two-phase commit.
Key concepts
- Atomicity
- Isolation levels
- MVCC and snapshots
- Write skew
- Optimistic and pessimistic locking
- Write-ahead log
- Two-phase commit
- Sagas
- Eventual consistency
Interview questions
- What do the four ACID properties guarantee, and which one is most misunderstood?
- Explain the isolation levels and the anomalies each allows.
- How does MVCC let readers and writers run without blocking each other?
- What is write skew, and how do you prevent it?
- When would you use optimistic locking instead of pessimistic locking?
- What is two-phase commit, and why do microservices avoid it?
- Design the checkout flow across order, payment and inventory services.
- How does a database make commits durable, and when can a commit still be lost?
- How do you decide between ACID and BASE in one system?
Sign up free to read the full topic
More System Design topics
- A/B Testing Platform Design
- Active-Active vs Active-Passive
- Ad Click Event Aggregation
- AI Agriculture Advisory System
- AI Airline Booking Chatbot
- AI Analytics Dashboard
- AI Anomaly Detection System
- AI Art Generation System
- AI Banking Chatbot
- AI Bot and Scalper Detection System
- AI Click Fraud Detection System
- AI Cold Start Recommendation System
Start free on Cariara · Coding problems · System design studio