CAP theorem
It says a distributed system can only guarantee two of three: consistency, availability and partition tolerance.
Analogy
Like choosing between fast, good and cheap: two of three.
Test yourself: CAP theorem
CAP theorem
How many of CAP's 3 characteristics can a distributed system give at once?
Only 2 of 3: if the network is cut, you must choose between consistency and availability.
CAP theorem
Which is an example of a CA database?
PostgreSQL and MariaDB are CA: with 1 server there's no network between nodes to be cut.
CAP theorem
During a network split, a CP database may stop answering on some nodes.
The isolated node can't know whether its data is the latest, so it shuts off until the network returns. That 1 minute without answers is the price of never reading stale data.
0/3
â–¶ PlayLessons that use it
0-1 knapsack
Take it or leave it
Fractional knapsack
Most value per kilo
Largest container
Move the shorter board
CAP theorem
Pick 2 of 3
PACELC theorem
CAP plus latency
Message queues
Don't keep them waiting
Event sourcing
Keep the story, not just the ending
API Gateway
1 single front door
Rate limiting
A cap on requests
