[DRIVERS-299] Custom GridFS files._id Created: 18/Apr/16  Updated: 15/Apr/19  Resolved: 11/Dec/17

Status: Closed
Project: Drivers
Component/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Kiril Piskunov Assignee: Robert Stam
Resolution: Done Votes: 1
Labels: gridfs, sharding
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CXX-1130 Implement GridFS Spec Closed
depends on CSHARP-1644 Support custom GridFS file id values Closed
depends on CDRIVER-1306 Support GridFS custom file_id methods Closed
depends on JAVA-2188 Allow applications to set the files_i... Closed
depends on NODE-928 Support Custom GridFS files._id Closed
depends on PHPLIB-197 Support non-ObjectID identifiers for ... Closed
depends on RUBY-1111 Support custom GridFS file ids Closed
depends on PYTHON-1097 Support GridFS custom file_id methods Closed
Related
related to TOOLS-1591 mongofiles should support custom Grid... Closed
related to DOCS-10993 Improve Sharding GridFS information Closed
is related to DOCS-9741 Comment on: "manual/core/gridfs.txt" Closed
Driver Compliance:
Key Status/Resolution FixVersion
CSHARP-1644 Done 2.3
PERL-620 Done 1.6.0
JAVA-2188 Done 3.3.0
RUBY-1111 Done 2.3.0
CDRIVER-1306 Done 1.4.0
PHPLIB-197 Done 1.1.0-alpha1, 1.1.0
PYTHON-1097 Done 3.3
CXX-1130 Done 3.2.0-rc0
NODE-928 Works as Designed

 Description   

When sharding GridFS chunks collection it is necessary to set a custom value for the _id field. Using default ObjectId causes all writes to be routed to the first shard in the cluster.



 Comments   
Comment by Robert Stam [ 10/May/16 ]

The GridFS spec has been updated to reflect how drivers will support custom file ids.

Individual driver tickets will be created as necessary and linked to this ticket.

Comment by Jason Zucchetto [ 29/Apr/16 ]

We expect to begin working on this functionality soon, please watch this ticket for updates. Thanks!

Comment by Kiril Piskunov [ 18/Apr/16 ]

Current GridFS spec conflicts with our main documentation for GridFS where we suggest that files._id can be set when saving a file.

The default files_id value is an ObjectId, as a result, the values of files_id are always ascending, and applications will insert all new GridFS data to a single chunk and shard. If your write load is too high for a single server to handle, consider a different shard key or use a different value for _id in the files collection.

https://docs.mongodb.org/manual/tutorial/shard-gridfs-data/

_id: a unique ID for this document, of type BSON ObjectId. Legacy GridFS systems may store this value as a different type. New files must be stored using an ObjectId.

https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.rst

Generated at Thu Feb 08 08:21:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.