官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 滁州市| 杭州市| 大城县| 星座| 韩城市| 乐东| 察雅县| 延安市| 临夏县| 贵州省| 固始县| 肥东县| 乾安县| 麻阳| 开江县| 永胜县| 江山市| 清徐县| 梓潼县| 建德市| 秀山| 启东市| 凤翔县| 衢州市| 潼关县| 墨江| 灯塔市| 仁化县| 凤冈县| 白银市| 绥化市| 剑阁县| 阜康市| 普兰店市| 泾阳县| 醴陵市| 攀枝花市| 调兵山市| 安义县| 武鸣县| 景洪市|