ZZomato·Tech KnowledgeL2DSA Round

CAP Theorem and Its Applicability to SQL Databases

Problem Explain the CAP theorem, and discuss whether it applies to traditional SQL (relational) databases.

Be ready to discuss

  • The three properties: Consistency (every read sees the latest committed write), Availability (every non-failing node returns a response), Partition tolerance (the system keeps operating despite dropped/delayed messages between nodes).
  • Why it is really a choice of two: partitions are a fact of networks, not an option — so under partition the real decision is CP (refuse or block requests to stay correct) versus AP (answer from possibly stale replicas).
  • Applicability to SQL: a single-node relational database is not distributed in the CAP sense — but replicate or shard it and the same C-vs-A trade-off appears, so CAP is about topology, not about SQL versus NoSQL.
  • Concrete example: a Postgres primary with synchronous replicas blocks writes when a replica is unreachable (CP); switch to async replication and you keep serving but reads can be stale (AP).
  • The C in CAP versus the C in ACID: linearizability across nodes versus intra-transaction invariant preservation — two different claims that share a letter.
  • Beyond CAP: PACELC's observation that even with no partition you still trade latency against consistency, which is the trade-off systems actually make most days.
asked …
LeaderboardSalaryAccount