Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
DATA REPLICATION METHOD AND SYSTEM FOR DATABASE MANAGEMENT SYSTEM
Document Type and Number:
WIPO Patent Application WO/2008/143408
Kind Code:
A1
Abstract:
Disclosed is a data replication method in a Database Management System (DBMS). The data replication method includes generating a replication log through a transaction log of a master database to thereby transmit the generated replication log to a distributor, determining a slave host distributing the replication log to thereby distribute the replication log to the corresponding slave host, and reflecting the replication log in a slave database.

Inventors:
JIN EUN SOOK (KR)
PARK KI EUN (KR)
KIM GAB YOUNG (KR)
SEO JAE BONG (KR)
Application Number:
PCT/KR2008/002421
Publication Date:
November 27, 2008
Filing Date:
April 29, 2008
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
NHN CORP (KR)
JIN EUN SOOK (KR)
PARK KI EUN (KR)
KIM GAB YOUNG (KR)
SEO JAE BONG (KR)
International Classes:
G06F17/40
Foreign References:
JPH11327988A1999-11-30
US20060136686A12006-06-22
Other References:
See also references of EP 2150910A4
Attorney, Agent or Firm:
MUHANN PATENT & LAW FIRM (6th Floor Myeonglim Building,51-8 Nonhyeon-dong, Gangnam-gu, Seoul 135-814, KR)
Download PDF:
Claims:

CLAIMS

1. A data replication method in a Database Management System (DBMS), the data replication method comprising: generating a replication log through a transaction log of a master database to thereby transmit the generated replication log to a distributor; determining a slave host distributing the replication log to thereby distribute the replication log to the corresponding slave host; and reflecting the replication log in a slave database.

2. The data replication method of claim 1, wherein the replication log includes modifications of the master database, and the generating of the replication log includes: analyzing the transaction log in a replication server included in a master host to thereby generate the replication log being composed of the modifications; and transmitting the replication log from the replication server to a replication agent included in the distributor.

3. The data replication method of claim 2, wherein the replication server acts as a processor for processing a transmission request with respect to the transaction log received from at least one replication agent, and includes a first thread for processing the transmission request and a second thread for verifying the transaction log through the master database.

4. The data replication method of claim 2, wherein the replication server temporarily stores the replication log using a plurality of buffers when a plurality of replication logs are generated in the transaction unit, and transmits the temporarily stored replication log to the replication agent of the corresponding distributor.

5. The data replication method of claim 1, wherein the distributor includes a distribution database and a replication agent, and the determining of the slave host includes: receiving the replication log from the replication agent to thereby temporarily store the received replication log;

verifying the slave host using the distribution database from the replication agent; and transmitting the replication log from the replication agent to the corresponding slave host.

6. The data replication method of claim 5, wherein the distribution database includes disposition information of a master host and a slave host.

7. The data replication method of claim 5, wherein the replication agent temporarily stores each of a plurality of replication logs, when the plurality of replication logs are received, and then distributes the temporarily stored replication logs to the corresponding slave host.

8. The data replication method of claim 5, wherein the determining of the slave host further includes: generating a tracking log with respect to the replication log from the replication agent, and the tracking log includes a log serial number with respect to the replication log finally applied for each slave database included in the respective slave hosts.

9. The data replication method of claim 5, wherein the determining of the slave host further includes: generating an error log with respect to the replication log from the replication agent, and all errors generated while the replication agent performs a replication operation are recorded in the error log.

10. The data replication method of claim 1 , wherein the transaction log corresponds to all modifications generated in the master database, and includes: an undo log for archiving a previous data image in order to abort an updating operation and a redo log for archiving a data image obtained after performing the updating operation in order to again perform the updating operation, and the replication log

includes the redo log.

11. The data replication method of claim 1, wherein the master database acts as an original database to be an object of the replication, and all database operations are allowed to be performed in the master database, and the slave database acts as a database to be a destination of the replication and reflects modifications of the master database.

