mongodb1--What is MongoDB

Source: Internet
Author: User

Mongodb
The difference between 1.mongodb and other NoSQL databases
We should have been exposed to Redis or memcached, they belong to the Key-value database, they use the hash algorithm to correlate, can achieve fast query purposes.
While MongoDB is a "document database", the storage type is document-based, the document type is (Bson, is actually a JSON binary object).

Features: MongoDB internal engine is implemented using JavaScript interpreter, the document is stored as Bson structure, in the query, converted to JS object, and can be familiar with the JS syntax to operate.

Principle: MongoDB on the computer disk file system, and packaging their own set of file system---gridfs, which is stored in a JSON binary object, that is, Bson.

If we want to Bson object to "Add or delete change", we will use JS to operate, we directly use JS to operate, and then MongoDB built-in JS engine will be our JS parsing into Bson object related operations, and then perform additions and deletions to investigate.

Differences between 2.MONGODB and traditional relational databases (mysql/sqlserver/oracle, etc.)
Traditional relational database: structured data, after the table structure has been set, each row of the content must be consistent with the table structure, that is, the number of columns, the type is the same.


MongoDB's document database: Document-based, without declaring the structure in advance. We create JSON-formatted data that is stored directly in the MongoDB document.

Unlike traditional relational databases, we can create objects that have different structures (JSON objects can have their own unique properties and values), and that exist under the same table.

In general, our website has a comment function, there are some comments below there are replies, replies can also reply, that is, we often say the effect of the building:

In the traditional relational database, we need to have a post table, and then have the comment form of the post, and then have the reply form of each post, some replies may also have a score, so we have to design four tables, and then each has the main foreign Key association, for joint query:

The efficiency of the four-sheet query is not necessarily high.

In MongoDB, it's easier. We use a JSON format to store all
The data:


So visible are some of the advantages of MongoDB.

Next we will explain the installation of MONGDB and basic getting started operation.
Reprint Please specify Source: http://blog.csdn.net/acmman/article/details/53734215

mongodb1--What is MongoDB

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.