Database Reference
In-Depth Information
"book" : "The Relational Model for Database Management",
"employers" : [ "Royal Air Force", "IBM" ]
}
# Retrieve documents that contain a particular name
> db.example.find({"name":"michael"})
{
"_id" : ObjectId("51ab96791a4b9b1009e2c459"),
"name" : "michael",
"book" : "Data Just Right"
}
# Retrieve documents that contain a particular employer
> db.example.find({"employers":"Royal Air Force"})
{
"_id" : ObjectId("51ab9a041a4b9b1009e2c45c"),
"name" : "edgar",
"book" : "The Relational Model for Database Management",
"employers" : [ "Royal Air Force", "IBM" ]
}
Document stores are the right choice when you need a scalable database solution and
querying over the content of the data (and not just the key) is important. Examples of
this type of database include open-source software such as MongoDB and CouchDB.
Leaning toward Write Performance: Redis
On the surface, the multitude of distributed databases seems to cover a lot of the same
use cases. As a result, newcomers often face a great deal of confusion when trying to
choose a nonrelational database solution. In reality, each of the popular nonrelational
databases are very opinionated. Some are geared toward being easily distributed across
many machines at the expense of consistency. Others focus on raw speed of data writes
and reads. When trying to choose between one or the other, you must be opinionated
as well. The most important goal as a database decider is understanding your particular
use case.
For this example, let's choose a primary goal for our application and select an
appropriate database solution for reaching this goal. Along the way, we will learn
about the challenges faced when scaling our choice of database. An increasingly
common use case is applications that handle a great deal of database insertions very
quickly. Small developer teams might want to build a Web application that can handle
many messages from thousands or even millions of users. Perhaps the use case is an
application that scrolls a set of tweets that mention a particular television show during
a broadcast. Similarly, an application might require aggregating data from thousands
 
 
Search WWH ::




Custom Search