Database Reference
In-Depth Information
Improving Scalability
For web applications in particular, scalability is a critical design requirement, especially those that rely heavily on
backend databases. Replication can help you create more scalable applications in two ways:
Improve redundancy : Replication can help you improve redundancy by enabling you to host
an application in several data centers. In this approach, you ensure that there is a local copy of
the data in each data center, so that the application can have high-speed access to it. Users can
then be connected to the data center that is closest to them, minimizing latency.
Improve performance : Replication can under certain circumstances, help you improve an
application's raw performance. This is particularly true for cases where you have a large web
application with a predominantly read-based dataset, and you want to distribute queries
to multiple database servers to increase parallelism. Or with query loads that have widely
different working sets such as reporting or aggregation.
MongoDB also supports a feature called sharding, which is designed to assist you in creating more scalable
applications with or without replication for truly high scalability. See Chapter 12 for more information about using
sharding and replication together in MongoDB.
Note
Improving Durability/Reliability
Replication is commonly used to help guard against hardware failure or database corruption and allows flexibility
when performing backups or other potentially high-impact maintenance activity with little or no impact - as these
tasks can be performed individually on members of the set without impacting the set as a whole. Some specific
examples where people use replication in this manner include the following:
When you want to have a duplicate of your database that is running at a delay. You may want
to protect yourself against flaws in your application or provide a simple mechanism to provide
trend information by highlighting the differences between the results of queries against both
datasets. This can also provide a safety buffer for human errors and avoids the need to fully
restore from backup.
When you want a backup system in case of a failure. You may want to run a replica as a backup
in cases where normal backup schemes would take too long to restore in the event of a
system failure.
When you want a redundant system for administrative purposes. You may want to run a replica
so you can rotate between nodes for administrative tasks such as backups or upgrades.
Providing Isolation
There are some processes that, if run against the production database, would significantly impact that database's
performance or availability. You can use replication to create synchronized copies that isolate processes from the
production database, for example:
When you want to run reports or backups without impacting the performance of your
production system : Maintaining a hidden secondary replica enables you to isolate queries
from your reporting system and make sure that the end-of-month reports don't delay or
otherwise impact your normal operations.
 
 
Search WWH ::




Custom Search