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.