4 ms·
Blog author here. Thanks for reading and responding. I understand that modifications can be made within a single MongoDB document atomically. I was thinking mor
by d--j--d 8y ago
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 8y agoThere 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-is-the-difference-between-sharding-and-replication https://stackoverflow.com/questions/11571273/in-mongo-what-i... MongoDB's multi-document transactions work with replication today, and will work with sharding in 4.2.
- d--j--d 8y agoGot 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.