MongoDB application two or three things

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

Recently, with the advent of the "Big Data Age", NoSQL database, as a rising star in the database industry, has developed rapidly in just a few years, and now it has a great potential to replace the RDBMS. Of the many NoSQL databases, MongoDB is the most famous. MongoDB launched its first version in February 2009, which has grown to become the 5th-largest database in the world with DB engine influence in more than 5 years.

MongoDB has the following features:

1) Unstructured data structure, ensuring the adaptation of a variety of data types and forms, without the need for pre-design data structures and table patterns.

2) Horizontal expansion, in theory, can be infinitely extended horizontal extensibility.

3) A variety of functional and platform architecture support, through the development team's own advancement and the MONGO open source community to flourish, so that MongoDB support more and more development of language and big Data architecture, but also constantly enrich his capabilities.

And I as a big data related practitioners, in the work constantly learning mongodb knowledge, I myself also apply it to some practical application scenarios.

In the process of using MONGODB, although its performance is very good, but also very well embodies the basic characteristics of nosql, but in the actual application scenario, MongoDB still has a lot of functional deficiencies and performance can be improved.

1. Performance

First I want to talk about the performance of MongoDB. As a NoSQL database, the performance of many operations such as MongoDB's read-write check is naturally ahead of the RDBMS, but in comparison with other NoSQL products, MongoDB does not really have much advantage.

MongoDB's performance can only be said to be common in many NoSQL databases, according to the test results of some of the authoritative agencies published online. Read and write performance, compared to HBASE,MONGODB in a few partitions can be basically flat, but in the multi-partition scenario performance is only 1/3 or even 1/5 hbase. Compared with the leader Cassandra, MONGO can only reach Cassandra 1/10 or less in various comparisons.

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

MongoDB does not seem to have an advantage over couchbase of the same type of storage.

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

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

As you can see from the two test reports above, MongoDB, as a nosql leader, does not perform well on performance.

2. function

2.1 Business

Transactions are a very useful feature of RDBMS, and transactions have unique advantages when dealing with high-availability, high-security scenarios such as enterprise-class applications.

MongoDB does not have transactional capabilities, and in the assurance of atomicity, it can only be done at a single document level, not supporting the atomicity of multiple files.

Today, MongoDB in the application layer after the open source also has the folk development integration the transaction function component, but the application layer implementation in the database communication above cannot guarantee the performance and the reliability, also is difficult to provide the more specialized and the perfect support.

2.2 SQL Support

SQL as a database operation language that has been used for decades, not only in the application, has a perfect variety of interfaces and drivers, while the SQL thinking in many database users and DBAs have been deeply rooted in the brain, want to quickly change this way of thinking is difficult and unnecessary. Therefore, NOSQL support for SQL statements is also important. MongoDB does not have this kind of native support, similarly, some of the driver of the application layer is not very good to combine the database itself, fully exert its energy.

Conversely, there are a number of similar products that have been provided with their own SQL statement processing, for example, by docking PostgreSQL for SQL statement support, which allows developers to become more familiar with and transfer to NoSQL.

2.3 Lock

MongoDB has only a library-level granularity lock, which means that when MongoDB a write lock is occupied, other read and write operations need to wait. Although the changed lock processing mechanism allows it to guarantee high concurrency and high performance (interesting can be described separately).

But the basic guarantee and can completely avoid the problem, if the data improper operation, will still cause a long time to occupy the write lock, such as the foreground to create index operations, when this situation, the entire database is in a completely blocked state, can not do any read and write operations, the situation is very serious.


2.4 Automatic Partitioning

One of the most important features of MongoDB level expansion is automatic partitioning (auto-sharding), however, there are many problems in the actual application of MongoDB auto-partitioning. 1) In the case of high load, the automatic partition function of MongoDB will be unavailable or slow to run. 2) You can see that there are many users on the Internet after the system automatically partition data errors or data loss situation (the most famous is of course the foursquare of the outage event). 3) I have a similar problem in my own application, that is, MongoDB under high load, there is loss of data, and there is no way to recover.

2.5 Join

MongoDB does not support join operations and needs to be found in multiple collection, you cannot use join to merge multiple collection, and you can only run one storage operation in each collection, respectively.

3. Security

MongoDB's native database system security is also one of the features it is trying to demonstrate, but in fact

MongoDB's security design is still flawed. First, the default security setting for MongoDB is no, which gives a lot of new people unfamiliar with mongodb features or a very big security risk for the first time a NoSQL enterprise user is converted. In addition, MongoDB is also reported on the Internet a number of security vulnerabilities or hacking incidents, including illegal data acquisition, the loss of data, such as the cause of these events is the security design flaws.

4. Ease of Use

In terms of ease of use, MongoDB's performance is also a plus, although JavaScript can be used shell tools and the interface of MMS, but its operations are still optimized space. In addition, MongoDB does not have the automatic installation deployment feature. MongoDB installation deployment must be fully manual operation, which is not only time-consuming, for beginners may be unfamiliar to ignore or can not complete the work of some system configuration, resulting in installation failure or during the use of an exception.


The above is my personal in practice found in MongoDB a few shortcomings, I think, MongoDB, although as a leading figure of nosql in the relationship with the database Huashan sword, but in fact he is not perfect, so I hope the future MongoDB itself can make improvements, Of course, I would like to have a new database product can come from behind, so as to speed up the NoSQL database faster progress.

MongoDB application two or three things

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.