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

  • What is new in Firefox 11?Photo of What is new in Firefox 11?
    in the last days of 2011, mozilla released an update of its familiar web browser - firefox 11 aurora. this new version offers more outstanding features that can be used on both desktop and mobile devices.
  • Microsoft introduced a 'refresh' feature on Windows 8Photo of Microsoft introduced a 'refresh' feature on Windows 8
    the operating system expected in 2012 supports two refresh and reset features, allowing you to return to the initial default state or wipe the data.
  • 5 reasons to expect Windows 8Photo of 5 reasons to expect Windows 8
    here are 5 features and impacts of windows 8 operating system that will change your digital technology life in 2012.
  • Video navigation on Windows 8 with eyesPhoto of Video navigation on Windows 8 with eyes
    users can navigate on the computer or tablet by eye and activate features via a mouse or touch screen.
  • Chrome 17 blocks malware that helps usersPhoto of Chrome 17 blocks malware that helps users
    nine months after the test, the new chrome version has a mechanism to prevent users from accidentally downloading malicious software (malware) - google announced.
  • Experience the reality of Windows 8 pre-betaPhoto of Experience the reality of Windows 8 pre-beta
    windows 8 build 8175 is being demonstrated at ces 2012 and microsoft has demoed some of the latest features to the crowd of attendees. the most recent build includes a new touch to close the metro app in 'view' mode, improving the keyboard, mouse and port of the metro video / music app.