amateur
amateur

Reputation: 44605

integration between mvc4 application and mongo db

I am currently working on asp.net mvc4 web application. Part of the application, users can log in and browse the site etc. The data for the site is stored in a sql server database, contains users information etc.

A new feature to the site will be for all users to add comments to particular products shown on the site. As there could be hundreds of thousands of customers and thousands of products, this is alot of data.

So I have started looking at a NoSql option for this data and not store it in the relational sql server database. I have been looking at Mongo Db. My first question, is this a correct approach I am taking?

Next topic, how easily does c#/.net integrate with a mongo database. I havent worked with this before so my knowledge in the area is poor. Ideally, I would be querying (for the want of the correct term) the mongo db for comments based on a particular products identifier. I presume I can write a query style to get this data.

My next question is around the redundancy of a mongo db. With sql server, I have a fail over server if an issue occurs with the main db server. Is there a similar concept with mongo or how does it work? My consideration is for mongo to run on the same server as the sql server database. The data in the mongo db will not be mission critical, but the data in sql server is. My web application will run on multiple servers in a load balanced environment.

Can a mongo db be easily moved to another server? ie. how well can it be scaled out. Even can data from it be copied to another mongo db?

I appreciate my questions are of a beginner standard but I am currently researching the topic so assistance would be great.

Upvotes: 1

Views: 873

Answers (4)

Serdar
Serdar

Reputation: 1516

the thing is in mongodb design you will do a kind of denormalization...

and in my opinion hundreds of thousands user case your sql server is enough... do some more denormalizations in your db design and try implementing good cache design....

you say you are new to mongodb... so there is going to be a learning curve... put more rams and cpus till you will have millions users...

to feel safe with mongodb you are going to need at least 3 servers

please also check this link

is this the optimal minimum setup for mongodb to allow for sharding/scaling?

Upvotes: 0

MrCode
MrCode

Reputation: 35

If you have not hardware memory problem(you can buy a lots of memory , you will need) Mongo can be your solution.

Upvotes: 0

Matthew Kruskamp
Matthew Kruskamp

Reputation: 1887

Sql server should suffice for housing comments as long as you have some caching configured. The good thing about Sql Server is the data integrity of the foreign keys as well as the querying power.

However, working with Mongo in C# is not a huge deal. There is a slight learning curve, but this is with learning any new technology.

Connecting and Using MongoDB

MongoDB has official drivers and NuGet packages for you to use. http://www.mongodb.org/display/DOCS/CSharp+Language+Center for more information there.

Redundancy

Mongo supports replica sets where your second server would mimic all the data from the first server. Information on setting this up can be found here: http://docs.mongodb.org/manual/tutorial/deploy-replica-set/ It should be noted though that querying is a bit different in MongoDB than Sql Server.

Now I personally use mongoDB in one of my enterprise applications, but I would say as a rule of thumb: If you don't absolutely need to use it you would probably be better off sticking with one database engine. Mostly so that you only have to manage one database engine. Just my opinion though. Maybe redis for caching?

Upvotes: 1

Related Questions