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.
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.
This is the most obvious difference between MongoDB and SQL Server :
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:
MongoDB
SQL Server
Then, run 5 client applications into the database with the insert function:
MongoDB
SQL Server
And look closely at the most important piece of information shown here, which is the execution time:
MongoDB
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.
Next, we move on to the process of separating data from the same object in the ID field of each record:
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:
MongoDB
SQL Server
The results shown here are similar to previous tests without having to join:
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.