- Mastering MongoDB 3.x
- Alex Giamas
- 145字
- 2021-08-20 10:10:50
Write isolation
Sparingly, we could use $isolated to isolate writes to multiple documents from other writers or readers to these documents. In the previous example, we could use $isolated to update multiple documents and make sure that we update both balances before anyone else gets the chance to double-spend to drain the source account from its funds.
What this won't give us though, is atomicity, the all-or-nothing approach. So if the update only partially modifies both accounts, we still need to detect and unroll any modifications made in the pending state.
$isolated uses an exclusive lock in the entire collection no matter the storage engine used. This means a severe speed penalty when using it, especially for WiredTiger document level locking semantics.
$isolated does not work with sharded clusters, which may be an issue when we decide to go from replica sets to sharded deployment.
- 零起步輕松學(xué)單片機(jī)技術(shù)(第2版)
- PowerShell 3.0 Advanced Administration Handbook
- 空間機(jī)器人遙操作系統(tǒng)及控制
- CSS全程指南
- Google App Inventor
- 西門子S7-200 SMART PLC實(shí)例指導(dǎo)學(xué)與用
- 大數(shù)據(jù)處理平臺(tái)
- Enterprise PowerShell Scripting Bootcamp
- Visual C++項(xiàng)目開發(fā)案例精粹
- 空間機(jī)器人智能感知技術(shù)
- 計(jì)算機(jī)應(yīng)用基礎(chǔ)實(shí)訓(xùn)·職業(yè)模塊
- 伺服與運(yùn)動(dòng)控制系統(tǒng)設(shè)計(jì)
- Practical Network Automation
- Cloud Native Development Patterns and Best Practices
- Building Impressive Presentations with Impress.js