MongoDB application two or three things

Source: Internet
Author: User
Tags benchmark cassandra couchbase data structures mongodb mongodb support

Recently, with the advent of the "Big Data Age", NoSQL database as an Up-and-comer in the database industry, in a short span of a few years, has been rapid development, and today is also a great substitute for the RDBMS. Among the many NoSQL databases, the greatest fame is MongoDB. MongoDB launched its first version in February 2009 and has grown to be the 5th-largest database in the world in DB engine, with more than 5 years to date.

MongoDB has the following characteristics:

1 unstructured data structure, which ensures a variety of data types and forms, without the need to design data structures and table patterns beforehand.

2 horizontal expansion can theoretically be extended indefinitely.

3 various functions and platform architecture support, through its development team and MONGO open source community, make MongoDB support more and more development language and large data architecture, but also continuously enrich his function.

And I as a large data-related practitioners, in the work of continuous learning mongodb knowledge, I also apply it to some practical application scenarios.

In the process of using MONGODB, although its performance is well behaved, it also embodies the basic characteristics of nosql, but in the actual application scene, MongoDB still has a lot of function deficiencies and can improve the performance.

1. Performance

First I want to talk about the performance of MongoDB. As a NoSQL database, MongoDB's performance aspects of many operations are naturally ahead of the RDBMS, while in comparison with other NoSQL products, MongoDB does not actually have much advantage.

According to the test results of some authoritative organizations published on the Internet, the performance of MongoDB is only so-so in many NoSQL databases. Read and write performance, compared to hbase,mongodb in less than the basic level, but in the context of multiple partitions performance only hbase 1/3 or even 1/5. Compared with this leader Cassandra, MONGO in the contrast, can only reach the Cassandra 1/10 or less.

Http://planetcassandra.org/nosql-performance-benchmarks

Compared with the couchbase of the same type of storage, MongoDB does not seem to have an advantage.

Http://www.csdn.net/article/2013-04-15/2814886-nosql-benchmark

Http://www.couchbase.com/press-releases/couchbase-blows-past-competition-nosql-performance-benchmark

From the above two test reports also can be seen, as the NoSQL leader of the MongoDB, in performance is indeed unsatisfactory.

2. function

2.1 Business

Transactions, as a very useful feature of RDBMS, have unique advantages in dealing with highly available and high-security scenarios, such as enterprise-class applications.

MongoDB does not have the function of transaction processing, but in the aspect of atomicity guarantee, it can only achieve single document level, cannot support the atomicity of multiple files.

Nowadays, the application layer of MongoDB has been developed in the open source of the integrated transaction function components, but the implementation of the application layer in the database communication above can not guarantee performance and reliability, it is difficult to provide more professional and perfect support.

2.2 SQL Support

SQL as a database operating language that has been in use for decades, not only in applications, with a variety of interfaces and drivers, but also in the minds of many database users and DBAs, it is difficult and unnecessary to change this way of thinking quickly. Therefore, NOSQL support for SQL statements is also important. MongoDB does not have such native support, and similarly, some drivers of the application layer do not combine the database itself well enough to give full play to its energy.

Conversely, there are a number of similar products that have been provided with their own SQL statement processing, such as through docking PostgreSQL to implement SQL statement support, so that developers can quickly become familiar with the NoSQL.

2.3 Lock

MongoDB only a library-level granularity lock, which means that when MongoDB a write lock is in use, other read and write operations need to wait. Although the modified locking mechanism makes it possible to ensure higher concurrency and high performance (interest can be described separately).

But the basic guarantee and can completely avoid the problem, if the data operation is improper, still can lead to long time occupy write lock, for example, the foreground creates the index operation, when this kind of situation, the entire database is in completely blocking state, cannot carry on any reads and writes the operation, the situation is very serious.


2.4 Automatic Partitioning

An important function of MongoDB level expansion capability is automatic partitioning (auto-sharding), however, MongoDB automatic zoning has many problems in practical application. 1 in the case of high load, the MongoDB automatic partitioning function will be unavailable or slow to run. 2 can see a lot of users on the Internet after the system automatically partitions data errors or data loss (the most famous of course is the foursquare of the downtime event). 3 I have a similar problem in the actual application, that is, MongoDB in the high load, the loss of data, and there is no way to recover.

2.5 Join

MongoDB does not support join operations, when you need to find in more than one collection, you cannot use a join to merge multiple collection, and you can only run one storage operation at a time in each collection.

3. Safety

MongoDB's native database system security is one of the features that it strongly demonstrates, but in fact

The safety design of MongoDB is still defective. First of all, the default security setting for MongoDB is no, which gives a lot of new people unfamiliar with MongoDB features or the first time to convert NoSQL Enterprise users a very large security risk. In addition, MongoDB has also been reported on the Internet some security vulnerabilities or hacker attacks, including illegal data acquisition, the loss of data, and other such incidents are also the reasons for the design of security flaws.

4. Ease of Use

In terms of ease of use, MongoDB's performance is also the same, although the JavaScript shell tool can be used and the interface of MMS, but its operation still has the space to optimize. In addition, MongoDB does not have the automatic installation deployment feature. The installation of MongoDB must be done manually, which is not only time-consuming, but may be overlooked or unable to complete some system configuration work for beginners, causing the installation to fail or an exception during use.


The above is I personally found in the practice of some of the MongoDB, I think, MongoDB although as a leader in the NoSQL and relational database Huashan Jian, but in fact he is not perfect, so I hope that the future MongoDB itself can make improvements, Of course, I would like to have a new database products can come from behind, so as to speed up the NoSQL database faster progress.

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.