Concept: MongoDB is a database based on distributed file storage. Written in C++. Designed to provide scalable, high-performance data storage solutions for web applications.
MongoDB is a product that sits somewhere between relational and non-relational databases, and is the most feature-rich and relational-like of non-relational databases.
The data structure it supports is very loose, and it is a JSON-like BSON format, so it can store more complex data types.
The biggest feature of mongo is that the query language it supports is very powerful, and its syntax is somewhat similar to that of object-oriented query language, which can realize almost most of the functions similar to single-table query in relational databases, and also supports indexing of data.
Features: MongoDB is designed to be high-performance, scalable, easy to deploy, easy to use, and easy to store data. Its main features are as follows.
1) Oriented to collection storage, it is easy to store object type data. In MongoDB, data is grouped and stored in collections, which are similar to tables in RDBMS, and an infinite number of documents can be stored in a collection.
2) Mode free, using modeless structure storage. The data stored in a collection in MongoDB is a schemaless document, and storing data in a schemaless manner is an important feature that distinguishes a collection from tables in an RDBMS.
3) Support full indexing, which can be indexed on arbitrary attributes, including internal objects. MongoDB indexes are basically the same as RDBMS indexes, and indexes can be created on specified properties and internal objects to improve query speed. In addition to this, MongoDB provides the ability to create geospatial-based indexes.
4) Support queries. MongoDB supports rich query operations, and MongoDB supports almost most queries in SQL.
5) Powerful aggregation tools. In addition to providing rich query functions, MongoDB also provides powerful aggregation tools, such as count, group, etc., to support the use of MapReduce to complete complex aggregation tasks.
6) Support replication and data recovery. MongoDB supports the master-slave replication mechanism, which can implement data backup, fault recovery, read expansion, and other functions. The replica set-based replication mechanism provides automatic failback to ensure that cluster data is not lost.
7) Use efficient binary data storage, including large objects (such as **) using binary format storage, any type of data object can be saved.
8) Automatically process sharding to support the expansion of cloud computing layers. MongoDB supports automatic data sharding in clusters, which can enable the cluster to store more data, achieve larger loads, and ensure the load balance of storage.
9) Support Perl, PHP, j**a, C, j**ascript, Ruby, C and C++ language drivers, MongoDB provides database driver packages for all current mainstream development languages, developers can easily program with any mainstream development language to achieve access to MongoDB database.
10) The file storage format is BSON (an extension of JSON). BSON is an abbreviation for JSON in binary format, which supports the nesting of documents and arrays.
11) Can be accessed via the web. The MongoDB database can be accessed remotely over the network.
Principle: 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 identifier 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 require any schema definition. The flash caching algorithm in Nytro MegaRAID technology is able to quickly identify hot data in large data sets within a database, providing consistent performance improvements.
Schema-free means that we don't need to know any structure definition for files stored in the MongoDB database. If you want, you can store files with different structures in the same database. Documents stored in a collection, in the form of key-value pairs. Keys are used to uniquely identify a document and are of the string type, while values can be of various complex file types. We call this form of storage BSON (Binary Serialized Document Format).
MongoDB has been deployed in multiple sites and its main scenarios are as follows:
* Real-time data processing. It's ideal for real-time inserts, updates, and queries, and has the replication and high scalability required for real-time data storage.
Cache. Due to its high performance, it is suitable as a caching layer for information infrastructure. After the system restarts, the persistent caching layer built by it can prevent the underlying data sources from being overloaded.
Highly scalable scenarios. Ideal for databases consisting of dozens or hundreds of servers, it already has built-in support for the MapReduce engine already included in its roadmap.
The following scenarios are not applicable:
Requires a highly transactional system.
Traditional business intelligence applications.
Complex cascading queries across documents (tables).
Description: Description].
Install mongob6, install mongoshell, mongoshell before mongob6 shell is directly in it 6 after need to be separated**.
mongoDB6 does not have mongexe and mongdbexe, in order to start mongobb from the command line, you need to have a mongoshell yourself
*After decompression, copy the decompressed file directly to the installation path of mongo6.
Configure the bin directory to the environment variable (both bins must be configured).
Basic] View the current database name: db
View all databases: show dbs
Clear the CLS console
See all collections: show collections
Exit: quit
Note: Case-sensitive.