CP = Every read receives the most recent write or an error.
Weak consistency = After a write, reads may or may not see it. A best effort approach is taken.
(source)
If I understand correctly, In CAP theorem, we have the tradeoff between availability(AP) and consistency(CP), so we must chose between them.
Weak consistency is a consistency pattern, so in order to implement it, I'll need to pass on availability.
But the pattern definition declares 'best effort', meaning it cannot validate 'receives the most recent write' principle.
So my question is - Why ever use it? what is the use case where i'll choose best effort consistency over availability?
CAP theorem indicates that during a network partitioning how your system as whole should behave:
AP
Even though there is a temporal network partitioning, which prevents proper synchronization / replication between the nodes, you still allow new write operations. So, some node might have newer values than others. From a consumer perspective this means that two subsequent reads might return different values.
CP
Even though there is a temporal network partitioning, which prevents proper synchronization / replication between the nodes, you allow only read operations or nothing. Whether your system supports degraded mode or not you can switch to read-only mode or you become (as a system) entirely unavailable.
AP vs. CP after the network issue
Different NOSQL database systems prefer Availability (like Cassandra, DynamoDb) while others Consistency (like Redis, MongoDb). Depending on your requirements you have to choose the right database system to support your needs.