Why MongoDB has better performance than SQL Server


We are doing PoC for migration of our data from SQL Server to MongoDB. Our workload is performing far better on MongoDB as compared to SQL server. But before the final migration, we have some specific questions that need to be answered. The main thrust of the questions is centred around the idea as to what makes MongoDB perform better than SQL Server.

  1. Data Storage - So we know MongoDB stores data as BSON and SQL server stores them as 8Kb pages. So does storing the data in form of BSON files makes it faster compared to SQL Server.
  2. Replication and Sharding - MongoDB provides support for repplication and sharding. But so does SQL Server. Is there any way that replication and sharding support in MongoDB outweighs that of SQL Server.
  3. Caching - Is the way MongoDB caches working set data more effective that the SQL server caching.

also, it would be great if links to any supporting documentation could be provided that will help us explain the superior performance of MongoDB over SQL Server.

Hi @b_singh, what is the basis of the performance comparison ? SQL Server is RDBMS Normal form Data Model,whereas MongoDB is Document NoSQL.

  1. Are you going to compare similar structure as in SQL Server - Table to table format (or)
  2. Change the Data Model with references similar to
    MongoDB Data Modeling

and compare it ?

Hi @Dominic_Kumar, the questions were asked to know that is there anything architecturally different in MongoDB that will add to a better performance when compared to SQL server. These questions direct to specific areas in MongoDB and try to compare them with SQL Server, to find answer for better performance of MongoDB.

We had changed the data model to de-normalized data form with embedded documents and arrays when we had designed our MongoDB schema. These questions were asked to get an in-depth view of MongoDB.

Hi @b_singh, MongoDB and SQL Server are totally different database. SQL Server is RDBMS and MongoDB is NoSQL Database.

For your Application, do you have Performance Baseline to compare with SQL Server (before) and MongoDB (current state) ??

Since you have changed the Data Model from SQL Server to MongoDB, how is your application performning now ?

What exact workload do you test? For example, Mongo can be drastically faster for writes at the cost of durability.

MongoDB and SQL databases serve different purposes and have different strengths, so it’s not necessarily a matter of one being universally “better” than the other. However, MongoDB does offer several advantages over traditional SQL databases in certain contexts.

One of the main advantages of MongoDB is its flexibility and scalability. MongoDB is a document-oriented database, which means that it stores data in flexible, semi-structured documents instead of tables with fixed schemas.

@b_singh MongoDB also offers strong support for modern application development practices, such as microservices and containerization. It has a rich set of APIs and integrations that make it easy to work with other popular tools and frameworks, such as Node.js and Docker. Ultimately, the choice between MongoDB and SQL will depend on your specific use case and requirements. Explore more on MongoDB and SQL and other databases