Storing and retrieving data with MongoDB
MongoDB is a NoSQL database offering that a philosophy of over features. It's designed for and scalability. Instead working relationally, it implements a document-based model that has no need for schemas (column definitions). The document model works well for scenarios where the relationships between data are flexible and where minimal potential data loss is an acceptable cost for speed enhancements (a blog, for instance).
While it is in the NoSQL family, MongoDB attempts to sit between two worlds, providing a syntax reminiscent of SQL, but operating non-relationally.
In this task, we'll implement the same quotes database as in the previous recipe, using MongoDB instead of Postgres.
Getting ready
We want to run a server locally. It can be downloaded from http://www.mongodb.org/download-center (we may also be able to install it with our OS's package manager).
Once installed, let's start the MongoDB service, mongod
, in the default mode:
$ mkdir ./data...