MongoDB Series – windows installation

Brief about NoSQL

NoSQL stands for Not Only SQL , the next generation databases mostly addressing some of the points: being non-relational, distributed, open-source and horizontally scalable. Often more characteristics apply such as: schema-free, easy replication support, simple API, eventually consistent / BASE (not ACID), a huge amount, of data and more.

You can read more about NoSQL at

http://nosql-database.org/ and http://en.wikipedia.org/wiki/NoSQL

Introduction to MongoDB

MongoDB is a high-performance, open source NoSQL database, Written in C++.

http://www.mongodb.org/

MongoDB features

 – Document oriented storage.

  • JSON-style documents with dynamic schemas offer simplicity and power.

 – Full index support

  • Index on any attribute, just like you’re used to.

 – Replication and high availability.

  • Mirror across LANs and WANs for scale and peace of mind.

 – Auto-Sharding

  • Scale horizontally without compromising functionality.

 – Querying

  • Rich, document-based queries.

 – Fast In-Place Updates

  • Atomic modifiers for contention-free performance.

 – Map/Reduce

  • Flexible aggregation and data processing.

 – GridFS

  • Store files of any size without complicating your stack.

– Commercial Support

  • Enterprise class support, training, and consulting available.

How to setup MongoDB on Windows

First go to downloads link http://www.mongodb.org/downloads under the production releases and choose your compatible operating system, in our example I will use Windows 32-bit.

After download finish, unzip the file anywhere, I will unzip it on C: drive, for convenience you may rename this folder to mongo instead of mongo-xxxxxxxxxxx.

By default MongoDB will store data in \data\db, but it won’t automatically create that folder, so we do so here.

Note : If you prefer to place data files elsewhere, use the --dbpath command line parameter when starting mongod.exe.

We have two important binaries for the first run :

- mongod.exe which is the database server.

- mongo.exe The administrative shell.

To run the database, click mongod.exe in Explorer, or run it from a CMD window.

It will open a command window shows that the server is running and you will see the logs of the server.

Now we are ready to run the administrative shell by d-clicking on mongo.exe or from a New CMD window, which means the first window must be opened along running the administrative shell, otherwise you can run the server as a windows service (we will talk about it later).

By default it connects to mongodb server running on localhost and uses database test. To get some help run  mongo --help

Mongo shell is a JavaScript shell, try some JavaScript commands.

Or type help to get some useful commands.

Notice the created files on \data\db as we mention before that Mongo will store your databases files on this path.

Now we can do some actions with NoSQL database.

You can try it online at http://try.mongodb.org/

References

http://www.mongodb.org/

http://nosql-database.org/