Home > Database > Mysql Tutorial > body text

What is mongoDB database

小云云
Release: 2017-11-24 09:52:03
Original
2123 people have browsed it

As a programmer, I believe that everyone must be exposed to databases and have a relative understanding of mysql and mongoDB. We already know mysql very well. Now let’s briefly talk about the mongoDB database.

MongoDB is a database based on distributed file storage, written in C++ language, designed to provide scalable, high-performance data storage solutions for WEB applications.

MongoDB is a product between a relational database and a non-relational database. It is the most feature-rich among non-relational databases and is most like a relational database. The data structure it supports is very loose and is a bson format similar to json, so it can store more complex data types. The biggest feature of Mongo is that the query language it supports is very powerful. Its syntax is somewhat similar to an object-oriented query language. It can almost implement most functions similar to single-table queries in relational databases, and it also supports indexing of data.

Features of mongoDB database:

High performance, easy to deploy, easy to use, and very convenient to store data. The main functional features are:

*Oriented to collection storage, easy to store object type data.

The so-called "Collection-Oriented" means that data is grouped and stored in a data set, which is called a collection. Each collection has a unique identifying name in the database and can contain an unlimited number of documents. The concept of a collection is similar to a table in a relational database (RDBMS), except that it does not need to define any schema. The flash cache algorithm in Nytro MegaRAID technology quickly identifies hot data in large data sets within the database, providing consistent performance improvements.

*Schema-free.

Using schema-less structure storage means that for files stored in the mongodb database, we do not need to know any structure definition. If necessary, you can store files with different structures in the same database. The use of schema to store data is an important feature that distinguishes collections from tables in RDBMS.

*Support dynamic query.

*Supports full indexing, including internal objects.

You can create an index on any attribute, including internal objects. MongoDB indexes are basically the same as RDBMS indexes. Indexes can be created on specified attributes and internal objects to improve query speed. In addition to this, MongoDB also provides the ability to create geospatial-based indexes.

*Support query.

MongoDB supports rich query operations. MongoDB supports almost most queries in SQL.

*Supports replication and failure recovery.

MongoDB supports master-slave replication mechanism, which can realize data backup, fault recovery, read expansion and other functions. The replication mechanism based on replica sets provides the function of automatic failure recovery, ensuring that cluster data will not be lost.

*Use efficient binary data storage, including large objects (such as videos, etc.).

Using binary format storage, any type of data object can be saved.

* Automatically handle fragmentation to support scalability at the cloud computing level.

*Supports RUBY, PYTHON, JAVA, C++, PHP, C#, Perl, JavaScript and other languages.

MongoDB provides database driver packages for all current mainstream development languages. Developers can easily program using any mainstream development language to access the MongoDB database.

*The file storage format is BSON (an extension of JSON).

BSON is the abbreviation of JSON in binary format. BSON supports nesting of documents and arrays.

*Accessible via the web.

MongoDB database can be accessed remotely through the network.

*Powerful aggregation tools

In addition to providing rich query functions, MongoDB also provides powerful aggregation tools, such as count, group, etc., supporting the use of MapReduce to complete complex aggregation tasks.

In addition to providing rich query functions, MongoDB also provides powerful aggregation tools, such as count, group, etc., supporting the use of MapReduce to complete complex aggregation tasks.

The main application scenarios of MongoDB are:

(1) Website real-time data processing. It is ideal for real-time inserts, updates and queries, and has the replication and high scalability required for real-time data storage on the website.

(2) Cache. Due to its high performance, it is suitable as a caching layer for information infrastructure. After the system is restarted, the persistent cache layer built by it can prevent the underlying data sources from being overloaded.

(3) High scalability scenario. Ideal for databases consisting of tens or hundreds of servers, its roadmap already includes built-in support for the MapReduce engine.

(4) For large-size, low-value data, it may be more expensive to store some data using traditional relational databases. Before this, programmers often chose traditional files for storage.

Unapplicable scenarios are as follows:

(1) Systems requiring a high degree of transactionality, such as banking or accounting systems. Traditional relational databases are currently more suitable for applications that require a large number of atomic and complex transactions.

(2) Traditional business intelligence applications, such as BI databases for specific problems, will produce highly optimized query methods. For such applications, a data warehouse may be a more suitable choice.

(3) Complex cross-document (table) cascade query.

The above content is a brief introduction to the mongoDB database. I hope everyone has a grasp of the mongoDB database.

Related recommendations:

Laravel tutorial on how to use mongodb database

phpstudyHow to extend MongoDB

Yan Shiba mongodb video data sharing

The above is the detailed content of What is mongoDB database. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template