CAP-Theorem-diagram.excalidraw

==⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠==

CAP Theorem — Triangle Diagram

Text Elements

C (Consistency) ^c-vertex A (Availability) ^a-vertex P (Partition Tolerance) ^p-vertex

CP ^cp-edge AP ^ap-edge CA ^ca-edge

HBase, MongoDB (strong), Zookeeper ^cp-systems Cassandra, DynamoDB, CouchDB ^ap-systems RDBMS (single-node) ^ca-systems Only without partitions ^ca-note

Pick two — but P is mandatory in distributed systems ^center-text Real systems tune the C-A dial per operation ^bottom-text

%%

Drawing

{
  "type": "excalidraw",
  "version": 2,
  "source": "https://excalidraw.com",
  "elements": [
    {
      "id": "c-vertex-box",
      "type": "rectangle",
      "x": 220,
      "y": 20,
      "width": 160,
      "height": 44,
      "strokeColor": "#1971c2",
      "backgroundColor": "#d0ebff",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "roughness": 1,
      "opacity": 100
    },
    {
      "id": "c-vertex-text",
      "type": "text",
      "x": 235,
      "y": 32,
      "width": 130,
      "height": 20,
      "text": "C (Consistency)",
      "fontSize": 14,
      "fontFamily": 1,
      "textAlign": "center",
      "verticalAlign": "middle",
      "strokeColor": "#1971c2",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "roughness": 1,
      "opacity": 100
    },
    {
      "id": "a-vertex-box",
      "type": "rectangle",
      "x": 60,
      "y": 300,
      "width": 160,
      "height": 44,
      "strokeColor": "#2f9e44",
      "backgroundColor": "#ebfbee",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "roughness": 1,
      "opacity": 100
    },
    {
      "id": "a-vertex-text",
      "type": "text",
      "x": 75,
      "y": 312,
      "width": 130,
      "height": 20,
      "text": "A (Availability)",
      "fontSize": 14,
      "fontFamily": 1,
      "textAlign": "center",
      "verticalAlign": "middle",
      "strokeColor": "#2f9e44",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "roughness": 1,
      "opacity": 100
    },
    {
      "id": "p-vertex-box",
      "type": "rectangle",
      "x": 380,
      "y": 300,
      "width": 160,
      "height": 44,
      "strokeColor": "#e67700",
      "backgroundColor": "#fff3bf",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "roughness": 1,
      "opacity": 100
    },
    {
      "id": "p-vertex-text",
      "type": "text",
      "x": 395,
      "y": 312,
      "width": 130,
      "height": 20,
      "text": "P (Partition Tol.)",
      "fontSize": 14,
      "fontFamily": 1,
      "textAlign": "center",
      "verticalAlign": "middle",
      "strokeColor": "#e67700",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "roughness": 1,
      "opacity": 100
    },
    {
      "id": "edge-ca",
      "type": "line",
      "x": 220,
      "y": 42,
      "width": -80,
      "height": 258,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "roughness": 1,
      "opacity": 100,
      "points": [[0, 0], [-80, 258]]
    },
    {
      "id": "edge-cp",
      "type": "line",
      "x": 380,
      "y": 42,
      "width": 80,
      "height": 258,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "roughness": 1,
      "opacity": 100,
      "points": [[0, 0], [80, 258]]
    },
    {
      "id": "edge-ap",
      "type": "line",
      "x": 220,
      "y": 322,
      "width": 160,
      "height": 0,
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "roughness": 1,
      "opacity": 100,
      "points": [[0, 0], [160, 0]]
    },
    {
      "id": "ca-edge-label",
      "type": "text",
      "x": 90,
      "y": 180,
      "width": 30,
      "height": 20,
      "text": "CA",
      "fontSize": 13,
      "fontFamily": 1,
      "textAlign": "center",
      "verticalAlign": "middle",
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "roughness": 1,
      "opacity": 100
    },
    {
      "id": "cp-edge-label",
      "type": "text",
      "x": 475,
      "y": 180,
      "width": 30,
      "height": 20,
      "text": "CP",
      "fontSize": 13,
      "fontFamily": 1,
      "textAlign": "center",
      "verticalAlign": "middle",
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "roughness": 1,
      "opacity": 100
    },
    {
      "id": "ap-edge-label",
      "type": "text",
      "x": 290,
      "y": 340,
      "width": 30,
      "height": 20,
      "text": "AP",
      "fontSize": 13,
      "fontFamily": 1,
      "textAlign": "center",
      "verticalAlign": "middle",
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "roughness": 1,
      "opacity": 100
    },
    {
      "id": "cp-systems-box",
      "type": "rectangle",
      "x": 520,
      "y": 80,
      "width": 200,
      "height": 52,
      "strokeColor": "#1971c2",
      "backgroundColor": "#d0ebff",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "roughness": 1,
      "opacity": 100
    },
    {
      "id": "cp-systems-text",
      "type": "text",
      "x": 525,
      "y": 88,
      "width": 190,
      "height": 36,
      "text": "HBase, MongoDB (strong),\nZookeeper",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "center",
      "verticalAlign": "middle",
      "strokeColor": "#1971c2",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "roughness": 1,
      "opacity": 100
    },
    {
      "id": "ap-systems-box",
      "type": "rectangle",
      "x": 60,
      "y": 380,
      "width": 200,
      "height": 44,
      "strokeColor": "#2f9e44",
      "backgroundColor": "#ebfbee",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "roughness": 1,
      "opacity": 100
    },
    {
      "id": "ap-systems-text",
      "type": "text",
      "x": 65,
      "y": 394,
      "width": 190,
      "height": 20,
      "text": "Cassandra, DynamoDB, CouchDB",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "center",
      "verticalAlign": "middle",
      "strokeColor": "#2f9e44",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "roughness": 1,
      "opacity": 100
    },
    {
      "id": "ca-systems-box",
      "type": "rectangle",
      "x": -100,
      "y": 160,
      "width": 160,
      "height": 52,
      "strokeColor": "#e67700",
      "backgroundColor": "#fff3bf",
      "fillStyle": "solid",
      "strokeWidth": 2,
      "roughness": 1,
      "opacity": 100
    },
    {
      "id": "ca-systems-text",
      "type": "text",
      "x": -95,
      "y": 168,
      "width": 150,
      "height": 36,
      "text": "RDBMS (single-node)\nOnly without partitions",
      "fontSize": 11,
      "fontFamily": 1,
      "textAlign": "center",
      "verticalAlign": "middle",
      "strokeColor": "#e67700",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "roughness": 1,
      "opacity": 100
    },
    {
      "id": "center-text",
      "type": "text",
      "x": 180,
      "y": 188,
      "width": 240,
      "height": 36,
      "text": "Pick two —\nbut P is mandatory in distributed systems",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "center",
      "verticalAlign": "middle",
      "strokeColor": "#5c5f66",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "roughness": 1,
      "opacity": 100
    },
    {
      "id": "bottom-text",
      "type": "text",
      "x": 80,
      "y": 450,
      "width": 440,
      "height": 20,
      "text": "Real systems tune the C-A dial per operation",
      "fontSize": 12,
      "fontFamily": 1,
      "textAlign": "center",
      "verticalAlign": "top",
      "strokeColor": "#1e1e1e",
      "backgroundColor": "transparent",
      "fillStyle": "solid",
      "strokeWidth": 1,
      "roughness": 1,
      "opacity": 100
    }
  ],
  "appState": {
    "gridSize": null,
    "viewBackgroundColor": "#ffffff"
  },
  "files": {}
}

%%