BASE — Explained with Examples
BASE (Basically Available, Soft State, Eventually Consistent) is a distributed data model prioritizing availability over the strong consistency of ACID.
BASE stands for Basically Available, Soft state, Eventually consistent. It was coined by Dan Pritchett and describes the design philosophy of distributed systems (NoSQL databases, eventually consistent stores) as an alternative to ACID.
The Three Properties
Basically Available — The system guarantees availability (responds to every request), even if some nodes are down. You’ll always get a response, but it may not contain the latest data.
Soft State — The system’s state can change over time without input, as nodes converge toward consistency.
Eventually Consistent — Given enough time without updates, all replicas will converge to the same value. There is no guarantee of immediate consistency.
Why BASE Matters
In distributed systems, achieving strong consistency requires coordination that slows down responses and reduces availability. BASE accepts temporary inconsistency so the system can remain responsive and available under network partitions.
Real-World Analogy
DNS updates: when you change your website’s IP address, it takes hours to propagate globally. For a few hours, some users see the old IP (inconsistent), but eventually everyone gets the new one (consistent). The DNS system is Basically Available (always resolves), Soft state (records change as they propagate), and Eventually consistent (converges within TTL).
Example: Eventual Consistency
import time
from datetime import datetime
class DistributedStore:
def __init__(self):
self._data = {}
self._replicas = []
def write(self, key, value):
self._data[key] = value
# Replicate asynchronously — eventual consistency
for replica in self._replicas:
replica.sync_async(key, value)
def read(self, key):
# May return stale data if replication hasn't completed
return self._data.get(key)
# Scenario: write then immediately read
store = DistributedStore()
store.write("user:1:name", "Alice")
print(store.read("user:1:name")) # Alice (if local, strong)
# A replica might still show the old value for a brief windowRelated Terms
ACID, CAP Theorem, Replication, Eventual Consistency
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro