Difference between Mirroring and Replication


In database management systems (DBMS), there are two terms namely mirroring and replication which are related to copying of data. Mirroring is defined as the process of copying a database to another location, while replication is defined as the process of copying the database objects from one database to another.

Read this article to learn more about mirroring and replication and how they are different from each other.

What is Mirroring?

Mirroring refers to keeping a backup database server for a master database server. If for some reason, the master database is down, then the mirror database can be used as an alternative for the master database.

In principle, only one database server is active at a time and the requests for database is served from one server only which is active. Therefore, we can define mirroring as a process of creating multiple copies of a database which are located on different server machines. For this reason, mirroring is also called as shadowing. In case of failure of the primary server, the data can be accessed from the mirrored database.

What is Replication?

Replication refers to keeping multiple copies of databases spread across multiple geographic locations. A classic example of replication is file servers which are replicated across continents so that the user can download the file from the nearest location to avoid network delays and any slow response. In other words, replication is defined as a process of distributing redundant data and other database objects across different databases for their enhanced availability to the users. Thus, replication increases parallel command execution.

The implementation of replication becomes easier in distributed databases. Note that replication can be done only on the data and database objects, and not on a complete database as a whole.

Now, let us discuss the differences between mirroring and replication in more detail.

Difference between Mirroring and Replication

The following are the important differences between Mirroring and Replication −

Key

Mirroring

Replication

Definition

Mirroring refers to keeping copies of database to a geographically different location.

Replication refers to creating multiple copies of data objects of a database for distribution efficiency.

Target

Mirroring is applicable on complete database as a whole.

Replication is done on database objects.

Cost

Mirroring is costlier than replication.

Replication is cheaper as compared to Mirroring.

Distributed Databases

Mirroring is not applicable in case of Distributed databases.

Replication can be easily implemented in case of distributed databases.

Location

Mirroring is done to create a copy of database on different hardware and on different location to serve as backup location.

Replication is done to create a copy of database objects and can be copied to a different database as well.

Conclusion

Both mirroring and replication are related to the copying of data in databases, but they are absolutely different from each other. The most significant difference that you should note here is that mirroring is applicable on a complete database as a whole, while replication is applicable on database objects only.

Updated on: 21-Feb-2023

4K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements