Several things you need to know about MongoDB

Source: Internet
Author: User
HenriqueLoboWeissmann is a software developer from Brazil and co-founder of itexto, a consulting company. Recently, Henrique wrote on his blog about some content about MongoDB, some of which deserve our attention, especially those who are interested in using MongoDB. So far, MongoDB has been

Henrique Lobo Weissmann is a software developer from Brazil and co-founder of itexto, a consulting company. Recently, Henrique wrote on his blog about some content about MongoDB, some of which deserve our attention, especially those who are interested in using MongoDB. So far, MongoDB has been

Henrique Lobo Weissmann is a software developer from Brazil and co-founder of itexto, a consulting company. Recently, Henrique wrote on his blog about some content about MongoDB, some of which deserve our attention, especially those who are interested in using MongoDB.

So far, MongoDB is the most popular NoSQL database in Brazil (at least based on the number of MongoDB blogs and articles ). MongoDB is a great solution, but few of us are troubled by its limitations. This kind of thing is happening constantly: People see MongoDB restrictions, but they think these are their bugs.

This article lists some MongoDB restrictions confusing to the author. If you plan to use MongoDB, you should at least know these restrictions in advance to avoid being caught off guard.

Disk Space consumption

This is my first confusion: MongoDB will consume too much disk space. Of course, this is related to its encoding method, because MongoDB will avoid disk fragmentation by pre-allocating large file space. It works like this: When you create a database, the system creates a database named [db name]. 0. When more than half of the files are used, the system will create a file named [db name] again. 1 file, the file size is double. This situation will continue, so 256, 512, 1024, 2048 files will be written to the disk. Finally, the size of the created file is 2048 Mb. If the bucket is a limitation of the project, you must consider this situation. There is a commercial solution for this problem, called TokuMX, which reduces storage consumption by 90%. In addition, in the long run, the repairDatabase and compact commands will also help you to a certain extent.

Data Replication through replica sets is very effective, but there are limits

The replica set policy for Data Replication in MongoDB is very good, and it is easy to configure and use. However, if the cluster has more than 12 nodes, you may encounter problems. The replica set in MongoDB has 12 nodes. Here is the problem description. You can track this problem to see if it has been resolved.

Master-slave replication does not ensure high availability

Although it is no longer recommended, MongoDB provides another replication policy, namely, master-slave replication. It solves the 12 node restrictions, but creates a new problem: If you need to change the master node of the cluster, you must do it manually. Are you surprised? Let's take a look at this link.

Do not use a 32-bit version

MongoDB's 32-bit version is not recommended because you can only process 2 GB of data. Do you still remember the first limit? This is MongoDB's description of this restriction.

The consulting fee is very expensive (at least for developers and companies in Brazil)

I do not know the situation in other countries, but at least the consulting fee for apsaradb for MongoDB in Brazil is a daily price. For the Lightning Consult program, the hourly price is $450, and you need to buy at least two hours. In other words, for any company, the price for each consultation is at least USD 900. Compared with RedHat and Oracle, this price is too high.

Poor management tools

This is still a headache for beginners. The MongoDB console is too bad. The best tool I know is RoboMongo, which is very handy for first-time developers.

Understand official restrictions

I am surprised that few people will query the restrictions on the tools they will use. Fortunately, MongoDB developers have published a blog about all MongoDB restrictions. You can learn about the restrictions in advance to avoid embarrassment during use.

Readers, there are more and more companies using MongoDB. You may wish to share some of your experiences and lessons when using this NoSQL database.

Original Chinese text:

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.