What is MongoDB

What is MongoDB?
MongoDB is a database management system designed for web applications and Internet infrastructure. Yes, MongoDB is a database, a NoSQL type database.

So what is nosql?
NoSQL, generally refers to non-relational databases. With the rise of web 2.0 websites on the Internet, traditional relational databases have been unable to handle web 2.0 websites, especially the super-large-scale and high-concurrency SNS-type web2.0 pure dynamic websites, and there have been many insurmountable problems. The non-relational database has been developed very rapidly due to its own characteristics. NoSQL database was created to solve the challenges brought by multiple data types in large-scale data collections, especially the big data application problems.

Why use MongoDB?
(1) MongoDB proposes the concept of documents and collections. It uses BSON (JSON-like) as its data model structure. Its structure is object-oriented rather than a two-dimensional table. Storage of a user is like this in MongoDB.
{
Username:'123',
password:'123'
}
Using this data model enables MongoDB to provide high read and write capabilities in a production environment, and the throughput is greatly enhanced compared to SQL databases such as mysql.
(2) Easy to scale, automatic failover. Easy scalability refers to the provision of sharding capabilities, the ability to shard a data set, and the data storage pressure to be shared among multiple servers. Automatic failover is the concept of replica set. MongoDB can detect whether the master node is alive, and when inactive, it can automatically promote the slave node to become the master node to achieve failover.
(3) Because the data model is object-oriented, it can express rich and hierarchical data structures. For example, in the blog system, you can directly add "comments" to the "article" document, instead of creating three sheets like myqsl. Table to describe this relationship.

Guess you like

Origin blog.csdn.net/sunzheng176/article/details/110347275