How to work around the lack of transactions in MongoDB?

后端 未结 10 666
梦毁少年i
梦毁少年i 2020-11-27 09:19

I know there are similar questions here but they are either telling me to switch back to regular RDBMS systems if I need transactions or use atomic operations or two-phase c

10条回答
  •  一个人的身影
    2020-11-27 10:01

    This is probably the best blog I found regarding implementing transaction like feature for mongodb .!

    Syncing Flag: best for just copying data over from a master document

    Job Queue: very general purpose, solves 95% of cases. Most systems need to have at least one job queue around anyway!

    Two Phase Commit: this technique ensure that each entity always has all information needed to get to a consistent state

    Log Reconciliation: the most robust technique, ideal for financial systems

    Versioning: provides isolation and supports complex structures

    Read this for more info: https://dzone.com/articles/how-implement-robust-and

提交回复
热议问题