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

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.

主站蜘蛛池模板: 新竹市| 汾西县| 商水县| 辰溪县| 丰镇市| 西和县| 光泽县| 台南县| 长宁县| 九江县| 龙川县| 德兴市| 福贡县| 通城县| 榆树市| 水富县| 东至县| 竹山县| 连南| 洞口县| 三原县| 开原市| 武宁县| 磐安县| 连州市| 柘城县| 桦南县| 龙岩市| 五原县| 呼玛县| 汉中市| 巴中市| 六枝特区| 广平县| 库伦旗| 台北县| 茂名市| 玉环县| 黔南| 扎囊县| 诸城市|