12. The data replication method of claim 1, further comprising: reflecting, in the slave database via the distributor, modifications with respect to a schema of the master database; and reflecting, in a distribution database included in the distributor, modifications with respect to at least one of an index, trigger, and user account of the master database, wherein the distributor reflects, in a slave host acting as another master host when a fault occurs in the master host, the at least one of the index, trigger, and user account.

13. The data replication method of claim 1, wherein a master host including the master database and the slave host are composed with a ratio of N:M therebetween according to user's needs, and an asynchronous replication is performed through at least one distributor between the master host and the slave host.

14. A computer-readable recording medium storing a program for implementing the method of any one of claims 1 to 13.

15. A data replication system in a Database Management System (DBMS), the data replication system comprising: a master host for generating a replication log through a transaction log of a master database to thereby transmit the generated replication log to a distributor; the distributor for determining a slave host distributing the replication log to thereby distribute the replication log to the corresponding slave host; and the slave host for receiving the replication log to thereby reflect the received

replication log in a slave database.

16. The data replication system of claim 15, wherein the replication log includes modifications of the master database, and the master host includes: a master database acting as an original database to be an object of the replication; and a replication server for analyzing the transaction log of the master database to thereby generate the replication log being composed of the modifications, and transmitting the generated replication log to the distributor.

17. The data replication system of claim 16, wherein the replication server processes a transmission request for the transaction log received from at least one replication agent.

18. The data replication system of claim 15 , wherein the distributor includes : a distribution database including disposition information of a master host and a slave host; and a replication agent for performing data replication using the replication log.

19. The data replication system of claim 18, wherein the replication agent includes: a storing unit for receiving the replication log received from the master host to thereby temporarily store the received replication log; a slave host verifying unit for verifying the slave host using the distribution database; and a transmitting unit for transmitting the replication log to the corresponding slave host.

20. The data replication system of claim 15, wherein the master host further includes: a first modification reflecting unit for reflecting, in the slave database through the distributor, modifications with respect to a schema of the master database; and a second modification reflecting unit for reflecting, in the distribution database

included in the distributor, modifications with respect to at least one of an index, trigger, and user account of the master database.

21. The data replication system of claim 15, wherein the transaction log corresponds to all modifications generated in the master database, and includes: an undo log for archiving a previous data image in order to abort an updating operation, and a redo log for archiving a data image obtained after performing the updating operation in order to again perform the updating operation, and the replication log includes the redo log.

22. The data replication system of claim 15, wherein the master host and the slave host are composed with a ratio of N:M therebetween according to user's needs, and an asynchronous replication is performed through at least one distributor between the master host and the slave host.

Description:

DATA REPLICATION METHOD AND SYSTEM FOR DATABASE MANAGEMENT SYSTEM

Technical Field The present invention relates to a data replication method and system in a

Database Management System (DBMS).

Background Art

Database replication is a technique for copying an object stored in a single database to another database physically separated to thereby be used in at least two database servers in a distributed database scheme. This replication technique may distribute accesses of application programs using the same object to various database servers, thereby increasing the performance or allowing a replicated database server to have other applications, and thus simultaneously satisfying different operation requirements. Also, the replicated database may be rapidly replaced when faults occur in a database server during the operation, thereby significantly increasing reliability.

The above-described replication technique may be utilized when a single database server fails to satisfy requirements for the performance of the application programs. For example, read operations are distributed to various database servers with identical data, thereby improving the performance of the entire system.

FIG. 1 is an example used for describing a structure of a replication system for load distribution according to a conventional art. In the case of general replication, a master database may allow read and write operations, however, a slave database may allow only the read operation, and thereby performance-improvement effects using the data replication may have limitations for write operations, and show dramatic improvements for read operations. Thus, many applications such as a blog, bulletin board, news, and the like which are used for Internet services and the like may be included in the above general replication. Specifically, data in web services 101 may be stored in a master database 102 through a write operation, and modifications of the master database 102 may be reflected in slave databases 103 to 105 using the replication technique. Also, data may be provided through the read operation. In this instance, the data may be provided via the slave databases 103 to 105 in view of characteristics of

