EASYDistributed Systemssenior engineer
CAP Theorem Explained
Explain the CAP theorem and its implications for distributed system design.
Estimated Time: 45 minutes
#distributed-systems#theory#databases
Solution Overview
CAP states you can only guarantee 2 of 3: Consistency, Availability, Partition tolerance. Since partitions are inevitable, choose between CP or AP.
Hints to Get Started
1
Network partitions are unavoidable in distributed systems
2
Consider what your application can tolerate
Components
consistency
All nodes see the same data at the same time
availability
Every request receives a response
partition tolerance
System continues despite network failures
Modern View
PACELC extends this - when no partition (E), choose between Latency and Consistency
Real World Choices
AP systems
- •Cassandra
- •DynamoDB
- •CouchDB
- •Riak
CP systems
- •Traditional RDBMS
- •HBase
- •MongoDB (default)
- •Redis Cluster