The CAP Theorem
In this chapter, we look at what Shopend’s replicated database does when its servers cannot communicate, and at the CAP theorem, which describes the choice it has to make.
After reading this chapter, you should be able to:
- Define a network partition and distinguish it from a server failure
- Explain how failover during a partition can leave two primaries, and how the majority rule prevents it
- Define consistency, availability, and partition tolerance as the CAP theorem uses them
- Distinguish availability in the CAP theorem from availability as uptime, and consistency in the CAP theorem from consistency in ACID
- Explain why a replicated database cannot guarantee both consistency and availability during a partition
- Classify an operation as CP or AP, and explain what CA describes
- Define eventual consistency and strong consistency, and place read-your-writes between them
- Explain what BASE means and compare it with ACID
- Explain why ACID is often linked with relational databases and BASE with NoSQL databases