the web services 101 having a significantly high frequency of occurrence of read operations as opposed to write operations. As described above, when using the replication technique, an aggregate load in the database may be distributed, and any one of slave hosts may replace a master host when a fault occurs in the master host including a master database, thereby increasing reliability.

However, as for the replication technique of the conventional art, there arise several problems in that change of a schema may not be replicated in the slave database, change detail-automatic extraction via the slave database may be impossible, and a desired replication environment such as a ratio of the master host to the slave host of N:M may be difficult to be achieved. Also, disadvantageously, an object to be replicated may be designated only in a database unit, a replication delay time may be difficult to be measured, and data synchronization status between the original and the replication may be difficult to be confirmed. Also, disadvantageously, a master transaction archival log may not be confidently eliminated by checking the replication processing status.

Disclosure of Invention

Technical Goals

An aspect of the present invention provides a new technique for a data replication method and system in a Database Management System (DBMS).

An aspect of the present invention provides a data replication method and system in which an aggravated load in a database may be distributed through a master database, a slave database, and a distributor, any one of slave hosts may be replaced with a master host when a fault occurs in a master host including the master database, thereby effectively coping with the fault, and changed contents with respect to only the slave database may be rapidly collected even when periodical collection with respect to simultaneously updated data is needed.

An aspect of the present invention provides a data replication method and system in which, when a schema is changed in a master database of a master host, the change may be replicated in the slave database of the slave host, and a desired replication environment such as a ratio of the master host to the slave host of N:M may be configured.

Technical solutions

According to an aspect of the present invention, there is provided a data replication method in a Database Management System (DBMS), the data replication method including: generating a replication log through a transaction log of a master database to thereby transmit the generated replication log to a distributor; determining a slave host distributing the replication log to thereby distribute the replication log to the corresponding slave host; and reflecting the replication log in a slave database.

In this instance, the replication log includes modifications of the master database, and the generating of the replication log may include: analyzing the transaction log in a replication server included in a master host to thereby generate the replication log being composed of the modifications, and transmitting the replication log from the replication server to a replication agent included in the distributor.

Also, the replication server may act as a processor for processing a transmission request with respect to the transaction log received from at least one replication agent, and include a first thread for processing the transmission request and a second thread for verifying the transaction log through the master database.

Also, the replication server may temporarily store the replication log using a plurality of buffers when a plurality of replication logs are generated in the transaction unit, and transmit the temporarily stored replication log to the replication agent of the corresponding distributor.

Also, the data replication method may further include: reflecting, in the slave database via the distributor, modifications with respect to a schema of the master database, and reflecting, in a distribution database included in the distributor, modifications with respect to at least one of an index, trigger, and user account of the master database. In this instance, the distributor reflects, in a slave host acting as another master host when a fault occurs in the master host, the at least one of the index, trigger, and user account.

According to an aspect of the present invention, there is provided a data replication system in a DBMS, the data replication system including: a master host for generating a replication log through a transaction log of a master database to thereby transmit the generated replication log to a distributor; the distributor for determining a

slave host distributing the replication log to thereby distribute the replication log to the corresponding slave host; and the slave host for receiving the replication log to thereby reflect the received replication log in a slave database.

In this instance, the replication log may include modifications of the master database, and the master host may include a master database acting as an original database to be an object of the replication, and a replication server for analyzing the transaction log of the master database to thereby generate the replication log being composed of the modifications, and transmitting the generated replication log to the distributor.

Brief Description of Drawings

FIG. 1 is an example used for describing a structure of a replication system for load distribution according to a conventional invention;

FIG. 2 is a schematic diagram illustrating a data replication system according to the present invention;

FIG. 3 is a flowchart illustrating a data replication method in a Database Management System (DBMS) according to an exemplary embodiment of the invention;

FIG. 4 is a flowchart illustrating a method for generating a replication log in a master host to transmit the generated replication log to a distributor according to an exemplary embodiment of the invention;

