Course contentsShow
← System Design
Lesson 493 of 1,91914. CAP TheoremFree lesson

CP Systems: Prioritizing Consistency

Understanding systems that choose consistency over availability during network partitions and their core guarantees.

CP Systems: Prioritizing Consistency

What you'll learn: How CP systems sacrifice availability during network partitions to maintain data consistency guarantees.

The Core Idea

In CAP terminology, CP systems choose Consistency and Partition tolerance over availability. When a network partition occurs, these systems refuse to serve requests that could lead to inconsistent data—they would rather return errors or become unavailable than risk showing stale or conflicting information.

Think of it like a bank vault with multiple entrances: if communication between the doors breaks down, the vault locks all entrances until the connection is restored. Better to deny access temporarily than allow two people to withdraw the same money twice.

What CP Systems Guarantee

When you interact with a CP system:

  • Linearizability or strong consistency: Every read reflects the most recent write across all nodes
  • No stale data: You'll never see outdated information, even during failures
  • Coordination required: Nodes must agree before responding, which takes time

During a partition, minority nodes (those cut off from the majority) will reject requests entirely. Only the partition containing the majority quorum can continue operating.

Real-World Examples

Classic CP systems include:

  • Traditional relational databases with synchronous replication (like PostgreSQL with synchronous standby)
  • Distributed coordination services like ZooKeeper and etcd
  • HBase when configured with strong consistency settings

These systems are ideal when correctness is non-negotiable: financial transactions, inventory management, or configuration storage where stale data could cause catastrophic errors.

Key Takeaway: CP systems guarantee that all clients see consistent data by refusing to serve requests during partitions, trading availability for correctness when it matters most.