Database Mirroring



What if the IT system in your company suddenly down or hangs, so the database engine crashes. Furthermore, in the event of a disaster, data can be lost.

Well, one way to do disaster recovery planning for data is to do a backup or copy of the data. There are many ways to choose from to create a backup. One of them is by using the mirroring method. Backup with Mirroring method.

Mirroring technology is the process of "copying" or "duplicating" a database to another place. So that one day it can be accessed if there is damage to the main server. In addition, recovery requires the most recent transaction records. For this reason, it is necessary to back up with the mirroring server method. This server mirroring method will later be useful for duplicating the database from the main server. So, later on, users can continue to work and process transaction data without the need for confusion due to the main data or the main server being hit by a disaster.

In fact, database mirroring is a form of Disaster Recovery Center (DRC) whose mechanism uses one-way file synchronization. Updated files are copied in real-time to one or more target locations from the source location, but no files are copied back to the source location. The function of the target location is to replace the source location function when experiencing problems. The placement of source locations and target locations generally has a minimum distance of 60 kilometers and is indifferent to geographical conditions.

Actually, the company could use a backup of its database. But backing up data from the database when a problem occurs suddenly generally takes a long time for the recovery process. In addition, the data stored is not in the last state position. In these conditions, database mirroring is required. Database mirroring aims to prevent unwanted things from happening to the company's database, such as the database engine crashing, the system hangs or down.

By running database mirroring, companies can run the Failover process (either automatically or manually). Failover is the process of taking over the functions of a dead primary database (principal server) to a secondary database (mirror server) so that the client computer does not know if there is a failure on the server. The reason is, the process carried out on a failed or dead server will be continued by the backup server.

Basically, if a company wants to run Failover manually, it only needs 2 servers, namely a server called Principal and Mirror. However, if you want an automatic Failover, you need one more server called Witness, which functions as a monitor for Principal and Mirror.

Principal and mirror servers communicate as partners in this mirroring, and each has a role as a principal role and a mirror role. But at some point, this role may change, which previously had a role as a principal to become a mirror, and vice versa. Mirroring can run synchronously or asynchronously, both methods have their advantages and disadvantages.

The synchronous model will be better in terms of data consistency because when a transaction occurs, it will be stored in 2 partners. But this will lead to an increase in cost latency for transactions. Meanwhile, the asynchronous transaction model will commit without waiting for the mirror server to finish writing data to the mirror database.

For the mirroring operating model itself, it is divided into 2 types, namely high-safety mode and high-performance mode. The high-safety mode runs in the synchronous model, while the high-performance mode runs in the asynchronous model.

What must be known, of course, to develop this mirroring system requires expensive costs. Therefore, in deciding whether mirroring is necessary or not, a cost and benefit analysis (CBA) is necessary.

In addition, because the cost is expensive, then this database mirroring is suitable to be implemented for systems with centralized databases. The main requirement for a centralized database is the means of communication or the communication data flow it supports. Also, this type of data is included in data that requires real-time updates such as banking, immigration, or customs blacklists.

So, database mirroring is very necessary for database systems that must operate continuously. And when a system failure occurs, the potential loss (direct or indirect) is very large, and the effort to repair it is so heavy and long that it exceeds the costs required for the manufacture and maintenance of the mirroring itself.

However, database mirroring is a simple strategy that offers advantages. First, improve data protection. Database mirroring provides complete or near-complete redundancy of the data, depending on whether the operating mode is high-security or high-performance. Second, improve database availability. In the event of a disaster, in high-security mode with automatic failover, fast failover brings a standby copy of the online database (without data loss). In another mode of operation, the database administrator has an alternative force service (with data loss) for the standby database copy.

Copyright © 2024 - PT. Indonesia Super Corridor - All Rights Reserved.