FIG. 5 is an example used for describing a transaction log and replication log according to an exemplary embodiment of the invention;

FIG. 6 is a flowchart illustrating a method for distributing a replication log in a distributor according to an exemplary embodiment of the invention; FIG. 7 is an example used for describing a replication method for each database object according to the present invention;

FIG. 8 is a block diagram illustrating an internal configuration of a data replication system according to another exemplary embodiment of the invention;

FIG. 9 is an example used for describing a structure of a replication server and replication agent according to the present invention; and

FIG. 10 is another example used for describing a structure of a replication server and replication agent according to the present invention.

Best Mode for Carrying Out the Invention

Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the like elements throughout. The embodiments are described below in order to explain the present invention by referring to the figures.

FIG. 2 is a schematic diagram illustrating a data replication system 200 according to the present invention.

The data replication system 200 includes a master host 201, a distributor 202, and a slave host 203. In this instance, each of the master host 201, distributor 202, and slave host 203 may be composed of a plurality of hosts in order to constitute a desired structure such as a ratio of the master host 201 to the slave host 203 of N:M, however, as illustrated in FIG. 2, they are composed of a single host in order to a schematically describe the data replication system 200. A master database 204 included in the master host 201 is an original database to be a replicated object, which may allow various operations such as read and write operations, and the like to be performed therein. Conversely, a slave database included in the slave host 203 is a database where the original database is replicated, which may allow only the write operation to be performed therein. This is for the purpose of distributing a load with respect to the read operation in web services in which the read operation, that is, download of data may more frequently occur rather than the write operation, that is, upload of data. Thus, the read operation may be distributed and performed in a plurality of slave databases.

First, when the replication is set, a replication server 206 included in the master host 201 may read a transaction log 207 of the master database 204 to generate a replication log 208 being composed of only information on the replication, and transmit the generated replication log to a replication agent 209 included in the distributor 202. In this instance, the distributor 202 may be set within the master host 201 or slave host 203, and also set in a separate host in order to fully guarantee availability. The replication agent 209 may read a distribution database 210 included in the distributor 202, and determine how to replicate, in an arbitrary slave host 203, the replication log 208 received from the master host 203, more specifically, the replication

server 206. In this instance, the distributor 210 may act as a database for managing all meta-data about replication configuration, and allow the replication agent 209 to include disposition information of the master host 201 and slave host 203.

Specifically, the replication agent 209 may temporarily store the replication log 208 received from the replication server 206 in a storage device such as a buffer, and distribute the replication log 208 in the slave database 205 included in the slave host, thereby enabling the replication log 208, that is, modifications of the master database

204 to be reflected in the slave database 205. In this process, the replication agent 209 may manage a tracking log 211 in order to track a reflected state in each of the slave databases, and store all errors occurring while distributing the replication log 208 in an error log 212.

The replication database 200 as described above may replicate modifications of the master database 204 in each of the slave databases 205. These replications will be described in detail with reference to FIGS. 3 to 10. FIG. 3 is a flowchart illustrating a data replication method in a Database

Management System (DBMS) according to an exemplary embodiment of the invention.

In operation S301, the master host generates a replication log through a transaction log of the master database, and transmits the generated replication log to the distributor. In this instance, the replication log may include modifications of the master database, and the master host may transmit, to the distributor, the replication log, that is, the modifications via the replication server included in the master host. Also, the master database may act as an original database to be an object of the replication, which may allow all database operations to be performed therein.

As described above, operation S301 for transmitting the replication log to the distributor will be described in detail with reference to FIG. 4.

As examples of data replication schemes, a synchronous replication for guaranteeing coherence of data by processing operations (1) updating data of the master database and (2) updating data of the slave database as a single transaction, and a asynchronous replication for dividing the operations (1) and (2) to be performed may be given.

In this instance, the synchronous replication may have a problem in that faults occurring in a single system may affect the entire system to thereby deteriorate the

