MongoDB Guide (translated) (15th)-developer zone-gridfs Introduction

Source: Internet
Author: User

Gridfs is a specification for storing large files in MongoDB. All officially supported drivers have implemented the gridfs specification.

Basic Principles

The Database supports binary data storage in bson object format. However, in MongoDB, The bson object size is limited (4 MB in the old version and 16 Mb in v1.7/1.8, which will be higher in the future ). The gridfs specification provides a mechanism to transparently split a large file into multiple small documents. This allows us to efficiently store large objects, especially large files, such as videos, and range operations (such as obtaining the first n Bytes of a file ).

Implementation

To achieve this, this specification specifies a standard that can block files. Each file has a metadata object in the collection, and one or more block objects in the block set. For more detailed information, you can query the gridfs specification. However, you do not need to read it. You only need to take a look at the gridfs API or javasfile Tool Driven by each language.

Language Support

Most drivers contain gridfs implementations. For languages not listed below, check the driver's API documentation. (If gridfsas is not supported in this language, check the gridfs specifications. It is not difficult to implement the gridfs processing function)

Command line tool

The command line tool can be used to read/write gridfs files from MongoDB to the local file system.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.