Two chemistry labs, different philosophies.
ACID lab: Every experiment follows strict protocols. Reactions complete perfectly or not at all. Measurements are exact. Nothing proceeds until everything is verified.
BASE lab: Multiple experiments run simultaneously. Approximate measurements are acceptable. Results get refined over time.
Both produce valid science. The choice depends on what you’re measuring.
ACID Properties
Atomicity
Adding chemicals to a beaker is all-or-nothing:
- Add 10ml of Solution A
- Add 5ml of Solution B
- Add heat for 30 seconds
- Add 3ml of Solution C
If any step fails, the entire experiment reverses. The beaker returns to its original state. No partial reactions.
Consistency
Every experiment must obey lab rules:
Rule: “Total liquid in any beaker cannot exceed 100ml”
Starting with 85ml, trying to add 20ml: system checks (85 + 20 = 105ml), addition rejected, beaker remains at 85ml.
Rules are enforced, not suggested.
Isolation
When multiple students work simultaneously on the same beaker, they take turns. One completes before the next starts. No interference.
Like each experiment in its own universe.
Durability
Once an experiment completes, results are permanent. Written in permanent ink. Stored in fireproof safe. Building burns down, results survive.
This diagram requires JavaScript.
Enable JavaScript in your browser to use this feature.
BASE Properties
Basically Available
The lab stays operational even when things aren’t perfect. Equipment breaks, use alternatives. Out of Chemical A, substitute B. Results are approximate but available.
Soft State
Temporary inconsistency is acceptable:
Bench 1 shows reaction at pH 7 Bench 2 shows same reaction at pH 7.5
They’ll converge eventually. For now, both values coexist.
Eventual Consistency
Morning: Five groups measure the same compound Results: 98°C, 99°C, 97.5°C, 98.5°C, 99.5°C Afternoon: Groups compare notes Consensus: 98.5°C ± 0.5°C
Not instantly perfect, eventually accurate.
Choosing Between Them
ACID When
- Financial transactions (every cent matters)
- Healthcare records (patient data must be correct)
- Inventory (can’t sell what you don’t have)
- Reservations (no double-booking)
BASE When
- Social media feeds (a delayed like hurts no one)
- Analytics (approximate counts are fine)
- Caching (stale data beats no data)
- Search indexes (eventually indexed is acceptable)
The CAP Connection
Pick two of three: Consistency, Availability, Partition Tolerance.
Partitions happen in distributed systems. You choose between:
- CP (consistent but may be unavailable during partitions)
- AP (available but may be inconsistent during partitions)
ACID prioritizes consistency. BASE prioritizes availability.
Hybrid Approaches
Most systems mix both:
- User accounts: ACID (correctness matters)
- User preferences: BASE (staleness acceptable)
- Financial records: ACID
- Recommendation engine: BASE
Choose consistency per operation based on requirements.
Common Problems
Phantom Reads (ACID)
Despite isolation, odd things happen:
Student A counts 5 test tubes Student B adds 2 more tubes Student A counts again: 7 tubes
Even ACID cannot prevent all surprises when transactions interleave.
Lost Updates (BASE)
Without coordination, updates collide:
Lab tech A reads temperature as 20°C Lab tech B reads temperature as 20°C A sets to 25°C B sets to 22°C Final: 22°C (A’s update lost)
Last write wins, first write vanishes.
Split Brain
Network partition creates two realities:
Building loses connectivity North wing: “Experiment succeeded” South wing: “Experiment failed”
Partition tolerance has costs.
Decision Rules
Use ACID when:
- Correctness is non-negotiable
- Operations must be all-or-nothing
- You can accept lower availability
Use BASE when:
- Availability matters more than immediate consistency
- You can tolerate temporary staleness
- Scale requires relaxing consistency
Most systems need both. Know which parts need which guarantees.