efficiency in view of the availability. For example, service operations in even the master system may be interrupted due to faults occurring in the slave system. Conversely, in the case of the asynchronous replication, modifications may be asynchronously reflected in the slave database by utilizing a transaction log of the master database, so that dependence between servers constituted by the replication may be minimized, thereby not affecting the master system even when faults occur in the slave system.

Specifically, the data replication method and system according to the present invention may provide a replication function through the asynchronous replication method using the transaction log, thereby guaranteeing coherence of data as well as a maximum availability. For this purpose, the distributor may be used as a relay system between the master host and the slave host.

Also, the transaction log for the above-described asynchronous replication may be composed of at least one transaction incorporating all modifications occurring in the master database, and include an undo log for archiving a previous data image for the purpose of aborting the updating operation and a redo log for archiving a data image after performing the updating. The replication log may include only the redo log. More specifically, the replication log may include a single transaction classified into the redo log in order to sequentially process the transactions. The transaction log and the replication log will be described in detail with reference to FIG. 5.

In operation S302, the distributor determines a slave host distributing the replication log to thereby distribute the replication log to the corresponding slave host. In this instance, the distributor may include a distribution database and a replication agent for the purpose of determining the slave host distributing the replication log. As a result, coherence and availability may be guaranteed with respect to the above- described asynchronous replication. Operation S302 for distributing the replication log through the above-described distribution database and replication agent will be described in detail with reference to FIG 6.

In operation S303, the slave host receives the replication log to reflect the received replication log in the slave database. In this instance, the slave database is a database to be a destination of the replication, and may reflect modifications of the master database. In this manner, the master database and the slave database are

synchronized with each other, and may distribute and perform an upload of data via the master database and a download of data via the slave database, respectively, thereby reducing a load with respect to the read operation.

In operation S304, the data replication system reflects modifications about a schema of the master database in the slave database through the distributor. The slave database may define the schema independently with the master database for flexibility. Specifically, at least one of a separate class, index, trigger, and user account, other than a class replicated from the master database may be generated, and even the write operation may be performed with respect to an additionally generated class. For example, the slave database may independently define and operate classes 3 and 4 while the replication is performed with respect to classes 1 and 2 from the master database.

In operation S305, the data replication system reflects, in a distribution database included in the distributor, modifications about at least one of an index, trigger, and user account of the master database. In this instance, the distributor may reflect at least one of the index, trigger, and user account in the slave host acting as another master host when a fault occurs in the master host. In this manner, the reflection of the schema, index, trigger, and user account in the slave database will be described in detail with reference to FIG. 7.

The master host and slave host as described above may be composed with a ratio of N:M therebetween, and an asynchronous replication may be performed through at least one distributor between the master host and the slave host. Configurations of the master host and slave host will be described in detail with reference to FIGS. 9 and 10.

FIG. 4 is a flowchart illustrating a method for generating a replication log in a master host to transmit the generated replication log to a distributor according to an exemplary embodiment of the invention. As illustrated in FIG. 4, operations S401 and S401 may be included in operation S301 of FIG. 3.

In operation S401, a replication server included in the master host analyzes the transaction log to thereby generate the replication log being composed of the modifications. In this instance, the replication server may be a processor for processing a transmission request for the transaction log received from at least one replication agent, and may include a first thread for processing the transmission request

and a second thread for verifying the transaction log through the master database.

Also, the replication server may temporarily store the replication log using a plurality of buffers when a plurality of replication logs are generated in the transaction unit to thereby transmit the temporarily stored replication log to the replication agent of the corresponding distributor. Specifically, the replication log may include a single transaction, that is, the transaction unit, and the replication server may process the replication while maintaining an order with respect to the plurality of transactions. The transaction using the plurality of buffers will be described in detail with reference to FIG. 5. Here, the replication agent is a processor for substantially performing a replication, which is included in the distributor. T he replication server may verify the transaction log according to the transmission request for the transaction log of the master database of the master host to thereby generate the replication log.

