Database Reference
In-Depth Information
Chapter 11
Replication
Like many of its relational cousins, MongoDB supports the replication of a database's contents to another server
in real-time or near real-time. MongoDB's replication features are simple to set up and use. They are also among
the key features in MongoDB that, along with sharding, bolster the claim that the database is both a Web 2.0 and a
cloud-based datastore.
There are many scenarios where you might want to use replication, so the replication support in MongoDB has
to be sufficiently flexible that it can cope with all of them. The architects of MongoDB at MongoDB, Inc. have gone to
great lengths to make sure that its implementation of replication meets all of today's needs.
In this chapter, we will cover the basics of replication within MongoDB, including the following topics:
What is replication in MongoDB?
What is a primary?
What is a secondary?
What is the oplog?
Replication is a feature that continues to evolve in MongoDB, and you can expect some changes in how
replication works as the product develops. This is particularly true with respect to the clustering of database servers. There
have already been a number of changes between the first and second editions of this topic. MongoDB, Inc is investing
considerable effort in ensuring that MongoDB meets and exceeds everybody's expectations for scalability and availability;
replication support is one of the key features that MongoDB. Inc is counting on to help it meet those expectations.
Note
Before looking at replication setup in detail, let's review the goals the various setups are designed to achieve.
We'll also outline some of the fundamentals of how replication currently functions in MongoDB and look at the oplog
and its role in the replication of data between members of a replica set. These topics form the fundamental basis for
understanding replication.
Spelling Out MongoDB's Replication Goals
Among other things, replication can be used to achieve scalability, durability/reliability, and isolation. In the
upcoming sections, we'll explore how you can use replication to achieve these goals along the way, while pointing out
potential traps and mistakes to avoid.
 
 
Search WWH ::




Custom Search