存儲分享C(MongoDB)寫入及數(shù)據(jù)同步_第1頁
存儲分享C(MongoDB)寫入及數(shù)據(jù)同步_第2頁
存儲分享C(MongoDB)寫入及數(shù)據(jù)同步_第3頁
存儲分享C(MongoDB)寫入及數(shù)據(jù)同步_第4頁
存儲分享C(MongoDB)寫入及數(shù)據(jù)同步_第5頁
已閱讀5頁,還剩1頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、Write ConcernWrite concern describes the guarantee that MongoDB provides when reporting on the success of a write operation. The strength of the write concerns determine the level of guarantee. When inserts, updates and deletes have a weak write concern, write operations return quickly. In some fail

2、ure cases, write operations issued with weak write concerns may not persist. With stronger write concerns, clients wait after sending a write operation for MongoDB to confirm the write operations.MongoDB provides different levels of write concern to better address the specific needs of applications.

3、 Clients may adjust write concern to ensure that the most important operations persist successfully to an entire MongoDB deployment. For other less critical operations, clients can adjust the write concern to ensure faster performance rather than ensure persistence to the entire deployment.Changed i

4、n version 2.6: A new protocol for write operations integrates write concern with the write operations.For details on write concern configurations, see Write Concern Reference.ConsiderationsDefault Write ConcernThe mongo shell and the MongoDB drivers use Acknowledged as the default write concern.See

5、Acknowledged for more information, including when this write concern became the default.TimeoutsClients can set a wtimeout value as part of a replica acknowledged write concern. If the write concern is not satisfied in the specified interval, the operation returns an error, even if the write concern

6、 will eventually succeed.MongoDB does not “rollback” or undo modifications made before the wtimeout interval expired.Write Concern LevelsMongoDB has the following levels of conceptual write concern, listed from weakest to strongest:1.UnacknowledgedWith an unacknowledged write concern, MongoDB does n

7、ot acknowledge the receipt of write operations.Unacknowledged is similar to errors ignored; however, drivers will attempt to receive and handle network errors when possible. The drivers ability to detect network errors depends on the systems networking configuration.Before the releases outlined in D

8、efault Write Concern Change, this was the default write concern.2.AcknowledgedWith a receipt acknowledged write concern, the mongod confirms that it received the write operation and applied the change to the in-memory view of data. Acknowledged write concern allows clients to catch network, duplicat

9、e key, and other errors.MongoDB uses the acknowledged write concern by default starting in the driver releases outlined inReleases.Changed in version 2.6: The mongo shell write methods now incorporates the write concern in the write methods and provide the default write concern whether run interacti

10、vely or in a script. See Write Method Acknowledgements for details.Acknowledged write concern does not confirm that the write operation has persisted to the disk system.3.JournaledWith a journaled write concern, the MongoDB acknowledges the write operation only after committing the data to the journ

11、al. This write concern ensures that MongoDB can recover the data following a shutdown or power interruption.You must have journaling enabled to use this write concern.With a journaled write concern, write operations must wait for the next journal commit. To reduce latency for these operations, Mongo

12、DB also increases the frequency that it commits operations to the journal. SmitIntervalMs for more information.NOTERequiring journaled write concern in a replica set only requires a journal commit of the write operation to the primary of the set regardless of the level of replica acknowledged write concern.4.Replica AcknowledgedReplica sets present additional considerations with regards to write concern. The default write concern only requires acknowledgement from the primary

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論