Compare the performance of MongoDB and SQL Server 2008

TipsMake.com - In the article below, we will point out the difference in performance of the relatively new database management system, which is MongoDB and one of the popular systems like SQL Server (MySQL or Oracle). Most of the data is given here in the form of charts, so we can easily imagine the advantages and disadvantages of MongoDB as well as other database management systems.

Compare the performance of MongoDB and SQL Server 2008 Picture 1
The chart is controversial about MongoDB inserting data more than 100 times faster than SQL Server

Imagine that you are establishing a system of online payment websites, which involves many different data units. If there is a database management system that operates faster than SQL Server many times, free of charge, it is easy to monitor and handle, your entire application system with LINQ (translated as query language Integrated into programming languages, MongoDB will certainly be a better choice.

And when there is such a database management system, we can deploy and operate on most of today's popular hardware devices, rather than high-end and dedicated server devices. It means that there is no need to buy or rent servers as before, and of course the initial cost must be much lower, while the profit or revenue is almost unchanged.

Another factor before we went into testing, member Kristina Chodorow from 10Gen organized a MySQL seminar in San Francisco with the Dropping ACID with MongoDB topic.

Here, Kristina has described quite specifically about SourceForge 's deployment experience in moving databases from MySql to MongoDB . On MySql platform, SourceForge has reached the limit of performance with a certain number of users. But with some changes in MongoDB options, the system has become much more stable.

Test model:

An intensive database model for online applications is enhanced to improve the ability to support as many users as possible. There will be many user accounts from online web applications, from API functions and many other related applications. Technically, users will interact directly with data by executing query statements, each of which corresponds to small pieces of data throughout the system. However, reality and theory are completely different, the above model is just what we are imagining.

Compare Insert function:

This is the most obvious difference between MongoDB and SQL Server :

Compare the performance of MongoDB and SQL Server 2008 Picture 2

This process is done by inserting 50,000 independent objects using NoRM of MongoDB and LINQ to SQL for SQL Server 2008 . The sample model is as follows:

Compare the performance of MongoDB and SQL Server 2008 Picture 3
MongoDB

Compare the performance of MongoDB and SQL Server 2008 Picture 4
SQL Server

Then, run 5 client applications into the database with the insert function:

Compare the performance of MongoDB and SQL Server 2008 Picture 5
MongoDB

Compare the performance of MongoDB and SQL Server 2008 Picture 6
SQL Server

And look closely at the most important piece of information shown here, which is the execution time:

Compare the performance of MongoDB and SQL Server 2008 Picture 7
MongoDB

Compare the performance of MongoDB and SQL Server 2008 Picture 8
SQL Server

Easy, you can see the difference between 2 seconds - MongoDB and 205 seconds - SQL Server. To ensure the authenticity of the results, we re-implemented the program based on ADO.NET, and the speed of SQL was raised to about 1.5 to 3 times the previous one. Making a simple calculation, MongoDB is still about 30-50 times faster than SQL.

Query speed comparison:

Next, we move on to the process of separating data from the same object in the ID field of each record:

Compare the performance of MongoDB and SQL Server 2008 Picture 9

Looking at the chart above, it is clear that MongoDB still outperforms SQL in terms of performance (about 3 times). To continue, let's standardize a slightly more complex data table with foreign keys - Foreign Key and join:

Compare the performance of MongoDB and SQL Server 2008 Picture 10
MongoDB

Compare the performance of MongoDB and SQL Server 2008 Picture 11
SQL Server

The results shown here are similar to previous tests without having to join:

Compare the performance of MongoDB and SQL Server 2008 Picture 12

All tests are done on Lenovo T61 laptop, 64-bit Windows 7 operating system with 2.8 GHz processor, using 64 bit version of SQL Server 2008 Standard and MongoDB. The entire sample you can download via MediaFire.

3.8 ★ | 12 Vote

May be interested

  • ObjectId in MongoDBObjectId in MongoDB
    you have seen the use of mongodb objectid in previous chapters. in this chapter, we will understand the structure of objectid.
  • Text Search in MongoDBText Search in MongoDB
    starting with version 2.4, mongodb started supporting text indexes to search within the string content.
  • Overview of MongoDBOverview of MongoDB
    mongodb is a cross-platform database, operating on the concepts of collection and document, it provides high performance, high availability and easy scalability.
  • Capped Collection in MongoDBCapped Collection in MongoDB
    capped collections are fixed-sized circular collection that follow the insert order to enhance the performance of create, read, and delete operations.
  • Shard in MongoDBShard in MongoDB
    sharding is a process of storing data records across multiple devices and it is a method of mongodb to meet the requirement for increasing data. when the size of the data increases, a single device cannot be enough to store data.
  • Learn about Java Driver in MongoDBLearn about Java Driver in MongoDB
    in the following article, we will introduce you some basic features of mongodv java driver as well as how to deploy and apply in practice.
  • Amazon AWS server will soon get extortion code, similar to MongoDBAmazon AWS server will soon get extortion code, similar to MongoDB
    amazon aws s3 cloud storage server may soon become a victim of malicious code, similar to the way hackers have kept many mongodb databases to extort money in 2017.
  • How to check for simple Linux server performanceHow to check for simple Linux server performance
    there are many options for virtual private servers or professional servers in the market, so how do i know which server is the best and suitable for me?
  • Install MongoDBInstall MongoDB
    instructions for installing mongodb on windows.
  • Adjust performance in SQL Server: find slow queriesAdjust performance in SQL Server: find slow queries
    adjusting sql performance is a never-ending battle. this article will provide some tips for you to find slow sql queries and perform performance tuning in sql server.