Friday, May 25, 2012

MongoDB pain points

Recently I was contacted by 10gen's account manager soliciting a feedback on our use of MongoDB at the company I'm working at. I wrote a lengthy reply on what we do with MongoDB and the problems we see with it and never heard back. It was a shame to all these feedback to go to waste so I decided to repost it with minor edits in my blog. So here it comes ...

We are using MongoDB at IPONWEB for quite long time - for ~2 years already for a number of high loaded projects. Our company specializes at creating products for display advertising and mostly we are using MongoDB to keep track of user data in our adservers. The main reason we are using MongoDB is raw performance. We are using MongoDB mostly as dumb NoSQL key-value database where we try to keep data fully cached in RAM. With rare exceptions we are not using any fancy features like complex queries, map-reduce and so on but rather limit ourselves to queries by a primary key. We do use sharding because as I mentioned above we have to put whole database to RAM so we often have to split database across multiple servers. Generally we are very price sensitive about costs of the installation so we are always looking at reducing hardware costs for our databases. Giving this background the following limitations in MongoDB implementation cause us the most grief:

a) lack of online database defragmentation in MongoDB. Currently the only way to compact MongoDB database is to stop the database and run compact or repair. On our datasets this process runs for considerable time. We do have to defragment  database pretty often to keep RAM usage under control. Fragmented vs non-fragmented database can be easily be two times bigger what in our case means two time higher hardware costs.

b) realistically for our use case we can do MongoDB resharding only offline. Adserving is extremely sensitive to any latencies and if we add more shards to existing cluster we more or less forced to take the application offline until resharding finishes.

c) lack of good support of SSD. The way MongoDB works now switching from using more RAM with HDD as backing storage in favor of using less RAM with SSD backing storage doesn't seem to be cost effective. SSD if priced per 1GB is roughly two times cheaper then RAM but if we place our data on SSD we have to reserve at least two more time space on SSD if we want to be able to run repair on the data (this is because running repair requires two times more space). Other reason we considered using SSD as backing storage instead of HDD is write performance in some applications where it was a limitation. But from our limited benchmarking we found small performance difference because it looks like single thread write lock in MongoDB becomes a bottleneck rather then underlying storage.

d) minor point: underlying networking protocol could be more efficient with some optimizations. If you send many small queries and get small documents as result MongoDB creates separate TCP packets for each request/response. Under high load especially in case of virtualized hardware (i.e. EC2) this introduces additional high overhead. We have our own client driver which tries to pack multiple requests in single TCP packets and it makes noticeable difference in performance on EC2. But this is a partial solution because responses from MongoDB and communications between mongos and mongod are still inefficient.

e) another minor point: BSON format is very wasteful in terms of memory usage. Giving that we try to minimize our database sizes to reduce hardware costs the recent trend in our use of MongoDB is instead of representing data as BSON document do serialization to some more compact format and instead store our data as big binary blobs (i.e. to simplify our documents look like { _id = '....', data = '... serialized data ...'}

By the way at some point we evaluated switching to CitrusLeaf. This product supposedly addresses some of the above issues (mostly a, b and c) but it seems that expected savings in hardware costs would be offset by licensing costs so at least for now we are not going to.

37 comments:

Salocin.TEN (www.salocinten.info) said...

Thank you for the pointers.

I am currently starting out with MongoDB and so will take into account the points mentioned. :-)

Ac Jitu said...

After study a number of the websites with your site now, and that i genuinely appreciate your method of blogging. I bookmarked it to my bookmark site list and are checking back soon. Pls have a look at my web page likewise and let me know if you agree. https://royalcbd.com/product/cbd-gummies-10mg/

Kent Hu said...

Nice post, keep it up.
Hope you are well in the current situation.
b2b marketing service
Marketingcom
seo package

Bryan said...

Good content, hope you well and keep it up.
property management company malaysia

Ahmad Fakruden said...

That's interesting, thanks for sharing.
www.xessb.com
eddy current testing service
www.xessb.com/ndt-service/

luckydavid said...

Very interesting, good job, and thanks for sharing such a good blog.
https://incracked.com/wondershare-recoverit-crack/

maxis wireless broadband said...

Let’s read all these articles
https://www.lokaeats.com/wawa-menu-price-usa/
https://www.lokaeats.com/jack-in-the-box-menu-price-usa/
https://www.lokataste.com/texas-chicken-menu-malaysia

Anonymous said...

Web Design Malaysia Rebrand specialise in website design, e-commerce solutions, digital marketing, branding strategy and much more. We strongly believe that having a high-quality website doesn't necessarily need to cost a huge sum of money. Hence, we are a group of professionals that came together with a goal in mind: to deliver excellent web designs that provide value to our customers that range from startups to enterprises and large organisations.

