1. Explain the CAP Theorem and PACELC Theorem with real-world database examples.
ā Context: What are Consistency, Availability, and Partition Tolerance? How does PACELC expand CAP when no network partition exists?
The CAP Theorem states that a distributed system can only provide at most 2 out of 3 guarantees during a network partition:
PACELC Theorem:
Extends CAP:
Example: DynamoDB defaults to PA/EL (prioritizes availability during partitions, low latency normally).
PACELC Decision Matrix:
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā PACELC ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā If Network Partition ā Else (Normal) ā
āāāāāāāāāāāāāāā¬āāāāāāāāāāāāāā¼āāāāāāāāāāāāāāā¬āāāāāāāāāāāāāā¤
ā Availabilityā Consistency ā Low Latency ā Consistency ā
ā (AP) ā (CP) ā (EL) ā (EC) ā
āāāāāāāāāāāāāāā“āāāāāāāāāāāāāā“āāāāāāāāāāāāāāā“āāāāāāāāāāāāāāSystem design requires balancing consistency against availability and network latency depending on business SLAs.