On this page
CAP, PACELC & Consistency Models
Prev: NoSQL Data Models | Up: nosql | Next: NoSQL Schema Design Patterns
Rel: Transactions, ACID & Isolation Levels, Scaling, Partitioning & Sharding
Ref: MongoDB — Read Isolation, Consistency, and Recency
Tags: #public #databases #nosql #distributed-systems
Contents
CAP & PACELC Theorems
- CAP: During a network Partition (P), a distributed store must choose between Consistency (C) (rejecting writes/reads that might be stale) or Availability (A) (serving potentially stale data).
- PACELC extends CAP to normal operation: if there is a Partition, trade A vs. C; Else (no partition), trade Latency vs. Consistency.
Quorum Math (R + W > N)
In a replicated cluster with $N$ replicas, write quorum $W$, and read quorum $R$:
- Setting $R + W > N$ guarantees that every quorum read overlaps at least one node containing the latest write (e.g., $N=3, W=2, R=2$).
Consistency Spectrum
- Linearizable (Strong): Reads always return the most recent acknowledged write.
- Read-Your-Own-Writes: A client immediately sees its own updates (even if other clients lag briefly).
- Eventual Consistency (BASE): Replicas converge over time once writes stop.
Linked from
Related notes
- tuts/databases/nosql Linked here; links to this page; shared tags: #databases, #nosql
- tuts/databases/nosql/nosql_data_models Linked here; links to this page; shared tags: #databases, #nosql
- tuts/databases/nosql/nosql_schema_design_patterns Linked here; links to this page; shared tags: #databases, #nosql
- tuts/databases/design_patterns/scaling_partitioning_and_sharding Linked here; links to this page; shared tags: #databases
- tuts/databases/mongodb/indexes_replica_sets_and_transactions links to this page; shared tags: #databases, #nosql
- tuts/databases/design_patterns/transactions_acid_and_isolation Linked here; shared tags: #databases
- tuts/databases/mongodb shared tags: #databases, #nosql
- tuts/databases/mongodb/bson_documents_and_schema_design shared tags: #databases, #nosql
- tuts/databases/mongodb/crud_and_aggregation_pipeline shared tags: #databases, #nosql
- tuts/databases shared tags: #databases