Read More

Magento 2 MongoDB Integration

Magento 2 MongoDB Integration : As we are the largest supplier of Marketplaces and Multichannel ingratiation. There is always a topic of discussion about choosing right tools.

Nosql is one of such tools. lots of our customers are asking the query again and again. Do they need to switch to MongoDB or Cassandra ( NoSQL )? Over Mysql? ( RDBMS )

Or they should start from Magento 2 MongoDB Integration ?

Before reaching the conclusion I would like to ask a couple of questions. First and foremost important one is

There are a couple of answers to this questions. Sometimes customers say it scales well and you can shard the data easily.

Diagram of a sample sharded cluster for production purposes. Contains exactly 3 config servers, 2 or more ``mongos`` query routers, and at least 2 shards. The shards are replica sets.

Source :


Also, replication is something super scalable and easy to manage, unlike MySQL. You can easily add more and more cluster for slaves.

There are a lot of other advantages of MongoDB over mysql. I totally agree with that.

But But But do I need to replace the Magento 2 RDBS (MYSQL) with MongoDB? Well, I would suggest big NO.

Indeed and this is very true. You must not use anything in your e-commerce store randomly. You must investigate where the problem is?

Even I was quite stunned customers having less than 100 customers concurrently and they are blaming Magento or mysql for slow performance.

For sure MongoDB will not be useful for this case.

MongoDB has brilliant use case on their website –

And I would recommend everyone to check that out. Specially product catalog model part –

Even I am a great supporter of MongoDB for product catalog part when you have loads of 1000+ variants and combinations in every product.

But not as a replacement. Magento 2 works really well with existing tools. They have optimized a lot. Example – MVVM approach for the shopping cart.

In any Ecommerce system product model is not everything. Obviously you have other entities as well – Orders and customers and as per my knowledge there is no replacement for that in magento 2 at the moment.

Even recently we got the news for “MongoDB gets support for multi-document ACID transactions” –

Which will be for sure a plus for any commerce system built on MongoDB.

Also I hope Magento team will release more database driver support in future.

There are thousands of options to scale your e-commerce marketplace or shop with the existing setup. Replacing MySQL with MySQL is not the only option. There are plenty of work around.

If that is the case. You must think not for the today but for the future updates, templates, and 3rd party plugins as well.

For sure it will be hard and on every update again you need to update everything and for sure that will be a mammoth task.

But against all odds, if you want to use MongoDB, you should use it for product catalog model. And you must create a kind of adapter between Magento 2 and MongoDB in this way you should not alter any code at Magento end.

You can easily create the product API and manage the product catalog model at MongoDB end.

Again my conclusion is you must investigate why you need NoSQL with Magento 2? because I am 100% sure there are tons of options for the same.

But if you are doing so go with more like a micro-services kind of architecture. And use the mysql+nosql together. In this way, you will get the complete boost.

Please let me know if you have any further doubts.


Add Your Comment

Be the first to comment.

Need Any Help?

Got Stuck with something serious or you wish to hire us for a while. We are here to hear from you, feel free to reach us and we'll get back to you as soon as possible.

Contact Us