{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreigot4cbat72vf5lmsmuf47bkqzapt3sumqyhcwv5skkmasx2k3zji",
    "uri": "at://did:plc:5sgu76a53rz3n6unbykmovqy/app.bsky.feed.post/3mlogb32d36h2"
  },
  "description": "The CAP theorem states that a distributed data store cannot simultaneously provide all three of: Consistency (every read returns the latest write), Availability (every request receives a response), and Partition tolerance (the system continues to operate despite network splits). Under a network partition, a system must give up either consistency or availability.\n\n\nWhat the three properties mean here\n\n * Consistency (C). Specifically linearizability: a global, real-time ordering of operations suc",
  "path": "/engineering-glossary/cap-theorem-consistency-availability-partition/",
  "publishedAt": "2026-05-12T18:29:55.000Z",
  "site": "https://sahilkapoor.com",
  "tags": [
    "Distributed Systems",
    "Consensus",
    "Eventual Consistency",
    "Microservices"
  ],
  "textContent": "**The CAP theorem** states that a distributed data store cannot simultaneously provide all three of: **Consistency** (every read returns the latest write), **Availability** (every request receives a response), and **Partition tolerance** (the system continues to operate despite network splits). Under a network partition, a system must give up either consistency or availability.\n\n## What the three properties mean here\n\n  * **Consistency (C).** Specifically linearizability: a global, real-time ordering of operations such that every read sees the most recent write.\n  * **Availability (A).** Every request to a non-failing node returns a non-error response, even if no replica is up to date.\n  * **Partition tolerance (P).** The system keeps functioning when network messages between nodes are dropped or delayed indefinitely.\n\n\n\n## The practical reading\n\nIn any real distributed system the network can partition, so partition tolerance is not optional. The real choice is between consistency and availability when a partition occurs. Systems are usually described as CP (sacrifice availability) or AP (sacrifice consistency) under partition:\n\n  * **CP systems:** Spanner, etcd, ZooKeeper, CockroachDB, HBase, MongoDB (with majority write concern). Reject requests rather than return stale data.\n  * **AP systems:** Cassandra, DynamoDB (default), Riak, CouchDB. Accept writes on either side of the partition and reconcile later.\n\n\n\n## Beyond CAP: PACELC\n\nPACELC extends CAP by also asking what the system does when there is no partition (Else, choose between Latency and Consistency). Most real systems make tradeoffs in both cases.\n\nšŸ”—\n\n**Related Terms**\nDistributed Systems, Consensus, Eventual Consistency, Microservices.",
  "title": "CAP Theorem",
  "updatedAt": "2026-05-13T19:14:50.807Z"
}