Mongodb for ecommerce shop

With a series of Google searches, I came across a series of objections about MongoDB for the online store For example

And now I have a project that is an online store with nodejs and mongoose In your opinion, according to update 4 that acid and multi doc is supported, is there a problem for such a project (because I am almost finish it :()

This Store has about 5,000 products and 1500 visitors per a day now use WooCommerce!

Welcome to the MongoDB community @Arash_Soft!

When doing research, it is important to check the dates on sources as information can be outdated quickly with a rapidly evolving product like MongoDB. The original discussion you found from mid-2016 predated the addition of some relevant features like a Decimal Data Type in MongoDB 3.4 (released in Nov 2016), multi-document transactions (added for replica sets in MongoDB 4.0 in Aug 2018 and expanded to sharded clusters in MongoDB 4.2 a year later), and Client-Side Field Level Encryption in MongoDB 4.2.

Some of the 2016 discussion also presumed that multi-document transactions are a requirement for ecommerce use cases, which is not strictly true for MongoDB depending on your schema design. As noted in the MongoDB 4.0 update you referenced:

In MongoDB, the data model is fundamentally different. The document model encourages users to store related data together in a single document. MongoDB, has always supported ACID transactions in a single document and, when leveraging the document model appropriately, many applications don’t need ACID guarantees across multiple documents.

MongoDB has been used for ecommerce applications for years prior to the introduction of Decimal types and multi-document transactions, but modern server features significantly improve performance and ease of development.

I highly recommend reading through some of the schema design resources including the series on patterns & anti-patterns:

You may also be interested in MongoDB Atlas for managed hosting. Atlas undergoes independent verification of platform security, privacy, and compliance controls (see the Trust Center for more info) and has integrated features like a rich full-text search based on Apache Lucene and data visualisations using MongoDB Charts.


1 Like