- 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.
- 大數(shù)據(jù)技術(shù)與應(yīng)用基礎(chǔ)
- 網(wǎng)絡(luò)服務(wù)器架設(shè)(Windows Server+Linux Server)
- 傳感器技術(shù)實驗教程
- 商戰(zhàn)數(shù)據(jù)挖掘:你需要了解的數(shù)據(jù)科學(xué)與分析思維
- IoT Penetration Testing Cookbook
- Java開發(fā)技術(shù)全程指南
- Expert AWS Development
- 大數(shù)據(jù)技術(shù)入門(第2版)
- 人工智能趣味入門:光環(huán)板程序設(shè)計
- 單片機技術(shù)一學(xué)就會
- Docker on Amazon Web Services
- Godot Engine Game Development Projects
- 所羅門的密碼
- C#求職寶典
- Windows 7故障與技巧200例