In terms of CAP theorem, MongoDB is usually defined as CP by default. In a replica set scenario, is the following correct? The option w
is the write concern:
{ w: 1 }
: wait for a confirm only from the primary. If we read from secondary members, the system is eventually consistent and then AP.{ w: 3 }
: wait for a confirm from three members. If the replica is made of three members, the system is consistent (strong?) and thus CP.Looking at Mongodb replication guide it look like, by default all query goes to the primary server. It you want the 'A' you also need to read on secondaries server, this is requiere to be AP. And then you loose the C because the results may be different from one server to another.
The question also look like this one, the answer could be helpful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With