MongoDB is an open source NoSQL database developed by 10Gen and is written in C++. It is different from MySQL as it is document based and not table-based. MongoDB is fast, its development time is quick as it is schemaless and has very little data mapping.
Another reason for its fast working is because MongoDB is a document-oriented database that means it stores the entire document rather than storing data as rows in tables. It is easy to crawl and pick up anything even horizontally, which was not possible in MySQL. Indexing is easy too as any field in a MongoDB document can be indexed.
MongoDB stores data in JSON documents
There are many advantages of using MongoDB by PHP developers:
MongoDB also provides tools for querying, creating, updating, and deleting. It scales horizontally using Auto-Sharding and stores large media with GridFS.
Gaming companies, e-commerce companies, content management companies and various other companies can benefit form using MongoDB. Some companies like MTV Networks, Craigslist, Foursquare and UIDAI (Aadhaar) have already started using it and have shown benefit.
Example of MongoDB:
'title' => 'RoseIndia',
'authors' => array('Bipul', 'Gopal', 'Amit'),
'body' => 'Rose India',
'tags' => array('tag4', 'tag5', 'tag6')
How to set up MongoDB for Windows?
Download the MongoDB binaries from its official mongodb.org/downloads. It will be a zipped file. Unzip the downloaded binaries to a folder.
Then create a folder where MongoDB will store its data.
Run this command in your shell:
C:\> mkdir \data
C:\> mkdir \data\db
Finally, Run MongoDB. Go to MongoDB folder and run the mongod.exe:
C:\> cd \my_mongo_dir\bin
To open the shell admin console, use this command:
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: April 17, 2013 If you enjoyed this post then why not add us on Google+? Add us to your Circles