CAP theorem
The CAP theorem is a distributed-systems impossibility result stating that consistency, availability, and partition tolerance cannot all be guaranteed during a network partition.
Unit Testing Principles, Practices, and Patterns
The CAP theorem states that a distributed data store cannot simultaneously guarantee consistency, availability, and partition tolerance under network partitioning.
- How it is used
- Frames trade-offs among unit-test attributes by analogy with distributed data-store guarantees.
- How deep it goes
- Defines all three guarantees and explains the two-out-of-three trade-off, but does not develop distributed-system implementation details.
- Examples
- Uses large-scale websites and product catalogs to illustrate why partition tolerance is required and availability can outweigh consistency.
- What you can do after
- Evaluate consistency-versus-availability choices in systems that must tolerate network partitions.
Read how Unit Testing Principles, Practices, and Patterns explains CAP theorem →
PostgreSQL Mistakes and How to Avoid Them
The CAP theorem states that a distributed data system cannot simultaneously guarantee strong consistency, availability, and partition tolerance under network partition.
- How it is used
- Frames multi-master replication as a tradeoff problem before treating bidirectional logical replication as a production architecture.
- How deep it goes
- Defines all three CAP guarantees, extends them with PACELC, and illustrates failures through replication conflicts rather than formal proof.
- Examples
- Uses two-way PostgreSQL logical replication with identity-key collisions and a renamed replicated column that stops a replication worker.
- What you can do after
- Evaluate/understand why multi-master designs require explicit tradeoffs and established conflict-aware solutions.
Read how PostgreSQL Mistakes and How to Avoid Them explains CAP theorem →
ScyllaDB in Action
The CAP theorem states that a distributed data system cannot simultaneously guarantee consistency, availability, and partition tolerance under network partition conditions.
- How it is used
- Guides distributed-database choices by exposing the availability and consistency consequences of network partitions.
- How deep it goes
- Defines the three properties, explains partition trade-offs, and connects them to replica consistency levels and database behavior.
- Examples
- Uses ScyllaDB and MongoDB classifications plus ALL, QUORUM, and ONE in a three-replica cluster.
- What you can do after
- Evaluate database behavior during partitions and select consistency levels according to correctness, availability, and failure-tolerance needs.
Think Distributed Systems
The CAP theorem is a formal impossibility result stating that, under its specified asynchronous system model, a distributed system cannot guarantee consistency and availability during a network partition.
- How it is used
- Frames replicated distributed-system design as a consistency-versus-availability decision during network partitions.
- How deep it goes
- Defines safety, liveness, and partitions, then demonstrates impossibility with an asynchronous three-node proof-by-contradiction model.
- Examples
- Uses a permanent N1–N2 partition, a write of v1, and a stale read of v0 to expose the contradiction.
- What you can do after
- Evaluate distributed-system guarantees and identify the consistency or availability compromise required during partitions.
Related concepts
- uptimeuses · Uptime is the duration or proportion of a specified period during which a system or service is operational and available to provide its intended function.
- partition toleranceuses · Partition tolerance is the ability of a distributed system to continue operating despite communication failures between parts of the system.
- consistencyhas part · Consistency is the property of related data, behavior, outputs, or states agreeing with one another or conforming to defined rules across relevant instances or operations.
- PACELC theoremcontrasts with · The PACELC theorem describes distributed-system tradeoffs: consistency versus availability during a network partition, and consistency versus latency when no partition occurs.
- distributed systemuses · A distributed system is a computing system whose components run across multiple networked processes or machines and coordinate through communication.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



