SQL Server and MongoDB comparison?

By : Lalith
Source: Stackoverflow.com
Question!

I was trying to compare and see if my database in SQL Server can be migrated to MongoDB for better performance. The database is pretty much schema less with lot of inserts and updates over the columns. Table is something like this (Primary key as Product_ID)

ProductID Part1 Part2 Part3 ... so on with lot of columns upto 70

So far I did not find any significant performance improvement with MongoDB. Both perform almost at same speed (Some times SQL Server jumps up and performs more updates). I am properly indexing the MongoDB database over ProductID which is the one I look while updating.

Is this type of database not suitable for taking advantage of MongoDB performance over SQL Server ?

Any comments or suggestions are welcome!

Regards, Lalith

By : Lalith


Answers

Common practice is to use "big" object in MongoDb. it is need for refuse to use any join. For example: use UserDocument that already have list of self orders and etc. I have experience in migrate from SQl to MongoDb.And i improve my system in several times. In the SQL Server we has over 100 tables, and now in mongo i have not more then 20.



Ok, there are lots of potential concerns here.

I am properly indexing the MongoDB database over ProductID which is the one I look while updating.

First thing to note is that Mongo uses an _id field for internal IDs. Put differently, Mongo automatically has an auto-increment ID (similar to a GUID, but smaller). The _id field automatically gets an index, so if you index on ProductID you may have two indexes where only one is necessary.

If you're using the NoRM driver, please look up on the usage patterns for "making your own IDs".

The database is pretty much schema less with lot of inserts and updates over the columns. Table is something like this... ProductID Part1 Part2 Part3

This concept of "parts" should perform fast and require a smaller footprint than SQL server. Notice that each document stores both the field name and the value. So if you have field names of p1 instead of Part1, you will use less space and get to keep more records in RAM.

So far I did not find any significant performance improvement with MongoDB...

This is where you have to go into details about your testing methodologies. How many documents. how much total space, how much RAM on the machine, how are you testing, etc?

Without more details it's simply not possible to provide specific guidance.

By : Gates VP


This video can help you solving your question :)
By: admin