↳Here is the harsh truth: You don't get to choose P. Network cables get cut.
↳Switches fail.
↳Packets drop.
↳A network partition WILL happen.
↳Therefore, when the network breaks, you must choose: - CP (Consistency): You guarantee that everyone sees the exact same data.
↳If the network is broken and Node A can't talk to Node B, Node A must refuse to answer queries (Availability is sacrificed).
↳Example: etcd, Zookeeper.
↳If they lose quorum, they stop working to protect data integrity.
↳- AP (Availability): Node A answers the query using the data it currently has, even if it knows it can't reach Node B to get the latest updates (Consistency is sacrificed).
↳Example: Cassandra.
↳It stays up, but you might read stale data.
▲ LIVE INCIDENTA shopping cart microservice is using a strict CP database. During a brief network blip, users couldn't add items to their carts.