Where does mongodb stand in the CAP theorem?

后端 未结 8 2115
鱼传尺愫
鱼传尺愫 2020-11-28 18:15

Everywhere I look, I see that MongoDB is CP. But when I dig in I see it is eventually consistent. Is it CP when you use safe=true? If so, does that mean that when I write wi

8条回答
  •  野性不改
    2020-11-28 19:03

    Yes, it is CP when using safe=true. This simply means, the data made it to the masters disk. If you want to make sure it also arrived on some replica, look into the 'w=N' parameter where N is the number of replicas the data has to be saved on.

    see this and this for more information.

提交回复
热议问题