In operation S402, the replication server transmits the replication log to the replication agent included in the distributor. The replication log may include modifications of the master database, and the replication server may transmit the replication log to the replication agent, thereby enabling the replication agent to perform the replication between the master database and the slave database.

FIG. 5 is an example used for describing a transaction log and replication log according to an exemplary embodiment of the invention.

The transaction log is a file for recording all modifications of the database server, that is, an updating operation. The master host may generate undo or redo logs even when a fault occurs while simultaneously processing different transactions. In this instance, as described above, the undo log is the log for archiving the previous image in order to abort the updating operation, and the redo log is a log for archiving the data image after performing the updating operation in order to again perform the updating operation. In the master database, a plurality of transactions is simultaneously in an active state. For example, as illustrated in FIG. 5, updating operations corresponding to reference numerals 501 to 509 may be performed with respect to 'Tl' to 'T3'. Here, the data replication system may read the transaction log recording the updating operation to thereby extract only the redo log, and reflect, in a slave database, the extracted redo log according to a commit order of the transaction.

Here, the commit may denote an operation performed such that all operations included in a single transaction are performed in a Distributed Transaction Processing (DTP), updated contents of the corresponding database are recorded in an operation area, that is, a memory, and then completion for application of the transaction is requested at the time of being determined that the application is completed. Also, the time may denote a commit time. When the commit is performed, updating data may be substantially recorded in a memory device such as a magnetic disk, the related lock may be released, and then updated contents may be accessed from another transaction.

In this instance, aborted transaction may not be reflected in the slave database. Specifically, as described above, only the transactions 'Tl' and 'T3' are reflected in the slave database, and the aborted transaction, that is, the transaction 'T2' such as a reference numeral 508 may not be reflected in the slave database.

In the above-described case, the transaction may be simultaneously requested by several clients to thereby be processed in the master host, however, a single thread may sequentially reflect, for each slave database, an operation for applying the transaction in the slave database for the purpose of guaranteeing an order of the transaction. In this instance, the replication server included in the master host and the replication agent included in the distributor may temporarily store the transaction through a buffer with respect to the plurality of transactions, and perform the replication while maintaining the order of the transaction.

FIG. 6 is a flowchart illustrating a method for distributing a replication log in a distributor according to an exemplary embodiment of the invention. Here, as illustrated in FIG. 6, operations S601 to S605 may be included in operation S302 of FIG.

3 and performed. In this instance, the distributor may include the distributor and the replication agent.

In operation S601, the replication agent receives the replication log, and temporarily stores the received replication log. In this instance, as described above, the replication agent may store a plurality of replication logs in the buffer, respectively, when the plurality of replication logs is received, and then distribute the stored replication logs to the corresponding slave host.

In operation S602, the replication agent verifies the slave host distributing the replication log using the distribution database. In this instance, the distribution

database may include disposition information of the master host and slave host.

In operation S603, the replication agent transmits, in the replication agent, the replication log to the corresponding slave host. Specifically, the replication agent may temporarily store the replication log in the buffer, verify the slave database of the slave host transmitting the replication log, and then transmit the replication log to the slave host.

In operation S604, the replication agent generates a tracking log with respect to the replication log. In this instance, the tracking log may include a log serial number with respect to the replication log finally applied for each slave database included in the respective slave hosts.

In operation S605, the replication agent generates an error log with respect to the replication log. Here, all errors generated while the replication agent performs a replication operation may be recorded in the error log.

FIG. 7 is an example used for describing a replication method for each database object according to the present invention. Here, as illustrated in FIG. 7, modifications of information on an state and schema included in a master database of a master host

701 may be reflected in a slave host 703 through a distributor 702 in real time. In the case of an index, trigger, or user account, the modifications may be recorded only in the distribution database included in the distributor 702 for the purpose of independence of the slave database, and may not be recorded in the slave database. In this instance, the instance may denote each transaction.

