Database Reference
In-Depth Information
1.1
Born in the cloud
The history of MongoDB is brief but worth recounting, for it was born out of a much
more ambitious project. In mid-2007, a startup called 10gen began work on a software
platform-as-a-service, composed of an application server and a database, that would
host web applications and scale them as needed. Like Google's AppEngine, 10gen's
platform was designed to handle the scaling and management of hardware and soft-
ware infrastructure automatically, freeing developers to focus solely on their applica-
tion code. 10gen ultimately discovered that most developers didn't feel comfortable
giving up so much control over their technology stacks, but users did want 10gen's new
database technology. This led 10gen to concentrate its efforts solely on the database
that became MongoDB.
With MongoDB's increasing adoption and production deployments large and
small, 10gen continues to sponsor the database's development as an open source proj-
ect. The code is publicly available and free to modify and use, subject to the terms of
its license. And the community at large is encouraged to file bug reports and submit
patches. Still, all of MongoDB's core developers are either founders or employees of
10gen, and the project's roadmap continues to be determined by the needs of its user
community and the overarching goal of creating a database that combines the best
features of relational databases and distributed key-value stores. Thus, 10gen's busi-
ness model is not unlike that of other well-known open source companies: support the
development of an open source product and provide subscription services to end
users.
This history contains a couple of important ideas. First is that MongoDB was origi-
nally developed for a platform that, by definition, required its database to scale grace-
fully across multiple machines. The second is that MongoDB was designed as a data
store for web applications. As we'll see, MongoDB's design as a horizontally scalable
primary data store sets it apart from other modern database systems.
1.2
MongoDB's key features
A database is defined in large part by its data model. In this section, we'll look at the
document data model, and then we'll see the features of MongoDB that allow us to
operate effectively on that model. We'll also look at operations, focusing on
MongoDB's flavor of replication and on its strategy for scaling horizontally.
1.2.1
The document data model
MongoDB's data model is document-oriented. If you're not familiar with documents
in the context of databases, the concept can be most easily demonstrated by example.
Listing 1.1
A document representing an entry on a social news site
{ _id: ObjectID('4bd9e8e17cefd644108961bb'),
title: 'Adventures in Databases',
url: 'http://example.com/databases.txt',
_id field
is primary key
Search WWH ::




Custom Search