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

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.

主站蜘蛛池模板: 乐都县| 海宁市| 江孜县| 巴彦县| 霸州市| 琼海市| 鹤峰县| 安图县| 仲巴县| 芜湖县| 天峻县| 如东县| 杭锦后旗| 呈贡县| 黑河市| 永川市| 南平市| 洪雅县| 哈巴河县| 东乡族自治县| 西畴县| 嘉黎县| 邢台县| 平遥县| 定州市| 新巴尔虎左旗| 清远市| 钟祥市| 河北省| 南阳市| 定州市| 商丘市| 万荣县| 扶沟县| 百色市| 南平市| 榆中县| 江陵县| 永福县| 淄博市| 稻城县|