In the above-described structure, when faults occur in the master database system and the slave database is required to be replaced with another master database, the index, trigger, or user account finally recorded in the distribution database may be automatically reflected in the slave database. In this instance, when a primary key is used for identifying an object to be replicated, data to be replicated may include a table in which the primary key from among the tables included in the master database is set.

FIG. 8 is a block diagram illustrating an internal configuration of a data replication system according to another exemplary embodiment of the invention. As illustrated in FIG. 8, a data replication system 800 may include a master host 810, a distributor 820, and a slave host 830.

The master host 810 may include a master database 811 and a replication server

812, and generate a replication log through a transaction log of the master database 811 to thereby transmit the replication log to the distributor. In this instance, the master database 811 may be an original database being an object to be replicated, and the replication server 812 may analyze the transaction log of the master database 811 to thereby generate the replication log being composed of the modifications, and transmit the replication log to the distributor.

Here, the transaction log may be logs where a plurality of transaction is recorded, that is, all modifications generated in the master database, and may include an undo log for archiving a previous data image in order to abort an updating operation and a redo log for archiving a data image obtained after performing the updating operation in order to again perform the updating operation, and the replication log includes the redo log. In this case, the replication log may include the redo log. More specifically, the replication log may include a single transaction classified into the redo log for the purpose of sequentially processing the plurality of transactions. Also, the replication server 812 may be a processor processing a transmission request for the transaction log received from at least one replication agent, and the processor may include a first thread for processing the transmission request and a second thread for verifying the transaction log through the master database. Specifically, the master host 810 may generate the replication log through the transaction log, that is, the modifications of the master database 811 using the replication server 812, and transmit the generated replication log to the distributor 820.

In addition, the master host 810 may include a first modification reflecting unit (not shown) for reflecting, in the slave database 831 included in the slave host 830, modifications with respect to a schema of the master database 811, and a second modification reflecting unit (not shown) for reflecting, in the distribution database included in the distributor, modifications with respect to at least one of an index, trigger, and user account of the master database 811.

The distributor 820 may include a distribution database 821 and a replication agent 822. The distributor 820 may determine the slave host distributing the replication log, and distribute the replication log to the corresponding slave host 830. In this instance, the distribution database 821 may include disposition information of the master host 810 and the slave host 830, and the replication agent 822 may perform a

replication of data using the replication log.

Here, the replication agent 822 may include a storing unit 822a for receiving the replication log received from the master host to thereby temporarily store the received replication log, a slave host verifying unit 822b for verifying the slave host using the distribution database, and a transmitting unit 822c for transmitting the replication log to the corresponding slave host. As a result, the modifications of the master database 811 may be reflected in the slave host 830.

Also, the replication agent 822 may generate a tracking log and error log with respect to the replication log. In this instance, the tracking log may include a log serial number with respect to the replication log finally applied for each slave database included in the respective slave hosts, and all errors generated while the replication agent performs a replication operation may be recorded in the error log.

In addition, the distributor 820 may reflect, in the slave host 830 acting as another master host when a fault occurs in the master host 810, the at least one of the index, trigger, and user account.

The slave host 830 may include a slave database 831, and receive the replication log to thereby reflect the received replication log in the slave database 831. In this instance, the slave database 831, that is, destination of the replication, is a database where data of the master database 811 is replicated, and may reflect modifications of the master database 811. As a result, the master database 811 and the slave database 831 are synchronized with each other, and upload and download of data are distributed and performed through the master database 811 and slave database 831, respectively, thereby reducing a load with respect to the read operation.

FIG. 9 is an example used for describing a structure of a replication server 911 and replication agent according to the present invention. Specifically, as illustrated in

FIG. 9, the structure of the replication server and replication agent will be herein described in detail through a structure of a master host 910 and slave host are connected with a ratio of 1 :N therebetween.

The master host 910 may include the replication server 911 and the master database 912, and the replication server 911 may generate a replication log through a transaction log 913 included in the master database 912 to thereby store the generated replication log in a buffer 914, and transmit the stored replication log to a distributor

920.