Anonymous said...

supplement for knee pain malaysia Duplex® strives to be your trusted healthcare brand, a brand that will never settle for less than the best. We firmly believe your health matters. At Duplex®, we pledge to make your well being our priority. Our aim is to deliver effective, yet affordable healthcare simply because we believe good health makes living more meaningful. We are your trusted ally on the journey to attain a healthy mind, body and spirit.

Anonymous said...

joint supplements sg Duplex® strives to be your trusted healthcare brand, a brand that will never settle for less than the best. We firmly believe your health matters. At Duplex®, we pledge to make your well being our priority. Our aim is to deliver effective, yet affordable healthcare simply because we believe good health makes living more meaningful. We are your trusted ally on the journey to attain a healthy mind, body and spirit.

Anonymous said...

Established in 2002, RE2 International Computer School Malaysia was one of the first schools in Malaysia with a well-developed ICT curriculum for Primary School and Secondary school students. Our curriculum was heavily based on the national curriculums of The United States of America and United Kingdom.

Anonymous said...

Apple Swift Developer Certification RE2 Learning Solutions (Asia) Sdn Bhd was founded in 2016. The company is one of a leader in the field of professional IT training in Malaysia. Over the years, RE2 (Asia) has helped thousands of young learners, companies, government departments and agencies to improve and develop their IT skills.

Anonymous said...

Microsoft Office Specialist Malaysia RE2 Learning Solutions (Asia) Sdn Bhd was founded in 2016. The company is one of a leader in the field of professional IT training in Malaysia. Over the years, RE2 (Asia) has helped thousands of young learners, companies, government departments and agencies to improve and develop their IT skills.

Assignment Writing Help said...

We are a top rated assignment help online Online service here with experts specializing in a wide range of disciplines ensuring you get the assignments that score maximum grades.

Shintech said...

Bone Meal started out with an incredible objective of ensuring environmental sustainability through innovative green engineering. Our journey began as a fertilizer manufacturing company, utilizing available wastes and converting them into value-added nutrition for plants.

Unknown said...

Leo Pump , LEO GROUP is a national high-tech enterprise engaged in R&D, design, manufacturing, marketing and customer service providing for full range of pumps and pump integration system. LEO Group is the first listed company in Chinese pump industry.

Roan Parker said...

Canon.com/ijsetup Setup delivers amazing printing quality. Simply click on know more to get the complete information of the Canon Pixma Setup.

Max Turner said...

Visit ij.start.cannon | ij.start canon and find out the best way to download Canon printer drivers. Canon printers are ideal for every situation wherever you need a document, paper, or photo print or even if you wish to scan, fax, and do more.

All-in-one Canon Inkjet printers are suitable for home, business, school, and others to improve productivity. You can easily set up your Canon printer through drivers from Canon.com/ijsetup , wireless connection, USB, and a few components.

ethan potter said...

Canon IJ Network Tool you to watch out for the points mentioned below considerably:
If you want a LAN setup for your printer, you should have the required connectivity equipment such as Network Access Point (Router/ Modem), LAN Cable etc.To get your IJ Network tool to work, you first need to check your printer’s connectivity via LAN connection. Next, check your LAN cable carefully. Canon IJ Printer Utility you can alter your printer’s ink cartridge settings according to your requirements. If any ink cartridges get empty, you can continue to print with other available cartridges after changing the settings.

Shintech said...

Shintech started out with an incredible objective of ensuring environmental sustainability through innovative green engineering. Our journey began as a fertilizer manufacturing company, utilizing available wastes and converting them into value-added nutrition for plants.

Great Assignment Helper said...

Assignment is a new norm of every modern education system thus creating a need of Do my statistics assignment online websites. We are one of those who have been providing such help to students for years. A main reason behind our success is our trustworthiness. Trust us once with the most important part of your academic life and see how we make it shine.

Adam smith said...

Cricut.com/setup allows you to set up your new Cricut machine. Your Cricut machine lets you cut and craft multiple designs. One can easily print many types of materials by using creativity options. Setting up Cricut setup is easy, and once it’s set up, you can start crafting. Cricut machines are available in different types, including Cricut Joy, Cricut Maker 3, Cricut Maker, Cricut Explore 3, and Cricut Explore Air 2, and could be set up through design.cricut.com setup.

Emma keth said...

