JP5449485B2 - Replication system and its first and second database devices - Google Patents
Replication system and its first and second database devices Download PDFInfo
- Publication number
- JP5449485B2 JP5449485B2 JP2012184863A JP2012184863A JP5449485B2 JP 5449485 B2 JP5449485 B2 JP 5449485B2 JP 2012184863 A JP2012184863 A JP 2012184863A JP 2012184863 A JP2012184863 A JP 2012184863A JP 5449485 B2 JP5449485 B2 JP 5449485B2
- Authority
- JP
- Japan
- Prior art keywords
- database
- information
- update
- index
- index value
- 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.)
- Active
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
本発明は、レプリケーションシステムにおいて複数の情報を有し且つ当該情報間で関連をもつテーブルとともに使用されるデータベースの更新を迅速に行う技術に関するものである。 The present invention relates to a technique for quickly updating a database used in a replication system that has a plurality of information and is used together with a table related to the information.
近年、通信サービスにおいては、データのIP化やサーバの仮想化(クラウド)等により安価で高付加価値のサービスをユーザが享受できるようになってきている。また、大規模災害時や装置障害時のサービス中断への影響をできる限り最小化する高信頼なネットワークを構築する技術の重要性が高まってきている。このためには、情報処理装置を装置単位で2 重化等の冗長化を図ったり、大規模災害に備え、複数の異なったロケーションに情報処理装置を設置し(例えば、両者間を50Km以上離れた都市間に情報処理装置を設置する等)、複数装置間を同期化(レプリケーション)することにより、片方が罹災し、障害状態となっても、稼働している残った情報処理装置によりサービスを継続可能としている。このような同期化処理において、IP化により、特に遠隔のDB間でデータ通信を行う場合、パケットの転送遅延が大きくなるとともに(特にインターネット経由の場合等)、各パケットの転送経路が異なってくるため、DB間の複数のパケットの送信側順序と受信側順序が異なってくることもある。例えば、パケット1をパケット2より送信側情報処理装置から早く送信したが受信側情報処理装置には、パケット2が最初に到着するようなケースである。同期化においては、これらパケット遅延や送受パケット順序逆転を勘案する必要がある。
In recent years, in communication services, users have been able to enjoy inexpensive and high value-added services through data IP and server virtualization (cloud). In addition, the importance of technology for constructing a highly reliable network that minimizes the impact on service interruption in the event of a large-scale disaster or device failure is increasing. For this purpose, the information processing devices are made redundant, such as by duplication, or installed in multiple different locations in preparation for a large-scale disaster (for example, 50 km or more between them). By installing information processing devices between different cities, etc.) and synchronizing (replication) between multiple devices, even if one side suffers a failure and becomes in trouble, services can be provided by the remaining information processing devices in operation. It is possible to continue. In such synchronization processing, when data is communicated between remote DBs, the packet transfer delay increases (especially, via the Internet, etc.), and the transfer path of each packet differs due to the use of IP. For this reason, the order of transmission side and the order of reception side of a plurality of packets between DBs may be different. For example, the
図8は、従来のレプリケーションシステムの構成の一例を示す図である。
レプリケーションシステム10Aは、通信ネットワークNを介して接続された第1データベース装置1Aと第2データベース装置2Aとを備える。
第1データベース装置1Aは、記憶部11、更新処理部12Aを備え、記憶部11は、データベース11A、空塞管理部11B、チェーン情報記憶部11Cを備える。第1データベース装置1Aは、通信回線を介して、データ投入端末3に接続される。
第2データベース装置2Aは、記憶部21、更新処理部22Aを備え、記憶部21は、データベース21A、空塞管理部21B、チェーン情報記憶部21Cを備える。
FIG. 8 is a diagram showing an example of the configuration of a conventional replication system.
The
The
The
図9に示すように、各データベース11A、21Aは、データを記憶するための複数のレコードを有する。図では、便宜的に、レコードの数は6とし、各レコードを示すIndex値「1」〜「6」も示す。
各空塞管理部11B、21Bは、それぞれデータベース11A、21Aにつき、各レコードが空きレコードか否かを示すステータスを有する。図では、対応するレコードのIndex値「1」〜「6」も示す。
各チェーン情報11D、21Dは、データベース11A、21Aの空きレコードならびに当該空きレコードにデータを書き込む順序を示すもので、それぞれ、チェーン情報記憶部11C、21Cに記憶される。図では、対応するレコードのIndex値「1」〜「6」も示す。
各チェーン情報11D、21Dは、データを書き込む順序の先頭のレコードのIndex値と同じ先頭Index、末尾のレコードのIndex値と同じ末尾Index、ならびに、各レコードにつき、1つ前の順序のレコードのIndex値と同じ前Indexおよび1つ後の順序のレコードのIndex値と同じ後Indexを有する。なお、空きレコードでないレコードの前Index、後Index、先頭のレコードの前Index、末尾のレコードの後Indexは、それぞれ「Null」となっている。
As shown in FIG. 9, each of the
Each empty
The
Each of the
図10は、レプリケーションシステム10Aにおける基本動作を示すシーケンス図である。
データ投入端末3は、データベース11Aの更新すべき部分に関する更新情報を第1データベース装置1Aに送信する(S101)。
更新処理部12Aは、データベース11Aを更新情報に基づいて更新する(S103)。具体的には、更新処理部12Aは、先頭Indexに対応するレコードに対し、更新情報で指示されたデータを書き込む、または、更新情報で指示されたレコードのデータを消去する、または、更新情報で指示されたレコードのデータを更新情報で指示されたデータに変更する(S103)。
次に、更新処理部12Aは、このようにレコードを更新したなら、更新情報を受け付けないように、つまり、受け付けを一時的に中止する(S105)。この動作は、所謂データベースのロック(更新禁止)という。
更新処理部12Aは、このレコードにデータが書き込まれたなら、当該レコードに対応する空塞管理部11Bのステータスを「使用中」に置き換える(S107)。
一方、更新処理部12Aは、このレコードからデータが消去されたなら、当該レコードに対応する空塞管理部11Bのステータスを「空き」に置き換える(S107)。
また、更新処理部12Aは、データが書き込まれたなら、または、消去されたなら、チェーン情報11Dを更新する(S107)。
記憶部11は、こうしてデータベース11Aや空塞管理部11Bやチェーン情報11Dが更新されたら、更新内容を含む更新成功の更新応答を更新処理部12Aを送信する(S109)。
更新処理部12Aは、更新成功の更新応答を受信したなら、データベース11A、空塞管理部11Bおよびチェーン情報11Dの更新された部分に関する更新情報を第2データベース装置2Aに送信する(S111)。
FIG. 10 is a sequence diagram showing a basic operation in the
The
The
Next, when the record is updated in this way, the
When the data is written in this record, the
On the other hand, when the data is deleted from this record, the
Further, the
When the
When the
更新処理部22Aは、データベース21Aを更新情報に基づいて更新する(S113)。具体的には、更新処理部22Aは、更新情報で指示されたレコードに更新情報で指示されたデータを書き込む、または、更新情報で指示されたレコードのデータを消去する、または、更新情報で指示されたレコードのデータを更新情報で指示されたデータに変更する(S113)。
更新処理部22Aは、例えば、更新情報で指示された空塞管理部21Bの位置にあるステータスを、更新情報内に含まれるステータスで置き換える(S117)。
更新処理部22Aは、更新情報で指示されたチェーン情報の位置にある前Index、後Index、先頭Index、末尾Indexを、更新情報内に含まれる前Index、後Index、先頭Index、末尾Indexで置き換える(S117)。
記憶部21は、こうしてデータベース21Aや空塞管理部21Bやチェーン情報21Dが更新されたら、更新内容を含む更新成功の更新応答を更新処理部22Aに送信する(S119)。
更新処理部22Aは、記憶部21から更新成功の更新応答を受信したなら、第1データベース装置1Aに更新成功の更新応答を送信する(S121)。
The
For example, the
The
When the
If the
更新処理部12Aは、更新成功の更新応答を受信したなら、更新成功の更新応答をデータ投入端末3に送信し(S123)、中止した更新情報の受け付けを再開する(S125)。つまり、データベースのロックを解除する。
ステップS105からステップS125の間は、更新情報の受け付けが中止されるので、その間に受信される更新情報に対しては(S131)、更新失敗の応答が返信される(S133)。
If the
Since the acceptance of update information is canceled between step S105 and step S125, an update failure response is returned to the update information received during that time (S131) (S133).
次に、図11を参照し、レプリケーションシステム10Aにおいて更新情報の受け付けを一時的に中止する理由を説明する。つまり、ステップS105、S125を実行しない場合について説明する。図9と同様、レコードの数は便宜的に6とする。
例えば、第1データベース装置1Aにおいて、データベース11AのIndex値「2」のレコードに「BB」が書き込まれると(G1)、空塞管理部11BのIndex値「2」のステータスが「使用中」に変わり、チェーン情報11DのIndex値「2」の後Indexが「Null」に変わり、Index値「4」の前Indexが「Null」に変わり、先頭Indexが「4」に変わる(G3)。
第1データベース装置1Aは、Index値「2」のレコード、Index値「2」のステータス、Index値「2」の後Index、Index値「4」の前Indexおよび先頭Indexに関する更新情報を第2データベース装置2Aに送信する(G5)。
また、第1データベース装置1Aにおいて、データベース11AのIndex値「4」のレコードに「DD」が書き込まれると(G11)、空塞管理部11BのIndex値「4」のステータスが「使用中」に変わり、チェーン情報11DのIndex値「4」の後Indexが「Null」に変わり、Index値「5」の前Indexが「Null」に変わり、先頭Indexが「5」に変わる(G13)。
第1データベース装置1Aは、Index値「4」のレコード、Index値「4」のステータス、Index値「4」の後Index、Index値「5」の前Indexおよび先頭Indexに関する更新情報を第2データベース装置2Aに送信する(G15)。
Next, with reference to FIG. 11, a reason for temporarily stopping acceptance of update information in the
For example, in the
The
In addition, in the
The
例えば、ステップG5の更新情報よりもステップG15の更新情報が早く受信された際には、第2データベース装置2Aにおいては、データベース21AのIndex値「4」のレコードに「DD」が書き込まれ、空塞管理部21BのIndex値「4」のステータスが「使用中」に変わり、チェーン情報21DのIndex値「4」の後Indexが「Null」に変わり、Index値「5」の前Indexが「Null」に変わり、先頭Indexが「5」に変わる(G21)。
その後、ステップG5の更新情報が受信された際には、第2データベース装置2Aにおいては、データベース21AのIndex値「2」のレコードに「BB」が書き込まれ、空塞管理部21BのIndex値「2」のステータスが「使用中」に変わり、チェーン情報21DのIndex値「2」の後Indexが「Null」に変わり、先頭Indexが「4」に変わる(G23)。
つまり、この時点では、チェーン情報11Dとチェーン情報21Dは互いに一致しておらず、チェーン情報21Dにおいては、順序の矛盾がある。
For example, when the update information of step G15 is received earlier than the update information of step G5, in the
Thereafter, when the update information of step G5 is received, in the
That is, at this time, the
すなわち、図12に示すように、チェーン情報21Dにおいては、Index値「4」の後Indexが「5」であり、Index値「5」の前Indexは「Null」であり、両者は矛盾する。
したがって、データベースのロックと解除(ステップS105、S125)を実行することで、このような矛盾の発生を防止する必要がある。
しかし、ステップS105、S125を実行すると、その一方で、あるレコードを更新している間は、他のレコードは更新できず、複数のレコードを更新するのに長時間を要する。
つまり、チェーン情報のような、複数の情報を有し且つ当該情報間で関連をもつテーブルとともに使用されるデータベースの更新が迅速に行えないという問題がある。
That is, as shown in FIG. 12, in the
Therefore, it is necessary to prevent such a contradiction from occurring by executing database lock and release (steps S105 and S125).
However, when steps S105 and S125 are executed, on the other hand, while a certain record is being updated, other records cannot be updated, and it takes a long time to update a plurality of records.
That is, there is a problem that a database used together with a table having a plurality of pieces of information such as chain information and related to the information cannot be updated quickly.
本発明は、上記の課題に鑑みてなされたものであり、その目的とするところは、レプリケーションシステムにおいて複数の情報を有し且つ当該情報間で関連をもつテーブルとともに使用されるデータベースの更新を迅速に行う技術を提供することにある。 The present invention has been made in view of the above-described problems, and an object of the present invention is to quickly update a database used together with a table having a plurality of information and having a relation between the information in the replication system. It is to provide technology to be performed.
上記の課題を解決するために、第1の本発明は、第1データベース装置と第2データベース装置を備えるレプリケーションシステムであって、前記第1データベース装置は、データを記憶するための複数のレコードを有する第1データベース、複数の情報を有し且つ当該情報間で関連をもつテーブルが記憶される第1テーブル記憶部、前記第1データベースを更新し、更新後の前記第1データベースに基づいて前記第1テーブル記憶部のテーブルを更新し、前記第1データベースの更新された部分に関する更新情報を前記第2データベース装置に送信する第1更新処理部を備え、前記第2データベース装置は、前記第1データベースに一致すべき第2データベース、複数の情報を有し且つ当該情報間で関連をもつテーブルが記憶される第2テーブル記憶部、前記更新情報に基づいて前記第2データベースを更新し、更新後の前記第2データベースに基づいて前記第2テーブル記憶部のテーブルを更新する第2更新処理部を備えることを特徴とする。 In order to solve the above-described problem, a first aspect of the present invention is a replication system including a first database device and a second database device, wherein the first database device stores a plurality of records for storing data. A first database having a plurality of pieces of information and storing a table related to the information; updating the first database; and updating the first database based on the updated first database. A first update processing unit that updates a table in a one-table storage unit and transmits update information related to the updated portion of the first database to the second database device, wherein the second database device includes the first database; A second database that stores a plurality of pieces of information and a table associated with the pieces of information. And a second update processing unit that updates the second database based on the update information and updates the table of the second table storage unit based on the updated second database. To do.
例えば、前記第2更新処理部は、前記第2データベースを更新したなら、前記第1更新処理部に更新応答を送信するものであり、前記第1更新処理部は、前記第2データベース装置に更新情報を送信してから、前記更新応答を受信するまでは、前記第1データベース装置の更新された部分を更新しない。 For example, when the second update processing unit updates the second database, the second update processing unit transmits an update response to the first update processing unit, and the first update processing unit updates the second database device. The updated portion of the first database device is not updated until the update response is received after the information is transmitted.
第2の本発明は、第1データベース装置と第2データベース装置を備えるレプリケーションシステムの前記第1データベース装置であって、前記第1データベース装置は、データを記憶するための複数のレコードを有する第1データベース、複数の情報を有し且つ当該情報間で関連をもつテーブルが記憶される第1テーブル記憶部、前記第1データベースを更新し、更新後の前記第1データベースに基づいて前記第1テーブル記憶部のテーブルを更新し、前記第1データベースの更新された部分に関する更新情報を前記第2データベース装置に送信する第1更新処理部を備え、前記第2データベース装置は、前記第1データベースに一致すべき第2データベース、複数の情報を有し且つ当該情報間で関連をもつテーブルが記憶される第2テーブル記憶部、前記更新情報に基づいて前記第2データベースを更新し、更新後の前記第2データベースに基づいて前記第2テーブル記憶部のテーブルを更新する第2更新処理部を備えることを特徴とする。 A second aspect of the present invention is the first database device of a replication system comprising a first database device and a second database device, wherein the first database device has a plurality of records for storing data. A database, a first table storage unit storing a plurality of pieces of information and a table related to the information, and updating the first database, and storing the first table based on the updated first database A first update processing unit that updates a table of a part and transmits update information regarding the updated portion of the first database to the second database device, wherein the second database device matches the first database Second database that stores a plurality of pieces of information and a table that has relations between the pieces of information. And a second update processing unit that updates the second database based on the update information and updates a table of the second table storage unit based on the updated second database. To do.
第3の本発明は、第1データベース装置と第2データベース装置を備えるレプリケーションシステムの前記第2データベース装置であって、前記第1データベース装置は、データを記憶するための複数のレコードを有する第1データベース、複数の情報を有し且つ当該情報間で関連をもつテーブルが記憶される第1テーブル記憶部、前記第1データベースを更新し、更新後の前記第1データベースに基づいて前記第1テーブル記憶部のテーブルを更新し、前記第1データベースの更新された部分に関する更新情報を前記第2データベース装置に送信する第1更新処理部を備え、前記第2データベース装置は、前記第1データベースに一致すべき第2データベース、複数の情報を有し且つ当該情報間で関連をもつテーブルが記憶される第2テーブル記憶部、前記更新情報に基づいて前記第2データベースを更新し、更新後の前記第2データベースに基づいて前記第2テーブル記憶部のテーブルを更新する第2更新処理部を備えることを特徴とする。 The third aspect of the present invention is the second database device of a replication system comprising a first database device and a second database device, wherein the first database device has a plurality of records for storing data. A database, a first table storage unit storing a plurality of pieces of information and a table related to the information, and updating the first database, and storing the first table based on the updated first database A first update processing unit that updates a table of a part and transmits update information regarding the updated portion of the first database to the second database device, wherein the second database device matches the first database Second database that stores a plurality of pieces of information and a table that has relations between the pieces of information. And a second update processing unit that updates the second database based on the update information and updates a table of the second table storage unit based on the updated second database. To do.
本発明によれば、レプリケーションシステムにおいて複数の情報を有し且つ当該情報間で関連をもつテーブルとともに使用されるデータベースの更新を迅速に行うことができる。 ADVANTAGE OF THE INVENTION According to this invention, the update of the database used with the table which has several information in a replication system and has a relationship between the said information can be performed rapidly.
以下、本発明の実施の形態について図面を参照して説明する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings.
図1は、本実施の形態に係るレプリケーションシステムの構成図である。 FIG. 1 is a configuration diagram of a replication system according to the present embodiment.
レプリケーションシステム10は、通信ネットワークNを介して接続された第1データベース装置1と第2データベース装置2とを備えるレプリケーションシステムである。
The
第1データベース装置1は、記憶部11、更新処理部12(本発明の第1更新処理部に相当)を備え、記憶部11は、データベース11A(本発明の第1データベースに相当)、空塞管理部11B、チェーン情報記憶部11C(本発明の第1テーブル記憶部に相当)を備える。第1データベース装置1は、通信回線を介して、データ投入端末3に接続される。
The
第2データベース装置2は、記憶部21、更新処理部22(本発明の第2更新処理部に相当)を備え、記憶部21は、データベース21A(本発明の第2データベースに相当)、空塞管理部21B、チェーン情報記憶部21C(本発明の第2テーブル記憶部に相当)を備える。
The
レプリケーションシステム10は、通常では、まず、データベース11Aを更新し、データベース11Aを更新したら、データベース21Aをデータベース11Aに一致させるべく更新するようになっている。つまり、通常では、データベース11Aが所謂マスターデータベースである。
Normally, the
しかし、場合によっては、まず、データベース21Aを更新し、次に、データベース11Aを更新することもある。この場合は、データベース21Aがマスターデータベースである。
However, in some cases, the
この目的故に、空塞管理部11B、21Bは同一構成を有し、チェーン情報記憶部11C、21Cは同一構成を有し、更新処理部12、22は同じ機能を備えている。
For this purpose, the
なお、以下の説明では、便宜上、データベース11Aがマスターデータベースである場合を主に述べる。
In the following description, the case where the
図2に示すように、各データベース11A、21Aは、データを記憶するための複数のレコードを有する。図では、便宜的に、レコードの数は6とし、各レコードを示すIndex値「1」〜「6」も示す。
As shown in FIG. 2, each of the
各空塞管理部11B、21Bは、それぞれデータベース11A、21Aにつき、各レコードが空きレコードか否かを示すステータスを有する。図では、対応するレコードのIndex値「1」〜「6」も示す。
Each empty
各チェーン情報11D、21Dは、データベース11A、21Aの空きレコードならびに当該空きレコードにデータを書き込む順序を示すもので、それぞれ、チェーン情報記憶部11C、21Cに記憶される。図では、対応するレコードのIndex値「1」〜「6」も示す。各チェーン情報11D、21Dは、データベース11A、21Aを高速に検索するのに使用される。
The
各チェーン情報11D、21Dは、データを書き込む順序の先頭のレコードのIndex値と同じ先頭Index、末尾のレコードのIndex値と同じ末尾Index、ならびに、各レコードにつき、1つ前の順序のレコードのIndex値と同じ前Indexおよび1つ後の順序のレコードのIndex値と同じ後Indexを有する。なお、空きレコードでないレコードの前Index、後Index、先頭のレコードの前Index、末尾のレコードの後Indexは、それぞれ「Null」となっている。
Each of the
つまり、各チェーン情報11D、21Dは、各レコードについての情報からなる複数の情報を有し且つ当該情報間で関連をもつテーブルである。
That is, each
図1に戻り、データ投入端末3は、更新すべき部分に関する更新情報を第1データベース装置1に送信するものである。
Returning to FIG. 1, the
更新処理部12は、データ投入端末3からの更新情報に基づき、データベース11Aを更新し、更新後のデータベース11Aに基づいて、空塞管理部11Bおよびチェーン情報11Dを更新し、データベース11Aおよび空塞管理部11Bの更新された部分に関する更新情報を第2データベース装置2に送信するものである。なお、以下の説明では省略するが、更新処理部22は、同様にデータベース21A、空塞管理部21Bおよびチェーン情報21Dを更新し、データベース21Aおよび空塞管理部21Bの更新された部分に関する更新情報を第1データベース装置1に送信することができる。
The
更新処理部22は、第1データベース装置1からの更新情報に基づき、データベース21Aおよび空塞管理部21Bを更新し、更新後のデータベース21Aまたは更新後の空塞管理部21Bに基づいて、チェーン情報21Dを更新するものである。以下の説明では省略するが、更新処理部12は、同様にデータベース11A、空塞管理部11Bおよびチェーン情報11Dを更新することができる。
The
(基本動作)
図3は、レプリケーションシステム10における基本動作を示すシーケンス図である。
(basic action)
FIG. 3 is a sequence diagram showing a basic operation in the
なお、便宜上、データベース21Aがマスターデータベースである場合だけを述べる。
For convenience, only the case where the
データ投入端末3は、データベース11Aの更新すべき部分に関する更新情報を第1データベース装置1に送信する(S1)。
The
更新処理部12は、データベース11Aを更新情報に基づいて更新する(S3)。具体的には、更新処理部12は、先頭Indexに対応するレコードに対し、更新情報で指示されたデータを書き込む、または、更新情報で指示されたレコードのデータを消去する、または、更新情報で指示されたレコードのデータを更新情報で指示されたデータに変更する(S3)。
The
次に、更新処理部12は、このように更新したレコードについては、更新情報を受け付けないように、つまり、受け付けを一時的に中止する(S5)。この動作は、所謂レコードのロック(更新禁止)という。
Next, the
更新処理部12は、このレコードにデータが書き込まれたなら、当該レコードに対応する空塞管理部11Bのステータスを「使用中」に置き換える(S7)。
When the data is written in this record, the
一方、更新処理部12は、このレコードからデータが消去されたなら、当該レコードに対応する空塞管理部11Bのステータスを「空き」に置き換える(S7)。
On the other hand, when the data is deleted from this record, the
また、更新処理部12は、データが書き込まれたなら、または、消去されたなら、チェーン情報11Dを更新する(S7)。
Further, the
具体的には、チェーン情報11Dが、データを書き込む順序でIndex値が「2−4−5−6」となるようなものの場合、更新処理部12は、先頭Indexが示すレコードにデータを書き込んだなら、「2−4−5−6」が「4−5−6」となるようにチェーン情報11Dを更新する。
Specifically, when the
一方、チェーン情報11Dが、データを書き込む順序でIndex値が「2−5−6」となるようなものの場合、更新処理部12は、例えば、Index値「3」のレコードからデータを消去したなら、「2−5−6」が「2−5−6−3」となるようにチェーン情報11Dを更新する。
On the other hand, when the
記憶部11は、こうしてデータベース11Aや空塞管理部11Bやチェーン情報11Dが更新されたら、更新内容を含む更新成功の更新応答を更新処理部12を送信する(S9)。
When the
更新処理部12は、更新成功の更新応答を受信したなら、データベース11Aおよび空塞管理部11Bの更新された部分に関する更新情報を第2データベース装置2に送信する(S11)。
If the
更新処理部22は、データベース21Aを更新情報に基づいて更新する(S13)。具体的には、更新処理部22は、更新情報で指示されたレコードに更新情報で指示されたデータを書き込む、または、更新情報で指示されたレコードのデータを消去する、または、更新情報で指示されたレコードのデータを更新情報で指示されたデータに変更する(S13)。
The
更新処理部22は、例えば、更新情報で指示された空塞管理部21Bの位置にあるステータスを、更新情報内に含まれるステータスで置き換える(S17)。
For example, the
記憶部21は、こうしてデータベース21Aや空塞管理部21Bが更新されたら、更新内容を含む更新成功の更新応答を更新処理部22に送信する(S19)。
When the
また、更新処理部22は、こうしてデータベース21Aが更新されたなら、更新後のデータベース21Aに基づいて、チェーン情報21Dを更新する(S21)。
Further, when the
具体的には、チェーン情報21Dが、データを書き込む順序でIndex値が「2−4−5−6」となるようなものの場合、更新処理部22は、先頭Indexが示すレコードにデータを書き込んだなら、「2−4−5−6」が「4−5−6」となるようにチェーン情報21Dを更新する。
Specifically, when the
一方、チェーン情報21Dが、データを書き込む順序でIndex値が「2−5−6」となるようなものの場合、更新処理部22は、例えば、Index値「3」のレコードからデータを消去したなら、「2−5−6」が「2−5−6−3」となるようにチェーン情報21Dを更新する。
On the other hand, when the
更新処理部22は、記憶部21から更新成功の更新応答を受信したなら、第1データベース装置1に更新成功の更新応答を送信する(S23)。
If the
更新処理部12は、更新成功の更新応答を受信したなら、更新成功の更新応答をデータ投入端末3に送信し(S25)、更新情報の受け付けを中止したレコードについて、更新情報の受け付けを再開する(S27)。つまり、レコードのロックを解除する。
If the
(動作例1)
次に、図4を参照し、レプリケーションシステム10の具体的な動作例(動作例1)について説明する。図2と同様、レコードの数は便宜的に6とする。
(Operation example 1)
Next, a specific operation example (operation example 1) of the
まず、当初、各データベース11A、データベース21Aでは、Index値「1」のレコードにデータ「AA」、Index値「3」のレコードに「CC」があり、他のレコードは空きレコードになっている。つまり、データベース11Aとデータベース21Aは互いに一致している。
First, in each of the
また、当初、各空塞管理部11B、空塞管理部21Bでは、Index値「1」のステータスと、Index値「3」のステータスが「使用中」で、他のステータスは「空き」である。つまり、空塞管理部11Bと空塞管理部21Bは互いに一致している。
Initially, in each of the
また、各チェーン情報11D、チェーン情報21Dでは、Index値「1」の前Index、Index値「1」の後Indexは「Null」であり、Index値「2」の前Index、Index値「2」の後Indexはそれぞれ、「Null」、「4」であり、Index値「3」の前Index、Index値「3」の後Indexは「Null」であり、Index値「4」の前Index、Index値「4」の後Indexはそれぞれ、「2」、「5」であり、Index値「5」の前Index、Index値「5」の後Indexはそれぞれ、「4」、「6」であり、Index値「6」の前Index、Index値「6」の後Indexはそれぞれ、「5」、「Null」であり、先頭Indexは「2」であり、末尾Indexは「6」である。つまり、チェーン情報11Dとチェーン情報21Dは互いに一致しており、各チェーン情報11D、チェーン情報21Dにおいては、順序の抜けや重複などの矛盾がない。
In each
例えば、第1データベース装置1において、データベース11AのIndex値「2」のレコードに「BB」が書き込まれると(T1)、空塞管理部11BのIndex値「2」のステータスが「使用中」に変わり、チェーン情報11DのIndex値「2」の後Indexが「Null」に変わり、Index値「4」の前Indexが「Null」に変わり、先頭Indexが「4」に変わる(T3)。
For example, in the
第1データベース装置1は、Index値「2」のレコード、Index値「2」のステータスに関する更新情報を第2データベース装置2に送信する(T5)。
The
また、第1データベース装置1において、データベース11AのIndex値「4」のレコードに「DD」が書き込まれると(T11)、空塞管理部11BのIndex値「4」のステータスが「使用中」に変わり、チェーン情報11DのIndex値「4」の後Indexが「Null」に変わり、Index値「5」の前Indexが「Null」に変わり、先頭Indexが「5」に変わる(T13)。
Further, in the
第1データベース装置1は、Index値「4」のレコード、Index値「4」のステータスに関する更新情報を第2データベース装置2に送信する(T15)。
The
例えば、ステップT5の更新情報よりもステップT15の更新情報が早く受信された際には、第2データベース装置2においては、データベース21AのIndex値「4」のレコードに「DD」が書き込まれ、空塞管理部21BのIndex値「4」のステータスが「使用中」に変わり、チェーン情報21DのIndex値「2」の後Indexが「5」に変わり、Index値「4」の前Indexが「Null」に変わり、Index値「4」の後Indexが「Null」に変わる(T21)。
For example, when the update information at step T15 is received earlier than the update information at step T5, in the
その後、ステップT5の更新情報が受信された際には、第2データベース装置2においては、データベース21AのIndex値「2」のレコードに「BB」が書き込まれ、空塞管理部21BのIndex値「2」のステータスが「使用中」に変わり、チェーン情報21DのIndex値「2」の後Indexが「Null」に変わり、Index値「5」の前Indexが「Null」に変わり、先頭Indexが「5」に変わる(T23)。
Thereafter, when the update information in step T5 is received, in the
つまり、チェーン情報11Dとチェーン情報21Dは互いに一致しており、各チェーン情報11D、チェーン情報21Dにおいては、順序の抜けや重複などの矛盾がない。
That is, the
(動作例2)
次に、図5を参照し、レプリケーションシステム10の具体的な動作例(動作例2)について説明する。
(Operation example 2)
Next, a specific operation example (operation example 2) of the
まず、当初、各データベース11A、データベース21Aでは、Index値「1」のレコードに「AA」、Index値「3」のレコードに「CC」、Index値「4」のレコードに「DD」があり、他のレコードは空きレコードになっている。つまり、データベース11Aとデータベース21Aは互いに一致している。
First, in each of the
また、当初、各空塞管理部11B、空塞管理部21Bでは、Index値「1」のステータス、Index値「3」のステータス、Index値「4」のステータスが「使用中」で、他のステータスは「空き」である。つまり、空塞管理部11Bと空塞管理部21Bは互いに一致している。
Initially, each of the
また、各チェーン情報11D、チェーン情報21Dでは、Index値「1」の前Index、Index値「1」の後Indexは「Null」であり、Index値「2」の前Index、Index値「2」の後Indexはそれぞれ、「Null」、「5」であり、Index値「3」の前Index、Index値「3」の後Indexは「Null」であり、Index値「4」の前Index、Index値「4」の後Indexは「Null」であり、Index値「5」の前Index、Index値「5」の後Indexはそれぞれ、「2」、「6」であり、Index値「6」の前Index、Index値「6」の後Indexはそれぞれ、「5」、「Null」であり、先頭Indexは「2」であり、末尾Indexは「6」である。つまり、チェーン情報11Dとチェーン情報21Dは互いに一致しており、各チェーン情報11D、チェーン情報21Dにおいては、順序の抜けや重複などの矛盾がない。
In each
例えば、第1データベース装置1において、データベース11AのIndex値「3」のレコードから「CC」が消去されると(T31)、空塞管理部11BのIndex値「3」のステータスが「空き」に変わり、チェーン情報11DのIndex値「3」の前Indexが「6」に変わり、Index値「6」の後Indexが「3」に変わり、末尾Indexが「3」に変わる(T33)。
For example, in the
第1データベース装置1は、Index値「3」のレコード、Index値「3」のステータスに関する更新情報を第2データベース装置2に送信する(T35)。
The
また、第1データベース装置1において、データベース11AのIndex値「1」のレコードから「AA」が消去されると(T41)、空塞管理部11BのIndex値「1」のステータスが「空き」に変わり、チェーン情報11DのIndex値「1」の前Indexが「3」に変わり、Index値「3」の後Indexが「1」に変わり、末尾Indexが「1」に変わる(T43)。
In addition, in the
第1データベース装置1は、Index値「1」のレコード、Index値「1」のステータスに関する更新情報を第2データベース装置2に送信する(T45)。
The
例えば、ステップT35の更新情報よりもステップT45の更新情報が早く受信された際には、第2データベース装置2においては、データベース21AのIndex値「1」のレコードから「AA」が消去され、空塞管理部21BのIndex値「1」のステータスが「空き」に変わり、チェーン情報21DのIndex値「1」の前Indexが「6」に変わり、Index値「6」の後Indexが「1」に変わり、末尾Indexが「1」に変わる(T51)。
For example, when the update information in step T45 is received earlier than the update information in step T35, the
その後、ステップT35の更新情報が受信された際には、第2データベース装置2においては、データベース21AのIndex値「3」のレコードから「CC」が消去され、空塞管理部21BのIndex値「3」のステータスが「空き」に変わり、チェーン情報21DのIndex値「1」の後Indexが「3」に変わり、Index値「3」の前Indexが「1」に変わり、末尾Indexが「3」に変わる(T53)。
After that, when the update information in step T35 is received, in the
つまり、チェーン情報11Dとチェーン情報21Dは互いに一致していないが、各チェーン情報11D、チェーン情報21Dにおいては、順序の抜けや重複などの矛盾がない。よって、データベース21Aがマスターデータベースとなっても問題はない。
That is, the
なお、このような場合であってもチェーン情報11Dとチェーン情報21Dを一致させるには、以下のようにすればよい。
Even in such a case, the
つまり、チェーン情報11Dが、データを書き込む順序でIndex値が「2−5−6」となるようなもの場合、更新処理部12は、例えば、Index値「3」のレコードからデータを消去したなら、「2−5−6」が「2−3−5−6」となるようにチェーン情報11Dを更新し、チェーン情報21Dが、データを書き込む順序でIndex値が「2−5−6」となるようなもの場合、更新処理部22は、例えば、Index値「3」のレコードからデータを消去したなら、「2−5−6」が「2−3−5−6」となるようにチェーン情報21Dを更新すればよい。
That is, if the
(変形例)
本実施の形態では、各チェーン情報11D、チェーン情報21Dは、図6(a)に示すように、先頭Indexと後Indexだけからなるものとしてもよい。また、各チェーン情報11D、チェーン情報21Dは、図6(b)に示すように、先頭Indexと後Indexだけからなるものとしてもよい。
(Modification)
In the present embodiment, each
また、各空塞管理部11B、空塞管理部21Bのステータスは、図7に示すように、それぞれデータベース11A、データベース21Aの対応するレコードに含めてもよい。
Further, the statuses of the air /
以上説明したように、本実施の形態によれば、第1データベース装置1から第2データベース装置2には、チェーン情報11Dの更新された部分に関する更新情報を送信せず、更新処理部22は、更新後のデータベース21Aに基づいてチェーン情報21Dを更新するので、あるレコードを更新している間でも、他のレコードなら更新でき、もって、チェーン情報11D、チェーン情報21Dとともに使用されるデータベース11A、データベース21Aの更新を迅速に行うことができる。
As described above, according to the present embodiment, the update information on the updated portion of the
また、チェーン情報11Dの更新された部分に関する更新情報を送信しないので、送信される更新情報の量を低減することができる。
Moreover, since the update information regarding the updated part of the
なお、チェーン情報21Dを更新する代わりに、更新後のデータベース21Aに基づいて新たにチェーン情報21Dを生成し、これで既存のチェーン情報21Dを置き換えてもよい。この場合であっても、結果的には、更新後のデータベース21Aに基づいてチェーン情報21Dが更新されたことになる。
Instead of updating the
また、空塞管理部11B、空塞管理部21Bのステータスは、データベース11A、データベース21Aに基づいて、適宜取得できるので、空塞管理部11B、空塞管理部21Bを設けなくてもよい。
Moreover, since the status of the air /
また、本実施の形態では、複数の情報を有し且つ当該情報間で関連をもつテーブルの例として、チェーン情報を用いたが、チェーン情報に限らず、テーブルは、複数の情報を有し且つ当該情報間で関連をもつものであればよい。 In this embodiment, chain information is used as an example of a table having a plurality of information and having a relationship between the information. However, the table is not limited to the chain information, and the table has a plurality of information and What is necessary is just to have a relationship between the said information.
また、第1データベース装置1や第2データベース装置2としてコンピュータを機能させるためのコンピュータプログラムは、半導体メモリ、磁気ディスク、光ディスク、光磁気ディスク、磁気テープなどのコンピュータ読み取り可能な記録媒体に記録でき、また、インターネットなどの通信網を介して伝送させて、広く流通させることができる。
A computer program for causing a computer to function as the
1 第1データベース装置
2 第2データベース装置
3 データ投入端末
10 レプリケーションシステム
11、21 記憶部
11A、21A データベース
11B、21B 空塞管理部
11C、21C チェーン情報記憶部
11D、21D チェーン情報
12、22 更新処理部
DESCRIPTION OF
Claims (4)
前記第1データベース装置は、
データを記憶するための複数のレコードを有する第1データベース、複数の情報を有し且つ当該情報間で関連をもつテーブルが記憶される第1テーブル記憶部、前記第1データベースを更新し、更新後の前記第1データベースに基づいて前記第1テーブル記憶部のテーブルを更新し、前記第1データベースの更新された部分に関する更新情報を前記第2データベース装置に送信する第1更新処理部を備え、
前記第2データベース装置は、
前記第1データベースに一致すべき第2データベース、複数の情報を有し且つ当該情報間で関連をもつテーブルが記憶される第2テーブル記憶部、前記更新情報に基づいて前記第2データベースを更新し、更新後の前記第2データベースに基づいて前記第2テーブル記憶部のテーブルを更新する第2更新処理部を備える
ことを特徴とするレプリケーションシステム。 A replication system comprising a first database device and a second database device,
The first database device includes:
A first database having a plurality of records for storing data, a first table storage section storing a table having a plurality of information and related to the information, updating the first database, and after updating A first update processing unit that updates the table of the first table storage unit based on the first database, and transmits update information regarding the updated portion of the first database to the second database device;
The second database device includes:
A second database to be matched with the first database, a second table storage unit storing a table having a plurality of pieces of information and related to the information, and updating the second database based on the update information A replication system comprising: a second update processing unit that updates a table in the second table storage unit based on the updated second database.
前記第1更新処理部は、前記第2データベース装置に更新情報を送信してから、前記更新応答を受信するまでは、前記第1データベース装置の更新された部分を更新しない
ことを特徴とする請求項1記載のレプリケーションシステム。 When the second update processing unit has updated the second database, the second update processing unit transmits an update response to the first update processing unit;
The first update processing unit does not update the updated portion of the first database device until the update response is received after the update information is transmitted to the second database device. Item 1. The replication system according to item 1.
前記第1データベース装置は、
データを記憶するための複数のレコードを有する第1データベース、複数の情報を有し且つ当該情報間で関連をもつテーブルが記憶される第1テーブル記憶部、前記第1データベースを更新し、更新後の前記第1データベースに基づいて前記第1テーブル記憶部のテーブルを更新し、前記第1データベースの更新された部分に関する更新情報を前記第2データベース装置に送信する第1更新処理部を備え、
前記第2データベース装置は、
前記第1データベースに一致すべき第2データベース、複数の情報を有し且つ当該情報間で関連をもつテーブルが記憶される第2テーブル記憶部、前記更新情報に基づいて前記第2データベースを更新し、更新後の前記第2データベースに基づいて前記第2テーブル記憶部のテーブルを更新する第2更新処理部を備える
ことを特徴とするレプリケーションシステムの第1データベース装置。 The first database device of a replication system comprising a first database device and a second database device,
The first database device includes:
A first database having a plurality of records for storing data, a first table storage section storing a table having a plurality of information and related to the information, updating the first database, and after updating A first update processing unit that updates the table of the first table storage unit based on the first database, and transmits update information regarding the updated portion of the first database to the second database device;
The second database device includes:
A second database to be matched with the first database, a second table storage unit storing a table having a plurality of pieces of information and related to the information, and updating the second database based on the update information A first database device of a replication system, comprising: a second update processing unit that updates a table in the second table storage unit based on the updated second database.
前記第1データベース装置は、
データを記憶するための複数のレコードを有する第1データベース、複数の情報を有し且つ当該情報間で関連をもつテーブルが記憶される第1テーブル記憶部、前記第1データベースを更新し、更新後の前記第1データベースに基づいて前記第1テーブル記憶部のテーブルを更新し、前記第1データベースの更新された部分に関する更新情報を前記第2データベース装置に送信する第1更新処理部を備え、
前記第2データベース装置は、
前記第1データベースに一致すべき第2データベース、複数の情報を有し且つ当該情報間で関連をもつテーブルが記憶される第2テーブル記憶部、前記更新情報に基づいて前記第2データベースを更新し、更新後の前記第2データベースに基づいて前記第2テーブル記憶部のテーブルを更新する第2更新処理部を備える
ことを特徴とするレプリケーションシステムの第2データベース装置。 The second database device of a replication system comprising a first database device and a second database device,
The first database device includes:
A first database having a plurality of records for storing data, a first table storage section storing a table having a plurality of information and related to the information, updating the first database, and after updating A first update processing unit that updates the table of the first table storage unit based on the first database, and transmits update information regarding the updated portion of the first database to the second database device;
The second database device includes:
A second database to be matched with the first database, a second table storage unit storing a table having a plurality of pieces of information and related to the information, and updating the second database based on the update information A second database device of a replication system, comprising: a second update processing unit that updates a table in the second table storage unit based on the updated second database.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2012184863A JP5449485B2 (en) | 2012-08-24 | 2012-08-24 | Replication system and its first and second database devices |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2012184863A JP5449485B2 (en) | 2012-08-24 | 2012-08-24 | Replication system and its first and second database devices |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2014044466A JP2014044466A (en) | 2014-03-13 |
| JP5449485B2 true JP5449485B2 (en) | 2014-03-19 |
Family
ID=50395712
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2012184863A Active JP5449485B2 (en) | 2012-08-24 | 2012-08-24 | Replication system and its first and second database devices |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP5449485B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP6415565B2 (en) * | 2014-07-31 | 2018-10-31 | 三菱電機株式会社 | Controller, home system, synchronization control method, and program |
| CN110851528B (en) * | 2019-10-09 | 2022-09-02 | 网联清算有限公司 | Database synchronization method and device, storage medium and computer equipment |
-
2012
- 2012-08-24 JP JP2012184863A patent/JP5449485B2/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| JP2014044466A (en) | 2014-03-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN103875229B (en) | asynchronous replication method, device and system | |
| CN103780638B (en) | Method of data synchronization and system | |
| US8255360B1 (en) | Synchronization of database changes among multiple devices | |
| CN103095769B (en) | Across method of data synchronization and the system of machine room | |
| JP2003263280A (en) | Data synchronization method for multiple remote storages | |
| JP6475304B2 (en) | Transaction processing method and apparatus | |
| CN104346373A (en) | Partition log queue synchronization management method and device | |
| CN104793981B (en) | A kind of online snapshot management method and device of cluster virtual machine | |
| CN101526958A (en) | Method and system for synchronizing data between IPTV system modules | |
| CN103856516A (en) | Data storage and reading method and data storage and reading device | |
| JP2013015915A (en) | Transmission control method, device and program | |
| KR100922584B1 (en) | Distributed object-sharing system and method thereof | |
| JP5449485B2 (en) | Replication system and its first and second database devices | |
| CN106897288B (en) | Service providing method and system for database | |
| CN104601471A (en) | Read-write method for forward information base and network processor | |
| CN101183985A (en) | Method and system for issuing configuration commands incrementally | |
| CN106855869A (en) | A kind of methods, devices and systems for realizing database High Availabitity | |
| CN106354830B (en) | Method and device for data synchronization between database cluster nodes | |
| CN109241110A (en) | Order management method and system, electronic equipment, storage medium | |
| US8954384B2 (en) | File storage system and file storage method | |
| JP4715777B2 (en) | Replication method, storage apparatus, and program | |
| JP6172294B2 (en) | Transaction distributed processing apparatus, method, system, and storage medium | |
| WO2013187034A1 (en) | Content management device and content management method | |
| JP2025078594A (en) | Method, system, device and storage medium for implementing message queue topic multiplexing | |
| JP5432959B2 (en) | Data holding system, data holding device and data holding method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 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: 20131217 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20131224 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 5449485 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| 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 |
|
| 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 |