Compare MySQL, what scenario MongoDB is more suitable

Source: Internet
Author: User
Tags data structures dba

Original link: http://page.factj.com/blog/p/4078

MongoDB has been popular for a long time, compared to MySQL, exactly what scenes need to use MongoDB? Here are some summaries.

Higher write load

By default, MongoDB is more focused on high data write performance than transactional security, and MongoDB is well suited for scenarios where there is a lot of "low value" data in the business system. However, you should avoid using MongoDB in systems with high transactional security, unless you can ensure transactional security from an architectural design.

High Availability

MongoDB's complex sub-set (master-slave) configuration is very simple and convenient, in addition, MongoDB can quickly respond to the processing of single-node failures, automatic and secure completion of failover. These features enable MongoDB to maintain high availability in a relatively unstable environment, such as a cloud host.

The amount of data is large or the future will be large

Depending on the characteristics of the database (MySQL) itself, the completion of the data extension is more difficult, in MySQL, when a single table to 5-10GB will have a significant performance degradation, the need for data through the horizontal and vertical split, the library split to complete the expansion, Using MySQL often requires a drive layer or proxy layer to do this. MongoDB has built a variety of data sharding features, can be well adapted to the needs of large data volume.

Location-based data query

MongoDB supports two-dimensional spatial indexing so that data can be obtained quickly and precisely from a specified location.

The table structure is ambiguous, and the data is constantly getting bigger

In some traditional RDBMS, adding a field locks the entire database/table, or the performance of other requests is significantly degraded when a request for a heavy load is executed. This usually occurs when the data table is larger than 1G (more than 1TB). Because MongoDB is a document database, adding a new field to a document for unstructured goods is a quick operation and does not affect existing data. Another benefit when business data changes, it is not necessary for the DBA to modify the table structure.

No DBA support

MongoDB will be your first choice if you don't have a full-time DBA and are prepared to process data without using standard relational ideas (structured, connected, etc.). MongoDB is very handy for storing like data, and classes can be serialized directly into a JSON store in MongoDB. However, you need to understand some best practices to avoid performance flaws due to document design problems when the data becomes larger.

billrun– MongoDB-based billing system(From oc666)

Billrun is an open source billing system by Ofer Cohen, which uses MongoDB as a data store. The billing system, which is used by one of the fastest-growing telecom operators in Israel to process 500 million communications records per month, Ofer SlideShare on what features of MongoDB are specific:

The characteristics of weak data structures enable Billrun to support new CDR (communication record) types very quickly. This feature makes document-based databases ideal for fast-evolving systems with uncertain business requirements.

Billrun uses only one collection, has managed terabytes of document data, and has not experienced the limitations and problems associated with structural changes, data explosion growth .

The Replicaset replica set feature makes it easier to build more data center DRP.

The built-in sharding Shard feature avoids performance bottlenecks in the process of data growth.

With 2000 communication records per second, MongoDB supports high-load data writes well in architecture design. It is possible to use findandmodify (relatively slow) to complete the underlying transactional features, and to implement a two-stage commit through application-level support.

Compared with SQL, the query method is more readable, easy to understand, and relatively easy to develop.

Location-based allows better analysis of user usage to better develop investment points for mobile phone infrastructure.

Compare MySQL, what scenario MongoDB is more suitable

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.