Specifically, the replication server 911 is a processor for processing a transmission request for the transaction log received from at least one replication agent, and may include a first thread for processing the transmission request, a second thread for verifying the transaction log through the master database, and the buffer 914 for storing the replication log generated through the transaction log.

In this instance, since the replication log may denote one transaction from among a plurality of transactions being composed of the transaction log 913, the replication log may be transmitted to the distributor 920 according to an order of the transaction.

The distributor 920 may include a replication agent 921 and a distribution database 922, and the replication agent 921 temporarily stores the replication log received from the replication server 911 in a buffer 924 before storing in a local disk 923. Specifically, the replication agent 921 is a processor for storing, in the local disk 923, the replication log transmitted from the replication server 911, that is, transaction of the master database 912, analyzing the stored replication log, and reflecting the analyzed replication log in the slave databases 931 to 933. The replication agent 921 may transmit, to the slave host, a first thread for receiving the replication log to store in the buffer 924, a second thread for storing, in the local disk 923, the replication log stored in the buffer 924, and a third thread for reflecting modifications of the master database 912 by in the slave databases 931 to 933 transmitting the replication log to the slave host.

FIG. 10 is another example used for describing a structure of a replication server and replication agent according to the present invention. Specifically, as illustrated in FIG. 10, structures of the replication server and replication agent will be herein described in detail, for example, through a structure in which the master host and the slave host are connected with a ratio of 2:6 from among structures with a ratio of N: M therebetween. Replication servers 1011 and 1021 included in respective master hosts 1010 and 1020 may transmit, to distributors 1030 and 1040 sequentially predetermined through buffers 1013, 1023, and 1024, modifications of master databases 1012 and 1022,

that is, each transaction.

The replication agent included in the distributors 1030 and 1040 may receive and process the replication log. For example, the replication agent 1031 included in the distributor 1030 may temporarily store, in a buffer 1032, the replication log received from the replication server 1011 and then store the temporarily stored replication log in a local disk 1033. Also, the replication agent may temporarily store the replication log received from the replication server 1021 in a buffer 1034, and then store the temporarily stored replication log in a local disk 1035. Theses buffers 1032 and 1034 may be used for sequentially processing the replication log, that is, the transaction. As described above, the replication log transmitted to the distributors 1030 and

1040 may be reflected in the slave database 1050 of the corresponding slave host, thereby reflecting modifications of the master databases 1012 and 1022.

The data replication method according to the above-described exemplary embodiments of the present invention may be recorded in computer-readable media including program instructions to implement various operations embodied by a computer. The media may also include, alone or in combination with the program instructions, data files, data structures, and the like. The media and program instructions may be those specially designed and constructed for the purposes of the present invention, or they may be of the kind well-known and available to those having skill in the computer software arts. Examples of computer-readable media include magnetic media such as hard disks, floppy disks, and magnetic tape; optical media such as CD ROM disks and DVD; magneto-optical media such as optical disks; and hardware devices that are specially configured to store and perform program instructions, such as read-only memory (ROM), random access memory (RAM), flash memory, and the like. Examples of program instructions include both machine code, such as produced by a compiler, and files containing higher level code that may be executed by the computer using an interpreter. The described hardware devices may be configured to act as one or more software modules in order to perform the operations of the above-described exemplary embodiments of the present invention. As described above, according to the present invention, an aggravated load in a database may be distributed through a master database, a slave database, and a distributor, any one of slave hosts may be replaced with a master host when a fault

occurs in a master host including the master database, thereby effectively coping with the fault, and changed contents with respect to only the slave database may be rapidly collected even when periodical collection with respect to simultaneously updated data is needed. According to the present invention, when a schema is changed in a master database of a master host, the change may be replicated in the slave database of the slave host, and a desired replication environment such as a ratio of the master host to the slave host of N:M may be configured.

Although a few embodiments of the present invention have been shown and described, the present invention is not limited to the described embodiments. Instead, it would be appreciated by those skilled in the art that changes may be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.