GridFS

GridFS is a specification for storing large files in MongoDB.

The database supports native storage of binary data within BSON objects.  However, BSON objects in MongoDB are limited to 4MB in size.  Further, even if unlimited, for gigabyte datasets we would want to be able to perform range operations -- such as fetching only the first N bytes of a file.

To facilitate this, a standard is specified for the chunking of files. Each file has a metadata object in a files collection, and one or more chunk objects in a chunks collection.  Details of how this is stored can be found in the GridFS Specification; however, you do not really need to read that, instead, just look at the GridFS API in each language's client driver, and also the GridFS tools.

Language Support

Most drivers include GridFS implementations; for languages not listed below, check the driver's API documentation.  (If a language does not include support, see the GridFS specification -- implementing a handler is usually quite easy.)

Command Line Tools

Command line tools are available to write and read GridFS files from and to the local filesystem.


Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

IF YOU HAVE A QUESTION, POST IT TO THE USER GROUP.

These pages are fine for comments, but for questions, your best bet will always be the MongoDB User Group.

blog comments powered by Disqus