JP2011221594A - System and method for multiplexing database - Google Patents

System and method for multiplexing database Download PDF

Info

Publication number
JP2011221594A
JP2011221594A JP2010086716A JP2010086716A JP2011221594A JP 2011221594 A JP2011221594 A JP 2011221594A JP 2010086716 A JP2010086716 A JP 2010086716A JP 2010086716 A JP2010086716 A JP 2010086716A JP 2011221594 A JP2011221594 A JP 2011221594A
Authority
JP
Japan
Prior art keywords
server
database
data
unit
master
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2010086716A
Other languages
Japanese (ja)
Other versions
JP5094903B2 (en
Inventor
Yusaku Taniguchi
雄作 谷口
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yahoo Japan Corp
Original Assignee
Yahoo Japan Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yahoo Japan Corp filed Critical Yahoo Japan Corp
Priority to JP2010086716A priority Critical patent/JP5094903B2/en
Publication of JP2011221594A publication Critical patent/JP2011221594A/en
Application granted granted Critical
Publication of JP5094903B2 publication Critical patent/JP5094903B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a system and method for multiplexing a database capable of easily and simply multiplex a database without requiring any special considerations concerning data registration processing.SOLUTION: A database multiplexing system 100 having a first server 1A, a second server 1B and a server to be referred 3 which are mutually and communicably connected thereto, includes: a data acquisition section 11A for allowing the first server 1A to sequentially acquire data stored in the server to be referred 3; a data generation section 12A and a data registration section 13A for storing data generated from the acquired data in a master DB 22A; a first duplication section 14A for transmitting the stored data to a second server 1B for duplication; a second duplication section 15A for storing data received from the second server 1B in a slave DB 24A which is a replica of the second server 1B; and a consistency confirmation section 16A for confirming whether or not there is consistency between the master DB 22A and the slave DB 24A.

Description

本発明は、データベース多重化システム及び多重化方法に関する。   The present invention relates to a database multiplexing system and a multiplexing method.

従来、データベースを多重化して、データベース障害に備える方法が数多く示されている(例えば、特許文献1参照)。特許文献1に記載のレプリケーションDB整合性確認方法では、マスタデータベース及びレプリカデータベース(スレーブデータベース)の各々に対する全更新処理を各々が所持する更新履歴データベースに格納し、一定の間隔で双方の更新履歴データベースの比較を行い前回比較からの差分情報のみを更新履歴データベースに残すものであった。これにより、更新履歴データベースに残る情報は、マスタデータベース、レプリカデータベースの差異となり、更新履歴データベースを参照して整合性の確認、レプリカデータベースの改竄の検知を行っていた。   Conventionally, many methods for multiplexing databases and preparing for database failures have been shown (for example, see Patent Document 1). In the replication DB consistency check method described in Patent Document 1, all update processes for each of a master database and a replica database (slave database) are stored in an update history database owned by each, and both update history databases are stored at regular intervals. And only the difference information from the previous comparison is left in the update history database. As a result, the information remaining in the update history database becomes a difference between the master database and the replica database, and consistency is confirmed by referring to the update history database, and falsification of the replica database is detected.

特開2005−250819号公報JP 2005-250819 A

しかし、特許文献1に記載されたものは、マスタデータベース及びレプリカデータベースを1つずつ備えたデータベース多重化システムであり、マスタデータベースの障害時には、データの登録処理が止まってしまうものであった。そのため、両者のデータベースへのデータ更新が止まってしまうものであった。   However, what is described in Patent Document 1 is a database multiplexing system including one master database and one replica database, and data registration processing stops when the master database fails. Therefore, the data update to both databases stops.

ところで、マスタデータベース及びレプリカデータベースを備えたデータベース多重化システムの場合には、マスタデータベース側だけではなく、レプリカデータベース側にもデータを登録する登録部を有するものにするのが一般的である。このようなシステムは、通常時において、マスタデータベース側の登録部と、レプリカデータベース側の登録部とがデータを半分ずつマスタデータベースに登録し、その後、マスタデータベースに基づいてレプリカデータベースを更新する。そして、障害発生時には、障害が発生していないデータベース側で全てのデータを登録することで、全ての処理を止めることなく稼働中のデータベースのデータ更新を行うことができるものである。しかし、このようなシステムは、登録処理を多重化にするので、登録するデータ内容の振分やデータベースサーバの振分を考慮する必要があり、処理が煩雑であった。   By the way, in the case of a database multiplexing system including a master database and a replica database, it is common to have a registration unit for registering data not only on the master database side but also on the replica database side. In such a system, in a normal state, the registration unit on the master database side and the registration unit on the replica database side register data in half in the master database, and then update the replica database based on the master database. When a failure occurs, all the data is registered on the database side where no failure has occurred, so that the data in the operating database can be updated without stopping all processing. However, since such a system multiplexes the registration process, it is necessary to consider the distribution of the data contents to be registered and the distribution of the database server, and the process is complicated.

本発明は、データ登録処理に関する特段の考慮を不要にして簡単かつ簡潔に多重化が可能なデータベース多重化システム及び多重化方法を提供することを目的とする。   It is an object of the present invention to provide a database multiplexing system and a multiplexing method that can be multiplexed easily and simply without requiring special consideration regarding data registration processing.

本発明者らは、マスタデータベース及びスレーブデータベースを2重化することで、処理に関して特段の考慮を不要にすることを見出し、本発明を完成するに至った。本発明は、具体的には次のようなものを提供する。   The inventors of the present invention have found that the master database and the slave database are duplicated so that no special consideration is required for processing, and the present invention has been completed. Specifically, the present invention provides the following.

(1) 2台のデータベースサーバである第1サーバ及び第2サーバと、被参照サーバとが相互に通信可能に接続されたデータベース多重化システムであって、前記第1サーバ及び第2サーバは、前記被参照サーバに記憶されたデータを順次取得するデータ取得部と、前記データ取得部により取得したデータを、前記データベースサーバの各々が備えるマスタデータベースに記憶するデータ登録部と、前記データ登録部が記憶した前記データを複製のために前記第2サーバ及び前記第1サーバに送信する第1複製部と、前記第2サーバ及び前記第1サーバから受信したデータをそれぞれ前記第2サーバ及び前記第1サーバのレプリカであるスレーブデータベースに記憶する第2複製部と、前記マスタデータベースと、前記スレーブデータベースとの整合性がとれているか否かを確認する整合性確認部と、を備える、データベース多重化システム。   (1) A database multiplexing system in which a first server and a second server, which are two database servers, and a referenced server are connected so as to communicate with each other, wherein the first server and the second server are: A data acquisition unit that sequentially acquires data stored in the referenced server, a data registration unit that stores data acquired by the data acquisition unit in a master database included in each of the database servers, and the data registration unit A first replication unit for transmitting the stored data to the second server and the first server for replication; and data received from the second server and the first server respectively for the second server and the first server A second replicating unit for storing in a slave database that is a replica of the server, the master database, and the slave database; And a consistency confirmation unit for confirming whether consistency is taken with a database multiplexing system.

本発明のこのような構成によれば、データベース多重化システムは、各データベースサーバが管理するデータベースを各々マスタデータベースとスレーブデータベースの2つに分けることで、例えば、第2サーバに記憶されたデータベースの内容を、第1サーバにもレプリケートして有する等、データのレプリケーション(複製)処理が単方向になるので、各データベースサーバにおける処理内容の振分を不要にして簡単かつ簡潔に多重化することができる。よって、データベース多重化システムは、第1サーバと第2サーバとの処理をほぼ同等にするので、データ登録処理を簡潔なものにすることができる。   According to such a configuration of the present invention, the database multiplexing system divides the database managed by each database server into two, that is, a master database and a slave database, for example, the database stored in the second server. Data replication (duplication) processing is unidirectional, such as having the contents replicated to the first server, so that it is possible to multiplex easily and simply without the need to distribute the processing contents at each database server it can. Therefore, since the database multiplexing system makes the processing of the first server and the second server substantially the same, the data registration processing can be simplified.

また、データベース多重化システムは、第1サーバで登録されたデータと第2サーバで登録されたデータとを同一のデータベースサーバ内で管理することで、第1サーバに記憶されたデータベースの内容と、第2サーバに記憶されたデータベースの内容との整合性を簡単に確認できる。   Further, the database multiplexing system manages the data registered in the first server and the data registered in the second server in the same database server, so that the contents of the database stored in the first server, Consistency with the contents of the database stored in the second server can be easily confirmed.

(2) 前記整合性確認部により否と判定された場合に、前記スレーブデータベースに記憶されたデータを前記マスタデータベースに対して更新するデータ補完部を備える、(1)に記載のデータベース多重化システム。   (2) The database multiplexing system according to (1), further including a data complementing unit that updates data stored in the slave database with respect to the master database when the consistency check unit determines NO. .

本発明のこのような構成によれば、データベース多重化システムは、スレーブデータベースに記憶されたデータをマスタデータベースに対して更新するデータ補完部を備えるので、例えば、第1サーバの障害復旧時に、第1サーバは、第1サーバに記憶されたデータベースを参照することで復旧できる。よって、データベース多重化システムは、単純な作業で障害復帰ができる。   According to such a configuration of the present invention, since the database multiplexing system includes the data complementing unit that updates the data stored in the slave database to the master database, for example, at the time of failure recovery of the first server, One server can be recovered by referring to the database stored in the first server. Therefore, the database multiplexing system can recover from a failure with a simple operation.

(3) 2台のデータベースサーバである第1サーバ及び第2サーバと、被参照サーバとが相互に通信可能に接続されたデータベース多重化システムによる多重化方法であって、前記第1サーバ及び前記第2サーバが、前記被参照サーバに記憶されたデータを順次取得するデータ取得ステップと、前記第1サーバ及び前記第2サーバが、前記データ取得ステップにより取得したデータを、前記データベースサーバの各々が備えるマスタデータベースに記憶するデータ登録ステップと、前記第1サーバが、前記第2サーバが備える前記第1サーバのレプリカであるスレーブデータベースに記憶させるために、前記データ登録ステップにより記憶された前記データを前記第2サーバに送信する第1複製ステップと、前記第2サーバが、前記第1サーバから受信した前記データを前記第2サーバの前記スレーブデータベースに記憶する第2複製ステップと、前記第2サーバが、前記第1サーバが備える前記第2サーバのレプリカであるスレーブデータベースに記憶させるために、前記データ登録ステップにより記憶された前記データを前記第1サーバに送信する第3複製ステップと、前記第1サーバが、前記第2サーバから受信した前記データを前記第1サーバの前記スレーブデータベースに記憶する第4複製ステップと、前記第1サーバ及び前記第2サーバが、各々備える前記マスタデータベースと、前記スレーブデータベースとの整合性がとれているか否かを確認する整合性確認ステップと、を含む、多重化方法。   (3) A multiplexing method using a database multiplexing system in which a first server and a second server, which are two database servers, and a referenced server are connected so as to communicate with each other, the first server, A data acquisition step in which the second server sequentially acquires the data stored in the referenced server, and the data acquired by the first server and the second server in the data acquisition step are stored in each of the database servers. A data registration step for storing in the master database provided, and the first server storing the data stored in the data registration step for storage in a slave database that is a replica of the first server provided in the second server. A first duplication step of transmitting to the second server, and the second server comprising the first server; A second replication step of storing the data received from the server in the slave database of the second server, and the second server storing the data in a slave database that is a replica of the second server included in the first server A third replication step of transmitting the data stored in the data registration step to the first server; and the slave server of the first server using the data received by the first server from the second server. A fourth replication step stored in the first database, and a consistency confirmation step for confirming whether or not the master database provided in each of the first server and the second server is consistent with the slave database. Multiplexing method including.

本発明のこのような構成によれば、(1)と同様の効果を奏する方法を提供できる。   According to such a configuration of the present invention, it is possible to provide a method having the same effect as (1).

本発明によれば、データ登録処理に関する特段の考慮を不要にして簡単かつ簡潔に多重化が可能なデータベース多重化システム及び多重化方法を提供することができる。   According to the present invention, it is possible to provide a database multiplexing system and a multiplexing method that allow simple and simple multiplexing without requiring special consideration regarding data registration processing.

本実施形態に係るデータベース多重化システムの全体構成並びに第1サーバ、第2サーバ及び被参照サーバの機能構成を示す図である。It is a figure which shows the function structure of the whole structure of a database multiplexing system which concerns on this embodiment, and a 1st server, a 2nd server, and a referred server. 本実施形態に係る第1サーバがデータを取得したことを契機として発生する第1サーバのフローチャートである。It is a flowchart of the 1st server which occurs when the 1st server concerning this embodiment acquires data. 本実施形態に係る第2サーバからのデータ受信を契機として発生する第1サーバのフローチャートである。It is a flowchart of the 1st server which occurs when data reception from the 2nd server concerning this embodiment occurs.

以下、本発明を実施するための形態について、図を参照しながら説明する。なお、これは、あくまでも一例であって、本発明の技術的範囲はこれに限られるものではない。   DESCRIPTION OF EMBODIMENTS Hereinafter, embodiments for carrying out the present invention will be described with reference to the drawings. This is merely an example, and the technical scope of the present invention is not limited to this.

(実施形態)
[データベース多重化システム100の全体構成並びに第1サーバ1A、第2サーバ1B及び被参照サーバ3の機能構成]
図1は、本実施形態に係るデータベース多重化システム100の全体構成並びに第1サーバ1A、第2サーバ1B及び被参照サーバ3の機能構成を示す図である。
(Embodiment)
[Overall Configuration of Database Multiplexing System 100 and Functional Configuration of First Server 1A, Second Server 1B, and Referenced Server 3]
FIG. 1 is a diagram showing an overall configuration of a database multiplexing system 100 according to the present embodiment and functional configurations of a first server 1A, a second server 1B, and a referenced server 3.

データベース多重化システム100は、第1サーバ1Aと、第2サーバ1Bと、被参照サーバ3と、参照サーバ5と、通信ネットワークNとにより構成される。通信ネットワークNによって、第1サーバ1Aと、第2サーバ1Bと、被参照サーバ3と、参照サーバ5とが通信可能に接続されている。   The database multiplexing system 100 includes a first server 1A, a second server 1B, a referenced server 3, a reference server 5, and a communication network N. Through the communication network N, the first server 1A, the second server 1B, the referenced server 3, and the reference server 5 are communicably connected.

第1サーバ1A及び第2サーバ1Bは、同一の構成を備えたデータベースサーバである。第1サーバ1A及び第2サーバ1Bは、被参照サーバ3から同一のデータを取得して相互にレプリケーションを行う。データベース多重化システム100は、データベースを多重化して相互にレプリケーションを行い、その後、マスタデータベースとスレーブデータベースとの間で補完処理を行うことで、データベース多重化システム100全体の信頼性の向上を図っている。第1サーバ1Aは、制御部10Aと、記憶部20Aとを備える。また、第2サーバ1Bは、制御部10Bと、記憶部20Bとを備える。なお、以降の説明において、第1サーバ1A及び第2サーバ1Bに共通のものについては、符号A、Bを省略して、例えば、制御部10等と説明する。また、第1サーバ1A及び第2サーバ1Bとを区別しない場合に、データベースサーバ1として説明する。   The first server 1A and the second server 1B are database servers having the same configuration. The first server 1A and the second server 1B acquire the same data from the referenced server 3 and perform replication with each other. The database multiplexing system 100 multiplexes databases to perform mutual replication, and thereafter performs complementary processing between the master database and the slave database, thereby improving the reliability of the entire database multiplexing system 100. Yes. The first server 1A includes a control unit 10A and a storage unit 20A. The second server 1B includes a control unit 10B and a storage unit 20B. Note that in the following description, the components common to the first server 1A and the second server 1B will be described as, for example, the control unit 10 and the like by omitting the symbols A and B. Moreover, when not distinguishing the 1st server 1A and the 2nd server 1B, it demonstrates as the database server 1. FIG.

制御部10は、データ取得部11と、データ生成部12と、データ登録部13と、第1複製部14と、第2複製部15と、整合性確認部16と、データ補完部17とを備える。   The control unit 10 includes a data acquisition unit 11, a data generation unit 12, a data registration unit 13, a first replication unit 14, a second replication unit 15, a consistency confirmation unit 16, and a data complement unit 17. Prepare.

データ取得部11は、被参照サーバ3からデータを取得する制御部である。データ取得部11は、マスタDB22(DB:データベース)を参照し、被参照サーバ3に対してマスタDB22に記憶されていないデータの取得要求を送信することで、被参照サーバ3から要求に対応するデータを取得する。   The data acquisition unit 11 is a control unit that acquires data from the referenced server 3. The data acquisition unit 11 refers to the master DB 22 (DB: database) and transmits a data acquisition request not stored in the master DB 22 to the referenced server 3, thereby responding to the request from the referenced server 3. Get the data.

データ生成部12は、被参照サーバ3から取得したデータから、マスタDB22に記憶させるデータを生成する制御部である。例えば、データ生成部12は、被参照サーバ3から取得したクエリーのログを集計及び加工して、クエリーごとのランキング情報を生成する。   The data generation unit 12 is a control unit that generates data to be stored in the master DB 22 from data acquired from the referenced server 3. For example, the data generation unit 12 aggregates and processes the query logs acquired from the referenced server 3 to generate ranking information for each query.

データ登録部13は、データ生成部12により生成されたデータをマスタDB22に記憶させる制御部である。上述の例であれば、データ登録部13は、生成されたクエリーごとのランキング情報を記憶することで、クリック集計ランキングをマスタDB22に記憶できる。   The data registration unit 13 is a control unit that stores the data generated by the data generation unit 12 in the master DB 22. If it is the above-mentioned example, the data registration part 13 can memorize | store a click total ranking in master DB22 by memorize | storing the ranking information for every produced | generated query.

第1複製部14は、被参照サーバ3から取得してデータ生成部12が生成したデータを複製のために相手方のデータベースサーバ1に対して送信する制御部である。相手方のデータベースサーバ1は、第1複製部14Aの場合には、第2サーバ1Bであり、第1複製部14Bの場合には、第1サーバ1Aである。   The first replication unit 14 is a control unit that transmits data acquired from the referenced server 3 and generated by the data generation unit 12 to the counterpart database server 1 for replication. The counterpart database server 1 is the second server 1B in the case of the first replicating unit 14A, and the first server 1A in the case of the first replicating unit 14B.

第2複製部15は、相手方のデータベースサーバ1の第1複製部14が送信したデータを受信して、スレーブDB24に記憶させる制御部である。相手方のデータベースサーバ1の第1複製部14は、第2複製部15Aの場合には、第2サーバ1Bの第1複製部14Bであり、第2複製部15Bの場合には、第1サーバ1Aの第1複製部14Aである。   The second replication unit 15 is a control unit that receives the data transmitted by the first replication unit 14 of the counterpart database server 1 and stores the data in the slave DB 24. In the case of the second replication unit 15A, the first replication unit 14 of the counterpart database server 1 is the first replication unit 14B of the second server 1B, and in the case of the second replication unit 15B, the first server 1A. The first duplicating unit 14A.

整合性確認部16は、記憶部20に記憶されているマスタDB22とスレーブDB24との整合性が取れているか否かを確認する制御部である。整合性が取れているか否かは、例えば、データが欠損している場合、データの生成時刻が異なる場合、データ自体の集計値が異なる場合等を確認することで判定できる。   The consistency confirmation unit 16 is a control unit that confirms whether the master DB 22 and the slave DB 24 stored in the storage unit 20 are consistent. Whether or not consistency is obtained can be determined by confirming, for example, when data is missing, when data generation time is different, or when the aggregate value of data itself is different.

データ補完部17は、整合性確認部16による確認の結果、整合性が取れていないと判定された場合に、マスタDB22に対してスレーブDB24のデータを更新することで、整合性をとる制御部である。   The data complementing unit 17 controls the consistency by updating the data of the slave DB 24 to the master DB 22 when it is determined that the consistency is not obtained as a result of the confirmation by the consistency confirmation unit 16. It is.

記憶部20は、マスタDB22と、スレーブDB24とを備える。   The storage unit 20 includes a master DB 22 and a slave DB 24.

マスタDB22は、メインになるDBであり、被参照サーバ3から取得してデータ生成部12が生成したデータを登録するDBである。   The master DB 22 is a main DB, and is a DB for registering data acquired from the referenced server 3 and generated by the data generation unit 12.

スレーブDB24は、サブになるDBであり、相手方のデータベースサーバ1のマスタDB22に記憶されたデータを受信して格納したDBであり、相手方のデータベースサーバ1のマスタDB22の複製である。   The slave DB 24 is a sub DB, is a DB that receives and stores data stored in the master DB 22 of the counterpart database server 1, and is a replica of the master DB 22 of the counterpart database server 1.

本実施形態の第1サーバ1A及び第2サーバ1Bのハードウェアは、一般的なコンピュータによって構成してもよい。一般的なコンピュータは、例えば、制御部10として、中央処理装置(CPU)を備える他、記憶部20として、メモリ(RAM、ROM)、ハードディスク(HDD)及び光ディスク(CD、DVD等)を、ネットワーク通信装置として、各種有線及び無線LAN装置を、表示装置として、例えば、液晶ディスプレイ、プラズマディスプレイ等の各種ディスプレイを、入力装置として、例えば、キーボード及びポインティング・デバイス(マウス、トラッキングボール等)を適宜備え、これらはバスラインにより接続されている。このような一般的なコンピュータにおいて、第1サーバ1AのCPUは、第1サーバ1Aを、第2サーバ1BのCPUは、第2サーバ1Bを、それぞれ統括的に制御し、各種プログラムを適宜読み出して実行することにより、上述したハードウェアと協働し、本発明に係る各種機能を実現している。   The hardware of the first server 1A and the second server 1B of the present embodiment may be configured by a general computer. For example, a general computer includes a central processing unit (CPU) as the control unit 10 and a memory (RAM, ROM), a hard disk (HDD), and an optical disk (CD, DVD, etc.) as a storage unit 20 in a network. As a communication device, various wired and wireless LAN devices, as a display device, for example, various displays such as a liquid crystal display and a plasma display, and as an input device, for example, a keyboard and a pointing device (mouse, tracking ball, etc.) are appropriately provided. These are connected by a bus line. In such a general computer, the CPU of the first server 1A controls the first server 1A and the CPU of the second server 1B centrally controls the second server 1B, respectively, and reads various programs as appropriate. By executing this, the various functions according to the present invention are realized in cooperation with the hardware described above.

被参照サーバ3は、例えば、ファイルサーバであり、検索に用いられたクエリーのログを記憶している。被参照サーバ3は、第1サーバ1A及び第2サーバ1Bによりアクセスされ、第1サーバ1A及び第2サーバ1Bは、例えば、被参照サーバ3に記憶されているクエリーのログを取得する。被参照サーバ3は、被参照サーバ3の全体を制御する制御部30と、データを記憶するデータ記憶部32とを備える。被参照サーバ3のハードウェアは、一般的なコンピュータによって構成してもよい。   The referenced server 3 is, for example, a file server, and stores a query log used for the search. The referenced server 3 is accessed by the first server 1A and the second server 1B, and the first server 1A and the second server 1B obtain, for example, a query log stored in the referenced server 3. The referenced server 3 includes a control unit 30 that controls the entire referenced server 3 and a data storage unit 32 that stores data. The hardware of the referenced server 3 may be configured by a general computer.

参照サーバ5は、例えば、動画検索サーバ等のフロントエンドサーバである。参照サーバ5は、クエリーを第1サーバ1A及び第2サーバ1BのうちのいずれかのマスタDB22に対して実行して、クエリーに対する処理結果を取得する。なお、参照サーバ5は、例えば、パーソナルコンピュータ(PC)や、携帯電話機等の端末であってもよい。   The reference server 5 is, for example, a front end server such as a moving image search server. The reference server 5 executes the query on one of the master DBs 22 of the first server 1A and the second server 1B, and acquires the processing result for the query. The reference server 5 may be, for example, a personal computer (PC) or a terminal such as a mobile phone.

通信ネットワークNは、第1サーバ1Aと、第2サーバ1Bと、被参照サーバ3と、参照サーバ5との間で通信を行うための、例えば、インターネット等の通信回線である。通信ネットワークNは、有線であってもよいし、その一部又は全部が無線であってもよい。   The communication network N is a communication line such as the Internet for performing communication between the first server 1A, the second server 1B, the referenced server 3, and the reference server 5. The communication network N may be wired or part or all of it may be wireless.

[第1サーバ1Aの処理]
次に、第1サーバ1Aでの処理について説明する。図2は、本実施形態に係る第1サーバ1Aがデータを取得したことを契機として発生する第1サーバ1Aのフローチャートである。図3は、本実施形態に係る第2サーバ1Bからのデータ受信を契機として発生する第1サーバ1Aのフローチャートである。なお、第2サーバ1Bは、以下に説明する第1サーバ1Aと同じ処理を行う。具体的には、第2サーバ1Bでの処理では、以下の説明のうち、第2サーバ1Bと記載されている部分を第1サーバ1Aと置き換えれば、後は第1サーバ1Aの処理と同じである。
[Processing of the first server 1A]
Next, processing in the first server 1A will be described. FIG. 2 is a flowchart of the first server 1A that occurs when the first server 1A according to the present embodiment acquires data. FIG. 3 is a flowchart of the first server 1A that occurs when data reception from the second server 1B according to the present embodiment occurs. The second server 1B performs the same process as the first server 1A described below. Specifically, in the processing in the second server 1B, if the portion described as the second server 1B in the following description is replaced with the first server 1A, the rest is the same as the processing in the first server 1A. is there.

図2のS10:制御部10A(データ取得部11A)は、被参照サーバ3からデータを取得する。ここで、データ取得部11Aは、被参照サーバ3に対して、定期的(例えば、毎朝4時等)に更新データの有無を照会することで、データを取得してもよい。また、被参照サーバ3が更新されたことを通知することで、データ取得部11Aがデータを取得してもよい。   S <b> 10 in FIG. 2: The control unit 10 </ b> A (data acquisition unit 11 </ b> A) acquires data from the referenced server 3. Here, the data acquisition unit 11 </ b> A may acquire data by inquiring of the referenced server 3 periodically (for example, every morning at 4 o'clock) whether or not there is update data. Further, the data acquisition unit 11A may acquire data by notifying that the referenced server 3 has been updated.

S11:制御部10A(データ生成部12A)は、S10で取得したデータからマスタDB22Aに記憶させるデータを生成する。   S11: The control unit 10A (data generation unit 12A) generates data to be stored in the master DB 22A from the data acquired in S10.

S12:制御部10A(データ登録部13A)は、S11で生成したデータを、マスタDB22Aに記憶する。   S12: The control unit 10A (data registration unit 13A) stores the data generated in S11 in the master DB 22A.

S13:制御部10A(第1複製部14A)は、S11で生成し、S12でマスタDB22Aに記憶したデータを、第2サーバ1Bに対して送信する。その後、制御部10Aは、本処理を終了する。   S13: The control unit 10A (first replication unit 14A) transmits the data generated in S11 and stored in the master DB 22A in S12 to the second server 1B. Thereafter, the control unit 10A ends the process.

図3のS21:制御部10A(第2複製部15A)は、第2サーバ1Bからデータを受信する。ここで、受信するデータは、第2サーバ1Bが被参照サーバ3から取得して生成したデータである。   S21 in FIG. 3: The control unit 10A (second replication unit 15A) receives data from the second server 1B. Here, the received data is data that the second server 1 </ b> B has acquired from the referenced server 3 and generated.

S22:制御部10A(第2複製部15A)は、受信したデータを、スレーブDB24Aに記憶する。   S22: The control unit 10A (second replication unit 15A) stores the received data in the slave DB 24A.

S23:制御部10A(整合性確認部16A)は、マスタDB22AとスレーブDB24Aとの間でデータの整合性が取れているか否かを確認する。確認した結果、整合性が取れていると判定された場合(S23:YES)には、制御部10Aは、本処理を終了する。他方、確認の結果、整合性が取れていないと判定された場合(S23:NO)には、制御部10Aは、処理をS24に移す。   S23: The control unit 10A (consistency confirmation unit 16A) confirms whether data consistency is obtained between the master DB 22A and the slave DB 24A. As a result of checking, when it is determined that consistency is obtained (S23: YES), the control unit 10A ends the process. On the other hand, when it is determined that the consistency is not obtained as a result of the confirmation (S23: NO), the control unit 10A moves the process to S24.

S24:制御部10A(データ補完部17A)は、スレーブDB24Aに存在し、マスタDB22Aに存在しないデータを、マスタDB22Aに対して更新することで、マスタDB22AとスレーブDB24Aとの整合性が取れるようにする。その後、制御部10Aは、本処理を終了する。   S24: The control unit 10A (data complementing unit 17A) updates the master DB 22A with data that exists in the slave DB 24A but does not exist in the master DB 22A so that the master DB 22A and the slave DB 24A can be consistent. To do. Thereafter, the control unit 10A ends the process.

このように、データベース多重化システム100は、第1サーバ1Aと第2サーバ1Bとが管理するデータベースを各々マスタDB22とスレーブDB24の2つに分けることでデータの複製処理を単方向にできるので、データベースサーバ1における処理内容の振分を不要にして簡単かつ簡潔に多重化が可能になる。よって、データベース多重化システム100は、第1サーバ1Aと第2サーバ1Bとの処理をほぼ同等にするので、データ登録処理を簡潔なものにすることができる。   As described above, the database multiplexing system 100 can unidirectionally perform data replication processing by dividing the database managed by the first server 1A and the second server 1B into the master DB 22 and the slave DB 24, respectively. The processing contents in the database server 1 need not be allocated, and multiplexing can be performed easily and simply. Therefore, since the database multiplexing system 100 makes the processing of the first server 1A and the second server 1B substantially the same, the data registration processing can be simplified.

また、データベース多重化システム100は、第1サーバ1Aで登録されたデータと第2サーバ1Bで登録されたデータとを、第1サーバ1Aと第2サーバ1Bとの中で各々管理することで、第1サーバ1Aに記憶されたデータベースの内容と、第2サーバ1Bに記憶されたデータベースの内容との整合性を簡単に確認できる。   In addition, the database multiplexing system 100 manages the data registered in the first server 1A and the data registered in the second server 1B in the first server 1A and the second server 1B, respectively. The consistency between the contents of the database stored in the first server 1A and the contents of the database stored in the second server 1B can be easily confirmed.

以上、本発明の実施形態について説明したが、本発明は、上述した実施形態に限るものではない。また、本発明の実施形態に記載された効果は、本発明から生じる最も好適な効果を列挙したに過ぎず、本発明による効果は、本発明の実施形態に記載されたものに限定されるものではない。   As mentioned above, although embodiment of this invention was described, this invention is not restricted to embodiment mentioned above. The effects described in the embodiments of the present invention are only the most preferable effects resulting from the present invention, and the effects of the present invention are limited to those described in the embodiments of the present invention. is not.

1 データベースサーバ
1A 第1サーバ
1B 第2サーバ
3 被参照サーバ
5 参照サーバ
10,10A,10B,30 制御部
11,11A,11B データ取得部
12,12A,12B データ生成部
13,13A,13B データ登録部
14,14A,14B 第1複製部
15,15A,15B 第2複製部
16,16A,16B 整合性確認部
17,17A,17B データ補完部
20,20A,20B,32 記憶部
22,22A,22B マスタDB
24,24A,24B スレーブDB
100 データベース多重化システム
N 通信ネットワーク
DESCRIPTION OF SYMBOLS 1 Database server 1A 1st server 1B 2nd server 3 Referenced server 5 Reference server 10, 10A, 10B, 30 Control part 11, 11A, 11B Data acquisition part 12, 12A, 12B Data generation part 13, 13A, 13B Data registration Unit 14, 14A, 14B First replication unit 15, 15A, 15B Second replication unit 16, 16A, 16B Consistency confirmation unit 17, 17A, 17B Data complementing unit 20, 20A, 20B, 32 Storage unit 22, 22A, 22B Master DB
24, 24A, 24B Slave DB
100 Database multiplexing system N Communication network

Claims (3)

2台のデータベースサーバである第1サーバ及び第2サーバと、被参照サーバとが相互に通信可能に接続されたデータベース多重化システムであって、
前記第1サーバ及び第2サーバは、
前記被参照サーバに記憶されたデータを順次取得するデータ取得部と、
前記データ取得部により取得したデータを、前記データベースサーバの各々が備えるマスタデータベースに記憶するデータ登録部と、
前記データ登録部が記憶した前記データを複製のために前記第2サーバ及び前記第1サーバに送信する第1複製部と、
前記第2サーバ及び前記第1サーバから受信したデータをそれぞれ前記第2サーバ及び前記第1サーバのレプリカであるスレーブデータベースに記憶する第2複製部と、
前記マスタデータベースと、前記スレーブデータベースとの整合性がとれているか否かを確認する整合性確認部と、
を備える、
データベース多重化システム。
A database multiplexing system in which a first server and a second server, which are two database servers, and a referenced server are connected so that they can communicate with each other,
The first server and the second server are:
A data acquisition unit for sequentially acquiring data stored in the referenced server;
A data registration unit for storing data acquired by the data acquisition unit in a master database included in each of the database servers;
A first replication unit that transmits the data stored by the data registration unit to the second server and the first server for replication;
A second replication unit that stores data received from the second server and the first server in a slave database that is a replica of the second server and the first server, respectively;
A consistency checking unit for checking whether or not the master database and the slave database are consistent;
Comprising
Database multiplexing system.
前記整合性確認部により否と判定された場合に、前記スレーブデータベースに記憶されたデータを前記マスタデータベースに対して更新するデータ補完部を備える、
請求項1に記載のデータベース多重化システム。
A data complementing unit that updates the data stored in the slave database with respect to the master database when the consistency checking unit determines NO.
The database multiplexing system according to claim 1.
2台のデータベースサーバである第1サーバ及び第2サーバと、被参照サーバとが相互に通信可能に接続されたデータベース多重化システムによる多重化方法であって、
前記第1サーバ及び前記第2サーバが、前記被参照サーバに記憶されたデータを順次取得するデータ取得ステップと、
前記第1サーバ及び前記第2サーバが、前記データ取得ステップにより取得したデータを、前記データベースサーバの各々が備えるマスタデータベースに記憶するデータ登録ステップと、
前記第1サーバが、前記第2サーバが備える前記第1サーバのレプリカであるスレーブデータベースに記憶させるために、前記データ登録ステップにより記憶された前記データを前記第2サーバに送信する第1複製ステップと、
前記第2サーバが、前記第1サーバから受信した前記データを前記第2サーバの前記スレーブデータベースに記憶する第2複製ステップと、
前記第2サーバが、前記第1サーバが備える前記第2サーバのレプリカであるスレーブデータベースに記憶させるために、前記データ登録ステップにより記憶された前記データを前記第1サーバに送信する第3複製ステップと、
前記第1サーバが、前記第2サーバから受信した前記データを前記第1サーバの前記スレーブデータベースに記憶する第4複製ステップと、
前記第1サーバ及び前記第2サーバが、各々備える前記マスタデータベースと、前記スレーブデータベースとの整合性がとれているか否かを確認する整合性確認ステップと、
を含む、
多重化方法。
A multiplexing method using a database multiplexing system in which two database servers, a first server and a second server, and a referenced server are connected so as to communicate with each other,
A data acquisition step in which the first server and the second server sequentially acquire data stored in the referenced server;
A data registration step in which the first server and the second server store the data acquired in the data acquisition step in a master database included in each of the database servers;
A first replication step in which the first server transmits the data stored in the data registration step to the second server for storage in a slave database that is a replica of the first server included in the second server. When,
A second replication step in which the second server stores the data received from the first server in the slave database of the second server;
A third replication step in which the second server transmits the data stored in the data registration step to the first server so as to be stored in a slave database that is a replica of the second server included in the first server; When,
A fourth replication step in which the first server stores the data received from the second server in the slave database of the first server;
A consistency confirmation step for confirming whether or not the master database provided by the first server and the second server are consistent with the slave database; and
including,
Multiplexing method.
JP2010086716A 2010-04-05 2010-04-05 Database multiplexing system and multiplexing method Active JP5094903B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010086716A JP5094903B2 (en) 2010-04-05 2010-04-05 Database multiplexing system and multiplexing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010086716A JP5094903B2 (en) 2010-04-05 2010-04-05 Database multiplexing system and multiplexing method

Publications (2)

Publication Number Publication Date
JP2011221594A true JP2011221594A (en) 2011-11-04
JP5094903B2 JP5094903B2 (en) 2012-12-12

Family

ID=45038546

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010086716A Active JP5094903B2 (en) 2010-04-05 2010-04-05 Database multiplexing system and multiplexing method

Country Status (1)

Country Link
JP (1) JP5094903B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112905691A (en) * 2019-11-19 2021-06-04 中盈优创资讯科技有限公司 Information synchronization method and device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103020243A (en) * 2012-12-18 2013-04-03 新浪网技术(中国)有限公司 Method and device for master-slave replication structure replacement of database

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH036752A (en) * 1989-06-05 1991-01-14 Fujitsu Ltd Duplexing system for file system
JP2002312218A (en) * 2001-04-10 2002-10-25 Ricoh Co Ltd Replication database system, and recording medium recording control program thereof and readable for computer
JP2006309447A (en) * 2005-04-27 2006-11-09 Hitachi Ltd Storage system and backup method
JP2007323422A (en) * 2006-06-01 2007-12-13 Nec Corp Distributed database system and method of data synchronization thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH036752A (en) * 1989-06-05 1991-01-14 Fujitsu Ltd Duplexing system for file system
JP2002312218A (en) * 2001-04-10 2002-10-25 Ricoh Co Ltd Replication database system, and recording medium recording control program thereof and readable for computer
JP2006309447A (en) * 2005-04-27 2006-11-09 Hitachi Ltd Storage system and backup method
JP2007323422A (en) * 2006-06-01 2007-12-13 Nec Corp Distributed database system and method of data synchronization thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112905691A (en) * 2019-11-19 2021-06-04 中盈优创资讯科技有限公司 Information synchronization method and device

Also Published As

Publication number Publication date
JP5094903B2 (en) 2012-12-12

Similar Documents

Publication Publication Date Title
JP6865219B2 (en) Event batch processing, output sequencing, and log-based state storage in continuous query processing
US10089307B2 (en) Scalable distributed data store
US9311199B2 (en) Replaying jobs at a secondary location of a service
US8326800B2 (en) Seamless upgrades in a distributed database system
CN105359099B (en) Index update pipeline
CN102622427A (en) Method and system for read-write splitting database
TW201306632A (en) Recovery service location for a service
KR20230097184A (en) Asynchronous cross-region block volume replication
US10747776B2 (en) Replication control using eventually consistent meta-data
CN102349062A (en) Programming model for synchronizing browser caches across devices and web services
US20240012719A1 (en) Remote snappable linking
CN105723363A (en) Master schema shared across multiple tenants with dynamic update
CN101594377A (en) The system and method that is used for managing Feed data
US20200250151A1 (en) Systems and methods for node consistency in a clustered database
Tang et al. Achieving convergent causal consistency and high availability for cloud storage
CN113254424B (en) Data service migration method, device and equipment
JP5094903B2 (en) Database multiplexing system and multiplexing method
US20100293143A1 (en) Initialization of database for synchronization
US9405816B2 (en) Reconciliation of geo-replicated database clusters
EP2718817A2 (en) Crawl freshness in disaster data center
JP5685213B2 (en) Differential replication system, master database device, and slave database device
CN117643015A (en) Snapshot-based client-side key modification of log records manages keys across a series of nodes
US20170091253A1 (en) Interrupted synchronization detection and recovery
JP6043687B2 (en) Server / client system
KR20200013448A (en) Method and system for minimizing data synchronization traffic

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20120312

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120830

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120911

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120918

R150 Certificate of patent or registration of utility model

Ref document number: 5094903

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150928

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R371 Transfer withdrawn

Free format text: JAPANESE INTERMEDIATE CODE: R371

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350