Skip to content

mongodb

John Lusher II edited this page Feb 21, 2016 · 10 revisions

Introduction to MongoDB

MongoDB is a free and open-source NoSQL document-oriented database. MongoDB is currently the most popular database for document storage and one of the more popular database management systems worldwide. MongoDB is a NoSQL database and does not use the traditional relational table structure databases but instead use JSON-like document (called BSON - Binary JSON) and builds a dynamic schema.

NoSQL is a type of database that is simplistic and used increasingly for big-data and real-time web applications. NoSQL enables scalability to clusters of servers.

Some notable example of MongoDB being used in industry include:

  • Large-scale deployments of MongoDB are tracked by MongoDB Inc. Notable users of MongoDB include: Craigslist: With 80 million classified ads posted every month, Craigslist needs to archive billions of records in multiple formats, and must be able to query and report on these archives at runtime. Craigslist migrated from MySQL to MongoDB to support its active archive, with continuous availability mandated for regulatory compliance across 700 sites in 70 different countries. [https://www.mongodb.com/customers/craigslist]

  • eBay uses MongoDB in the search suggestion and the internal Cloud Manager State Hub.[http://www.slideshare.net/mongodb/mongodb-at-ebay]

  • LinkedIn uses MongoDB as its backend DB.[https://www.mongodb.com/presentations/building-linkedins-learning-platform-mongodb]

  • Shutterfly uses MongoDB for its photo platform. As of 2013, the photo platform stores 18 billion photos uploaded by Shutterfly's 7 million users.[https://gigaom.com/2011/01/28/real-world-nosql-mongodb-at-shutterfly/]

List of the key differences between SQL and NoSQL (MongoDB) [https://www.mongodb.com/nosql-explained]:

How to begin development with MongoDB

https://www.mongodb.org/downloads#production

For Ubuntu Server 15.10 getting MondoDB installed and up and running wasn't too difficult. Though not completely straightforward. Below are the steps:

  1. Import the public key used by the package management system sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927

  2. Reload local package database sudo apt-get update

  3. Install the MongoDB packages sudo apt-get install -y mongodb-org

  4. Create a file /lib/systemd/system/mongodb.service and include
    [Unit]
    Description=High-performance, schema-free document-oriented database
    After=network.target
    [Service]
    User=mongodb
    ExecStart=/usr/bin/mongod --quiet --config /etc/mongodb.conf
    [Install]
    WantedBy=multi-user.target

  5. Install Upstart
    sudo apt-get install upstart-sysv

  6. Reboot Server

  7. Start the MondoDB service
    sudo service mongod start

You are now ready to build databases and use various APIs to access the MongoDB from your applications. MongoDB has a shell based interface and does not have a GUI as such. However, if you want there are GUIs to enabled configuration and management of your databases. One such interface is located here https://www.npmjs.com/package/mongo-express.

A tutorial on using MongoDB and interfacing a database is located here http://www.tutorialspoint.com/mongodb/.

For more information and references please see:
https://www.mongodb.com/ https://www.mongodb.com/nosql-explained https://en.wikipedia.org/wiki/MongoDB https://en.wikipedia.org/wiki/NoSQL https://en.wikipedia.org/wiki/BSON

Clone this wiki locally