The Foundation of Distributed Data Engineering
When designing distributed data systems at scale, engineers quickly discover that there is no single “best database.” The architectural decisions governing how databases store, replicate, and coordinate data across network partitions are governed by fundamental laws of computer science: the CAP Theorem, PACELC, and ACID transactional guarantees.
Choosing between CockroachDB, Cassandra, PostgreSQL, and DynamoDB requires understanding the mathematical tradeoffs between consistency, latency, availability, and partition tolerance.
In this system design guide, we deconstruct database consistency models, dissect transactional isolation levels, and establish an architectural taxonomy for choosing databases in production.
ACID vs. BASE: The Philosophical Divide
| Metric | ACID (Traditional Relational) | BASE (Distributed NoSQL) |
|---|---|---|
| Stands For | Atomicity, Consistency, Isolation, Durability | Basically Available, Soft state, Eventual consistency |
| Core Philosophy | Data correctness and consistency above all else | High availability and horizontal partition scale |
| Consistency Model | Linearizable / Strict Serializability | Eventual consistency (Read-your-writes, Monotonic) |
| Representative Databases | PostgreSQL, MySQL (InnoDB), Oracle | Apache Cassandra, Amazon DynamoDB, ScyllaDB |
The CAP Theorem & The PACELC Refinement
Eric Brewer’s CAP Theorem states that in any asynchronous distributed network, a database can guarantee at most two of the following three properties: Consistency (C), Availability (A), and Partition Tolerance (P).
Because physical network cables can be severed, switches fail, and packets drop, Partition Tolerance (P) is mandatory in distributed systems. Therefore, the true real-world choice is between **CP** and **AP**:
- CP Systems (Consistency + Partition Tolerance): When a network split occurs, nodes reject writes rather than serve inconsistent data (e.g. HBase, MongoDB with
w:majority, Raft/Paxos clusters). - AP Systems (Availability + Partition Tolerance): When a network split occurs, all nodes accept reads and writes, reconciling discrepancies later via vector clocks or last-write-wins (e.g. Cassandra, DynamoDB).
The PACELC Theorem
Daniel Abadi extended CAP to model normal non-partitioned operation: If Partition (P) choose between Availability (A) and Consistency (C); Else (E) choose between Latency (L) and Consistency (C).
PACELC Database Taxonomy:
- PC/EC (e.g. Spanner, CockroachDB): Consistency during partition, Consistency in normal state.
- PA/EL (e.g. Cassandra, DynamoDB): Availability during partition, Low Latency in normal state.Frequently Asked Questions (FAQ)
What is the difference between Read Committed and Serializable isolation?
Read Committed guarantees you never read dirty uncommitted data from other transactions, but successive reads within the same transaction can return different values (Non-repeatable read). Serializable is the highest isolation level: it guarantees that transactions execute as if they ran in strict sequential order, eliminating phantom reads and write skew anomalies.
Related Architectural Deep Dives
Continue expanding your technical depth with our related engineering guides:
- MySQL vs PostgreSQL Architecture Guide: InnoDB vs Postgres MVCC, JSONB vs JSON, and replication topologies. Explore the complete guide: MySQL vs PostgreSQL Architecture Guide.
- MySQL Query Optimization Masterclass: Diagnosing slow queries with EXPLAIN ANALYZE, B-Trees, and slow query logs. Explore the complete guide: MySQL Query Optimization Masterclass.
Published by Mohit Kumar under Database Engineering. Read our sharding blueprint on MongoDB Sharding & Replication Architecture.




