- I often hear that mongodb can perform atomicity at one collection level.
Do you know why and how this is linked to sharding? - The only difference between replication and replicasets is that both are master/slave (primary/secondary) but replicasets has
election if master is down, right? - In ACID, which are supported/not supported by mongodb2?
- Can Durability in mongodb be garanteed with safe=true ?
Thank you !
MongoDB can currently provide atomicity at the “update a single document” level, that’s it. This is completely unrelated to sharding.
More or less. Replica sets are newer, and you should basically always use them now. Master/Slave replication is only around for backwards compatibility these days. It’s pretty likely that only replica sets will be getting new features going forwards.
Atomicity is provided for an update to a single document (see #1). Consistency and Isolation aren’t really provided at all — your application will have to do that. Durability can be provided (in a fashion) by requiring that a write operation is persisted to multiple nodes before the driver reports success (see #4).
Durability can be provided by tweaking the Write Concern, either by using a value for W > 1, and/or (although this is slow) by using fsync. See the WriteConcern documentation or the connection string documentation.