MongoDB is an open source, document-oriented database designed with both scalability and developer agility in mind. Instead of storing your data in tables and rows as you would with a relational database, in MongoDB you store JSON-like documents with dynamic schemas. The goal of MongoDB is to bridge the gap between key-value stores (which are fast and scalable) and relational databases (which have rich functionality). Binaries are available for Windows, Linux, OS X, and Solaris, MongoDB is available for free under the GNU Affero General Public License. The language drivers are available under an Apache License. In addition, 10gen offers commercial licenses for MongoDB. It’s network accessible, written in C++.
Features of MongoDB:
Article will continue after the ad
- Collection oriented storage – easy storage of object-style data
- Full index support, including on inner objects
- Query profiling
- Replication and fail-over support
- Efficient storage of binary data including large
- objects (e.g. videos)
- Auto-sharding for cloud-level scalability (Q209)
- High performance, scalability, and reasonable depth of functionality are the goals for the project.
10gen publishes apt-gettable packages. Their packages are generally fresher than those in the Debian or Ubuntu repositories. It contains only stable releases, under the name mongodb-10gen. This package might conflicts with the mongodb packages in Debian/Ubuntu (If you have it already installed).
Open Terminal (Ctrl + Alt + T).
First thing you need to add the GPG key for the MongoDB debian package.
raj@geeksite~/$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
Then we need to add repository in our system, so edit the following file.
raj@geeksite~/$ sudo gedit /etc/apt/sources.list
Add the following line.
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
Update the system repository.
raj@geeksite~/$ sudo apt-get update
raj@geeksite~/$ sudo apt-get install mongodb-10gen
MongoDB has it’s own controlling system, it can be start / stop by the easy known commands.
raj@geeksite~/$ sudo start mongodb raj@geeksite~/$ sudo stop mongodb
or using normal init scripts.
raj@geeksite~/$ /etc/init.d/mongodb start raj@geeksite~/$ /etc/init.d/mongodb stop
or using service command.
raj@geeksite~/$ service mongodb start raj@geeksite~/$ service mongodb stop
Confirm the version of MongoDB.
raj@geeksite~/$ mongod --version db version v2.0.3, pdfile version 4.5 Mon Mar 5 06:08:34 git version: 05bb8aa793660af8fce7e36b510ad48c27439697
That’s all. Now you have latest version of MongoDB installed on your machine.