Pages

Monday 19 September 2011

Mongo DB

MongoDB is an document-oriented DBMS. Think of it as a persistent object store. It is neither a relational database, nor even "table oriented" like Amazon SimpleDB or Google BigTable. If you have used object-relational mapping layers before in your programs, you will find the Mongo interface similar to use, but faster, more powerful, and less work to set up.

mongo_3

You can download and extract the binaries from here

Features of using Mongo DB:

1- MongoDB is in the sweet spot of performance and features. Its rich data types, querying, and in place updates reduced development time to minutes from days for modeling rich domain objects.  Chandra Patni

2- With foursquare’s growing popularity, we were fast approaching the point where it would no longer be feasible to store user check-ins on a single physical machine. MongoDB's auto- sharding capabilities enabled us to easily transition to a multi-node cluster that will enable us to continue to grow for the foreseeable future.    Harry Heymann

3- MongoDB supports full consistency and transactional updates.

4- MongoDB aims to provide greater agility and scalability for many applications by eliminating joins and relational modeling

 

You will find some useful tutorials for MongoDB : Tutorial here such as How to run MongoDB , Getting a database connection …. etc.

Sample code to connect to MongoDB :

string ConnectionString = "mongodb://localhost/Persons";

var server = MongoServer.Create(ConnectionString);
var db = server.GetDatabase("Persons");

MongoCollection<Person> collection = db.GetCollection<Person>("Persons");
var personRecords = collection.FindAll();
foreach (var p in personRecords)
{
      dataGridViewPersons.Rows.Add(p.Id, p.Name);
}

Some useful links and resources :

How to use MongoDB update operators

MongoDB and C#

CSharp Driver Tutorial

Connections

No comments: