Research and implementation of heterogeneous database replication technology (on)

zhaozj2021-02-16  56

Research and implementation of heterogeneous database replication technology

1 Introduction

The rapid development and extensive application of network technology, especially the popularity of the Internet, greatly facilitating the cross - regional development of the enterprise. At the same time, in order to adapt to the growing business competitive environment, many companies have improved efficiency by continuously restructuring and dispersion operations, forming a dispersion, isomeric environment. At the same time, these organizations are dispersed in the region, but in terms of management, there are often partial control and dispersion management of various departments, but also have global control and high-level collaborative management of the organization. This collaborative management requires information between the various departments to communicate and sharing in all departments, but also manage and use.

Currently, distributed database technology has been mature and has been widely used due to a decrease in computer costs and a decrease in communication costs. However, distributed database systems must provide local autonomy to achieve global control, bringing great challenging. To this end, the introduction of the database replication mechanism, the database replication depends on distributed database technology but can provide the functionality that the distributed database is not available, especially if there is an optional data copy in the access data, the performance of the system can be improved. And protect the availability of applications. Centralized and autonomous control mechanisms can be achieved by using the replication technology of the database, and the reliability and response speed of the entire distributed database system can be greatly improved.

Existing heterogeneous database replication schemes have highlighted, such as the obvious advantages in operation performance and overall performance, and most of the manufacturers provide some auxiliary tools to help users better complete replication tasks; but at the same time The replication scheme provided by the database product depends on the close-up implementation technology of the company's own DBMS core relationship. It is not necessarily suitable for other DBMS, which means that the replication scheme is not completely heterogeneous.

In order to solve the complete heterogeneity problem, this paper proposes a new copy technology: "SQL reproduction method" replication technology, "SQL reproduction" Core thinking is the core idea of ​​replication technology is to copy objects in the source database (source table or View) Creating a change track table, when the source table changes, the change track table records the change, and then obtains the data in the source table to the target table from the change trajectory table, then obtain the SQL statement from the change track table. This method can obtain the net change in replication objects, high operation and transmission efficiency, and easy to manage, compensate for the shortcomings of resolving copy conflicts. This method is suitable for various replication forms other than synchronous replication.

This article will introduce "SQL reproduction" replication techniques from several aspects such as working principle, design thinking, implementation process, and technical features.

Database replication is to keep the source database synchronization with the specified data in the target database by copying the data specified in the source database to the target database. It should be made up of this part of this, there is no unified view.

This article describes the flow of database replication: obtains the change of replication objects in the source database, and then transfer them to the target database from the source database, and modifies the copy.

According to the above description, this paper divides the entire replication process into two functions relative to independent processing: Change Capture and Data Distribute, call them into two main links that make up the database replication.

The content later in this paper will be elaborated around these two links.

2 Working principle

(1) Change capture

Change capture is the process of capturing changes in the source table. "SQL reproduction" data replication technology Capture change is the core idea for multiple associated source tables (extreme cases may be a source table or all tables of the entire database, here is called a "source set") to create a change The trajectory table, which contain information such as the sequence number, change time, and the restored SQL statement. When the source table changes, the change of the lower source table is recorded in the change trajectory table, and the change track table is quite The change time is equivalent to the "timestamp" based on the time stamp method, but because the process is not implemented by the database engine itself, it is necessary to rely on the trigger. That is, it is necessary to establish a trigger for each source table. When the source table is modified, inserted, and deleted, the flip-flop is started, and the operation of the source table is restored to the SQL statement by calling the stored procedure. The table corresponding to the change track table is inserted into the change time and the restored SQL statement, and the working principle is shown below. Figure 1 "Data Replication Based on SQL Reproduction" Change Capture Working Principle

(2) Data distribution

Data distribution refers to the process of implementing changes in the source table to the corresponding target table. A method of capturing changes in the "Based sql reproduction method", data distribution refers to obtaining the corresponding SQL statement from the change track table according to the sequence number in the change track table, and then performs this on the target server in order according to the sequence number in the change trajectory table. The SQL statement is applied to the target table in the target table, and the record of the corresponding sequence number in the change track table is executed. The principle of data distribution work is shown in Figure 2.

Figure 2 "Data Replication Based on SQL Reproduction" Data Distribution Work Principle

转载请注明原文地址:https://www.9cbs.com/read-21795.html

New Post(0)