4 ms·
How do you handle issues around data integrity? From http://jepsen.io/analyses/mongodb-4.2.6 http://jepsen.io/analyses/mongodb-4.2.6 > Jepsen evaluated MongoDB
by wlll 6y ago
How do you handle issues around data integrity? From http://jepsen.io/analyses/mongodb-4.2.6 http://jepsen.io/analyses/mongodb-4.2.6
> Jepsen evaluated MongoDB version 4.2.6, and found that even at the strongest levels of read and write concern, it failed to preserve snapshot isolation. Instead, Jepsen observed read skew, cyclic information flow, duplicate writes, and internal consistency violations. Weak defaults meant that transactions could lose writes and allow dirty reads, even downgrading requested safety levels at the database and collection level.
- arnejenssen 6y agoInteresting. I haven't had a usecase where data integrity is critial yet. A project i'm working on now will have credits and accounts. To accomplish that in mongo. I create a transaction with with "pending" status. Then i try to debit the source account, and credit the destination account and I add the pending transaction to the accounts. If that works I set the transaction to "committed" and I remove the pending transactions from the accounts. https://gist.github.com/exoer/eee2aa37c86c06190f12ef4e2c6bd1c6 https://gist.github.com/exoer/eee2aa37c86c06190f12ef4e2c6bd1...
- wlll 6y agoIf you haven't already I would absolutely read the Jepsen articles on MongoDB, at least so you are aware of the risks and failure states. There's some stuff about transactions that may be relevant too.