DataBase MongoDB Advanced Knowledge

Source: Internet
Author: User
Tags mongodb mongodb driver mongodb version

MongoDB Advanced Knowledge

A. MongoDB fits the scene:

1. Read and write separation:
The MongoDB service uses a highly available architecture with a three-node replica set, and three data nodes are located on different physical servers, automatically synchronizing data. Services for primary and secondary nodes. Two nodes provide separate domain name, with MongoDB driver can self-implement read pressure distribution.

2. Flexible and changeable business:
Because MongoDB uses the No-schema approach, it is very suitable for start-up businesses, eliminating the pain of altering table structures. Users can store schema-fixed structured data in RDS, flexible business storage in MongoDB, high-heat data stored in cloud database memcache or cloud database Redis, to achieve efficient access to business data, and reduce cost input accordingly.

3. Mobile Apps:
The Cloud Database MongoDB Edition supports two-dimensional spatial indexes that perfectly support the business requirements of mobile-class apps based on location queries. At the same time, MongoDB dynamic mode storage is ideal for storing heterogeneous data of multiple systems to meet the needs of mobile app applications.

4. Internet of Things applications:
The Cloud Database MongoDB Edition is extremely high performance, has the asynchronous data writing function, can achieve the performance of the memory database in the specific scenario, is very suitable for the IoT high concurrent writing scenario. At the same time, MongoDB's map-reduce function can also aggregate large amounts of data for aggregation analysis.

5. Core Log System:
The Cloud Database MongoDB version provides extremely high insertion performance in an asynchronous drop-down scenario with the ability to handle the memory database. MongoDB provides two-level indexing capabilities to meet the needs of dynamic queries, and can take advantage of Map-reduce's aggregation framework for multidimensional data analysis.

Two. MongoDB v3.4 has those updates:

1. Faster replication set full-volume synchronization:
When copying data, all indexes are established at the same time (the previous version only _id index is established when synchronizing the data), the stage of copying the data, secondary constantly pull the new oplog, ensure that the secondary local database has enough space to store the temporary data.

2. More Efficient load balancing:
In MongoDB 3.2 and previous versions, the load balancer of a shard cluster is responsible for MONGOs, multiple MONGOs will grab a distributed lock, the successful MONGOs will perform load balancing tasks, migrate chunk between Shard, and in the 3.4 version, load Balancing will be determined by the Config The server's primary node is responsible for a significant increase in load balancing concurrency and efficiency.

3. Richer aggregation operation:
MongoDB added a large number of aggregation operators in the 3.4 version, the data analysis function is more powerful, such as buckets can easily classify the data, $grahpLookup on the basis of 3.2 $lookup, can support more complex relational operations; AddFields makes document operations richer, such as storing some field sums as new fields.

4. Support sharding Zones:
The concept of Zone is introduced in the Shard cluster, which mainly replaces the present tag-aware sharding mechanism, which can allocate some data to one or more shard, which will greatly facilitate the deployment of sharding cluster across the computer room.

5. Support Collation:
MongoDB 3.4 began to support collation, in the previous version, the string stored in the document, whether in Chinese or English, regardless of the case, all in bytes to compare, the introduction of collation, support for the content of the string to interpret, can be compared by the locale used , and also supports ignoring case when comparing.

6. Support Read-only view (read-only views):
MongoDB 3.4 Adds support for read-only views, and the view sets the data in the collection that satisfies a certain query condition into a special collection that allows the user to perform further query operations on a particular set.

7. Engine Replacement:

Wiredtiger Storage Engine: Organization of data based on btree structure, compared to MongoDB early MMAPV1 survival engine performance has a very large increase, and support data compression, storage cost is lower.
ROCKSDB Storage Engine: It is based on the LSM tree structure data, which is optimized for write, the random write is converted into sequential write, can guarantee the continuous and efficient data writing.
TERARKDB Storage Engine: With the help of TERARKDB's global compression technology, the performance of random queries can be greatly improved while increasing the compression rate.

DataBase MongoDB Advanced Knowledge

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.