Download Cricut Design Space from Cricut.com/setup | Cricut com setup windows | cricut.com setup windows and install it to set up your Cricut machine. With the installation, you can easily move on to designing, cutting, and crafting. An account is essential to create that allows you to select multiple projects and keeps you updated.

Great Assignment Helper said...

In today’s world people are very much stucked in their personal works, same is happening with the students that’s why we have strated the services of the IT Assignment Help . Connect with us to avail this premium offer.

Marry James said...

Marry James is a writing Expert with 15+ years of experience. Marry is also associated with MyAssignmenthelp.com, where she regularly helps students write their essays/assignments. In addition, Marry also likes to read and has read more than 100 books now. Students prefer his services as a tutor and as a counsellor and guides students on academic issues. She offers HTML assignment help to students who need help with their papers. Marry is a programmer too, so she has detailed knowledge about the subject.

Other Service
write my essay for me
Top Essay Writing Service
English Essay Writing Help
Physics homework help
college essays help
Essay Editing Service
Fraction Calculator
Persuasive Essay Help
write my research paper
plagiarism checker
Book Review Writing
Title Generator
plagiarism checker
Nursing Resume
free tools
Harvard referencing generator
Summary Generator
fnsacc311 assessment answers
hltaid004 assessment answers

maxis wireless broadband said...

We should share good articles often
1.building management malaysia,
2. vacant possession malaysia
3. nic direct mercury analyzer

Adam smith said...

Log into Cricut.com/setup and get access to the vast range of existing design possibilities for a craft project. To access the Cricut com setup windows you need to download the Cricut Design Space Setup via cricut.com setup. You will then be able to access the numerous designs for your craft projects that you can use for home décor purposes or commercialise the product for a beneficial monetary deal.

simon said...

LaserJet Printer Setup
Configure your HP Printer hardware. Visit 123.hp.com/laserjet from the browser. Using your LaserJet model name, download software. Double click to start the installation. Connect the printer via wireless network or USB. Add the LaserJet printer to your system devices.Finish the HP LaserJet setup.

traviswills said...

Connecting the Cricut machine to a PC is enough, but setting up the machine on a mobile device makes it portable and easy to craft. If you want a direct and easy way to craft through your Android or iOS phone, then go through the to Cricut.com/setup |Cricut com setup windows | cricut.com setup connect to Cricut.

samrey said...

Log into
Cricut.com/setup |Cricut com setup windows | cricut.com setup
and get access to the vast range of existing design possibilities for a craft project. From a craft maker to an art lover, a skilled crafter, to just a beginner, anyone can benefit from Cricut’s gallery of countless designs. You only need to own a Cricut machine, and the next moment you are the maker of the innovative projects that lets you get to the core of satisfaction.

max kane said...

You can choose any project featured on your screen. If you want to begin using the new project, you will need to click on the New Project option from the My Projects section or directly by clicking on the green button in the right-side corner on the top Cricut Design Space Download | Cricut Design Space

maxis wireless broadband said...

There are many good information, so let’s share it out
1.disaster recovery,
2. injection molding
3. laporan cadangan pemajuan

Adam smith said...

ij.start.canon
is the manufacturer site to download Canon printer drivers. Install and set up Canon Printer from https: //ij.start.canon and obtain high-quality printing documents straightforwardly.

https//ij.start.cannon is actually the official site of ij start canon that helps you install the latest printer drivers and software. Visiting http //ij.start.cannon
provides you a complete list of all canon printers where you’ve to select your printer model and download the correct setup file

Adam smith said...

Log into Cricut.com/setup and get access to the vast range of existing design possibilities for a craft project. To access the Cricut com setup windows you need to download the Cricut Design Space Setup via cricut.com setup. You will then be able to access the numerous designs for your craft projects that you can use for home décor purposes or commercialise the product for a beneficial monetary deal.

cricut.com/setup is a software setup you can download on your systems via cricut.com/setup. The software brings forth the exceptional designs and images you can use to create beautiful craft projects.

Billy said...

That’s a great information. Thanks for sharing
non destructive testing malaysia, desa kiara condominium ttdi, and social media marketing

max kane said...

You get the editing options in the Design Space app, which allows you to edit images the same way as you do in other professional editing software. Cricut Design Space Download | Cricut Design Space

simonfrank said...

Log into
Cricut.com/setup |
Cricut com setup windows |
cricut.com setup |
cricut.com/setup
and get access to the vast range of existing design possibilities for a craft project. From a craft maker to an art lover, a skilled crafter, to just a beginner, anyone can benefit from Cricut’s gallery of countless designs. You only need to own a Cricut machine, and the next moment you are the maker of the innovative projects that lets you get to the core of satisfaction.