[SERVER-11500] Multi-document transactions within a single shard Created: 31/Oct/13  Updated: 06/Dec/22  Resolved: 19/Jun/18

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Ron Avnur Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Done Votes: 31
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-2804 Transactional write-batch support Closed
is related to SERVER-11508 Multi-document transactions across sh... Closed
Assigned Teams:
Sharding
Participants:

 Description   

Add ability to modify/insert/delete multiple documents that all belong to the same shard as a single transaction.



 Comments   
Comment by Spencer Brody (Inactive) [ 19/Jun/18 ]

MongoDB 4.0 supports multi-document transactions on a single replica set.

While they do not yet work in sharded clusters, sharding support for multi-document transactions is currently under development and is targeted (though not guaranteed) to be released in MongoDB 4.2.

Comment by Umesh Y [X] [ 09/Jan/17 ]

Apart from the use case Tom mentioned, there will be many other use cases which can have all the documents participating in a Transaction reside on a single shard especially multi-tenant cloud App.....In my perspective if we have this feature in MongoDB, we can replace RDBMS for many use cases and MongoDB will be the most preferred database.
When can we expect this feature(multi-document transaction).

Comment by Tom Kwong [ 26/Mar/15 ]

I would expect the transaction aspect would not only guarantee "all or none" but also support various levels of isolation.

http://en.wikipedia.org/wiki/Isolation_%28database_systems%29

Having this feature can potentially open up a lot of use cases where document-oriented model is preferred but sharding isn't required due to smaller data volume.

Comment by Dwight Merriman [ 20/Jan/15 ]

To elaborate: the multiple documents could be in any number of collections, but are all on the same shard. In that scenario presumably the collections presumably use the same shard key. For example if all the orders for a customer fit on one shard, shard both the orders collection and customer collection by customer_id.

Generated at Thu Feb 08 03:25:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.