Basic concepts of MongoDB

Source: Internet
Author: User

MongoDB consists of three layers: database, collection, and document.

Relationship with relational databases:

Apsaradb for MongoDB

Database

Table collection

Row document

MongoDB has no concept of columns, rows, and links for tables in relational databases, which reflects the free mode.

You can create an index in MongoDB. The collection contains a default hidden field _ id, which

Because MongoDB's document structure is in bjson format (bjson Full name: Binary JSON), bjson itself supports storing binary data, therefore, the binary data of the file can be directly stored in the document structure of MongoDB. However, because the maximum length of a bjson file cannot exceed 4 MB, the maximum size of files that can be stored in a single document cannot exceed 4 MB. To provide support for large-capacity file access, the samus Driver provides the "gridfs" method. The "gridfs" method requires the introduction of newProgramSet "MongoDB. gridfs. dll ". The following two methods are used for implementation. In fact, the storage of large file attachments can be considered as files based on the experience of developing relational database applications. In this case, only the file storage address can be saved in the database, this reduces the size of database files and improves query performance. You can also detach an attachment from a single database and deploy the attachment and application separately. After all, the Access Frequency of large attachments is not very high.

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.