Database DesignACID vs BASEEasy⏱️ ~3 min

BASE Properties: Availability Through Eventual Consistency

Definition
BASE stands for Basically Available (system accepts requests during partial failures), Soft State (replicas may temporarily diverge), and Eventual Consistency (replicas converge over time through asynchronous replication). BASE trades immediate consistency for availability and low latency.

Performance Advantage

The performance win is dramatic. BASE systems deliver single-digit millisecond reads because they read from any local replica without waiting for coordination. Writes are local operations that replicate asynchronously. Background processes reconcile divergence: anti-entropy (comparing replicas to find differences) and hinted handoff (storing failed writes temporarily to replay when a replica recovers). A single partition sustains 1,000-3,000 operations per second before automatic splitting enables horizontal scale.

Application Complexity Cost

Without coordination, conflicts arise when multiple replicas accept concurrent writes. Last-writer-wins (LWW) uses timestamps to resolve conflicts, but clock skew between replicas can silently drop valid writes. Applications must design for idempotency (safely retrying operations), use conditional writes with version checks, or employ conflict-free data structures that merge automatically. Shopping cart merges, profile updates, and activity feeds can tolerate temporary inconsistencies, making BASE ideal for these workloads.

Blending Models

Most production systems blend ACID and BASE. Use ACID for the source of truth (orders, payments) and BASE for high-scale reads (catalogs, session data). Some databases offer tunable consistency, letting each request choose its point on the consistency-latency trade-off: strong consistency for critical reads, eventual for high-throughput browsing.

💡 Key Takeaways
BASE: Basically Available (accepts requests during failures), Soft State (replicas diverge), Eventual Consistency (converges over time)
BASE reads are single-digit ms because they read from any replica without coordination; ACID reads wait for quorum
Last-writer-wins (LWW) resolves conflicts by timestamp but clock skew can silently drop valid writes
Design for idempotency: operations must be safely retryable using unique operation IDs to detect duplicates
📌 Interview Tips
1Explain anti-entropy: background process compares replicas (often via hash trees), identifies differences, and synchronizes missing data
2When discussing LWW, mention clock skew risk: a write at real-time T+2 can be dropped if another replica has a skewed clock showing T+3
3For shopping cart example: concurrent adds from different devices merge as union of items, no coordination needed, conflicts resolve naturally
← Back to ACID vs BASE Overview
BASE Properties: Availability Through Eventual Consistency | ACID vs BASE - System Overflow