MongoDB:いくつかの質問

  1. mongodbが1つのコレクションレベルでアトミック性を実行できることがよく聞きます。 なぜシャーディングとリンクしているのか分かりますか?
  2. レプリケーションとレプリカの唯一の違いは、どちらもマスター/スレーブ(プライマリ/セカンダリ)ですが、レプリカセットには マスターがダウンしている場合の選挙、右?
  3. ACIDでは、mongodb2によってサポートされているかサポートされていませんか?
  4. mongodbの耐久性はsafe = trueで保証されますか?

ありがとうございました !

2

1 答え

  1. MongoDB can currently provide atomicity at the "update a single document" level, that's it. This is completely unrelated to sharding.

  2. 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.

  3. 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).

  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.

1
追加された