promise.all reject cause mongodb update rollback?
 发布于 6 年前  作者 jxycbjhc  3789 次预览  最后一次回复是 6 年前  来自 问答 

如题

1 回复
jxycbjhc

找到了,好久前看过忘了 官方文档写的也很详细了:Retry Transaction and Commit Operation 里面也提到了

In most cases, multi-document transaction incurs a greater performance cost over single document writes, and the availability of multi-document transaction should not be a replacement for effective schema design. For many scenarios, the denormalized data model (embedded documents and arrays) will continue to be optimal for your data and use cases. That is, for many scenarios, modeling your data appropriately will minimize the need for multi-document transactions.

含义很明显了,从表设计层面上去减少这种情况