
Can MongoDB really deliver ACID? - jchanimal
https://blog.fauna.com/can-mongodb-really-deliver-acid
======
drmirror
To answer one of the questions in the post: I do believe that MongoDB's
transactions will only be used in some applications, and only in few but
critical places within those applications. That is because with a document
database, data that belongs together will often already be together in the
same document, rather than distributed over multiple tables as with a
traditional database. And if it's together in the same document, you can
already modify that atomically in MongoDB without multi-document transactions.
(Disclosure: I work for MongoDB.)

~~~
d--j--d
Blog author here. Thanks for reading and responding. I understand that
modifications can be made within a single MongoDB document atomically. I was
thinking more of transactions that would include multiple documents, say
"store" and "customer", and doing a transaction across them. That could be
done in single shard. But if it was sharded across a few data centers for data
locality, that would have to wait for V4.2, right?

~~~
drmirror
There may be a misunderstanding here about sharding vs replication. Having the
same data distributed across a few data centers for data locality is done
using replication. Sharding means that data is partitioned horizontally to
achieve higher throughput, or other goals. See here for a good discussion:
[https://stackoverflow.com/questions/11571273/in-mongo-
what-i...](https://stackoverflow.com/questions/11571273/in-mongo-what-is-the-
difference-between-sharding-and-replication)

MongoDB's multi-document transactions work with replication today, and will
work with sharding in 4.2.

~~~
d--j--d
Got that -- sorry for the terminology error. I was thinking the same shard but
in different data centers, so replicas of the same shard. Transactions within
single shard replica set are possible in v4.0. Transactions across multiple
shards will be possible in v4.2. Reading the doc to try to see performance
impact on transactions if multiple replicas of single shard.

