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

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.

主站蜘蛛池模板: 航空| 郓城县| 微山县| 黄大仙区| 涞水县| 兰溪市| 石阡县| 黄浦区| 工布江达县| 丘北县| 南澳县| 广西| 读书| 阿城市| 东兴市| 乌拉特前旗| 从化市| 弋阳县| 德昌县| 韶山市| 洛扎县| 乌拉特中旗| 江孜县| 克什克腾旗| 固原市| 江油市| 无锡市| 宣武区| 太仓市| 东丽区| 兴化市| 龙川县| 东港市| 昌邑市| 漳州市| 广安市| 前郭尔| 准格尔旗| 济宁市| 遵化市| 元阳县|