Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP5449485B2 - Replication system and its first and second database devices - Google Patents
[go: Go Back, main page]

JP5449485B2 - Replication system and its first and second database devices - Google Patents

Replication system and its first and second database devices Download PDF

Info

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
Application number
JP2012184863A
Other languages
Japanese (ja)
Other versions
JP2014044466A (en
Inventor
俊樹 村田
雄介 中野
紀貴 堀米
高太朗 三上
健二 阿部
潤子 佐々木
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.)
NTT Inc
NTT Inc USA
Original Assignee
Nippon Telegraph and Telephone Corp
NTT Inc USA
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 Nippon Telegraph and Telephone Corp, NTT Inc USA filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2012184863A priority Critical patent/JP5449485B2/en
Publication of JP2014044466A publication Critical patent/JP2014044466A/en
Application granted granted Critical
Publication of JP5449485B2 publication Critical patent/JP5449485B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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 packet 1 is transmitted earlier than the packet 2 from the transmission side information processing apparatus, but the packet 2 arrives at the reception side information processing apparatus first. In synchronization, it is necessary to consider these packet delays and reversal of the order of transmitted and received packets.

中野雄介, 堀米紀貴, 大石秀昭, 岸田好司, “加入者データベースにお25 けるデータレプリケーション手法”, 電子情報通信学会ソサイエティ大会講演論文集,page 415, Aug.2011.Yusuke Nakano, Noriaki Horime, Hideaki Oishi, Koji Kishida, “Data Replication Method in Subscriber Database”, Proceedings of Society Conference of IEICE, page 415, Aug. 2011.

図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 replication system 10A includes a first database device 1A and a second database device 2A connected via a communication network N.
The first database device 1A includes a storage unit 11 and an update processing unit 12A, and the storage unit 11 includes a database 11A, an empty block management unit 11B, and a chain information storage unit 11C. The first database device 1A is connected to the data input terminal 3 via a communication line.
The second database device 2A includes a storage unit 21 and an update processing unit 22A, and the storage unit 21 includes a database 21A, an airspace management unit 21B, and a chain information storage unit 21C.

図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 databases 11A and 21A has a plurality of records for storing data. In the figure, for convenience, the number of records is 6, and Index values “1” to “6” indicating the records are also shown.
Each empty block management unit 11B, 21B has a status indicating whether each record is an empty record for each of the databases 11A, 21A. In the figure, Index values “1” to “6” of corresponding records are also shown.
The chain information 11D and 21D indicate the empty records in the databases 11A and 21A and the order in which data is written in the empty records, and are stored in the chain information storage units 11C and 21C, respectively. In the figure, Index values “1” to “6” of corresponding records are also shown.
Each of the chain information 11D and 21D includes a head index that is the same as the index value of the first record in the data writing order, a tail index that is the same as the index value of the last record, and the index of the record in the previous order for each record. It has the same before index as the value and the same after index as the index value of the record in the next order. It should be noted that the front index, rear index, front index of the first record, and rear index of the last record are “Null”, respectively.

図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 replication system 10A.
The data input terminal 3 transmits update information regarding the part to be updated in the database 11A to the first database device 1A (S101).
The update processing unit 12A updates the database 11A based on the update information (S103). Specifically, the update processing unit 12A writes the data instructed by the update information to the record corresponding to the head index, erases the data in the record instructed by the update information, or uses the update information. The data of the designated record is changed to the data designated by the update information (S103).
Next, when the record is updated in this way, the update processing unit 12A does not accept the update information, that is, temporarily suspends the acceptance (S105). This operation is called so-called database lock (update prohibition).
When the data is written in this record, the update processing unit 12A replaces the status of the empty / busy management unit 11B corresponding to the record with “in use” (S107).
On the other hand, when the data is deleted from this record, the update processing unit 12A replaces the status of the empty / busy management unit 11B corresponding to the record with “available” (S107).
Further, the update processing unit 12A updates the chain information 11D when data is written or erased (S107).
When the database 11A, the airspace management unit 11B, and the chain information 11D are updated in this manner, the storage unit 11 transmits an update success update response including the update content to the update processing unit 12A (S109).
When the update processing unit 12A receives the update response indicating that the update has been successful, the update processing unit 12A transmits update information regarding the updated portions of the database 11A, the air / vacancy management unit 11B, and the chain information 11D to the second database device 2A (S111).

更新処理部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 update processing unit 22A updates the database 21A based on the update information (S113). Specifically, the update processing unit 22A writes the data indicated by the update information in the record indicated by the update information, erases the data of the record indicated by the update information, or indicates by the update information. The data of the recorded record is changed to the data indicated by the update information (S113).
For example, the update processing unit 22A replaces the status at the position of the air / vagment management unit 21B indicated by the update information with the status included in the update information (S117).
The update processing unit 22A replaces the previous index, the rear index, the head index, and the tail index at the position of the chain information indicated by the update information with the front index, the rear index, the head index, and the tail index included in the update information. (S117).
When the database 21A, the airspace management unit 21B, and the chain information 21D are updated in this way, the storage unit 21 transmits an update response indicating that the update has been successful, including the update content, to the update processing unit 22A (S119).
If the update processing unit 22A receives the update success response from the storage unit 21, the update processing unit 22A transmits the update success update response to the first database device 1A (S121).

更新処理部12Aは、更新成功の更新応答を受信したなら、更新成功の更新応答をデータ投入端末3に送信し(S123)、中止した更新情報の受け付けを再開する(S125)。つまり、データベースのロックを解除する。
ステップS105からステップS125の間は、更新情報の受け付けが中止されるので、その間に受信される更新情報に対しては(S131)、更新失敗の応答が返信される(S133)。
If the update processing unit 12A receives the update response indicating the successful update, the update processing unit 12A transmits the update response indicating the successful update to the data input terminal 3 (S123), and resumes accepting the canceled update information (S125). That is, unlock the database.
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 replication system 10A will be described. That is, a case where steps S105 and S125 are not executed will be described. As in FIG. 9, the number of records is 6 for convenience.
For example, in the first database device 1A, when “BB” is written in the record of the index value “2” of the database 11A (G1), the status of the index value “2” of the air / vacancy management unit 11B becomes “in use”. The index is changed to “Null” after the index value “2” of the chain information 11D, the index before the index value “4” is changed to “Null”, and the head index is changed to “4” (G3).
The first database device 1A updates the update information related to the record with the index value “2”, the status with the index value “2”, the index after the index value “2”, the index before the index value “4”, and the top index. It transmits to the apparatus 2A (G5).
In addition, in the first database device 1A, when “DD” is written in the record with the index value “4” in the database 11A (G11), the status of the index value “4” in the empty block management unit 11B becomes “in use”. The index is changed to “Null” after the index value “4” of the chain information 11D, the index before the index value “5” is changed to “Null”, and the head index is changed to “5” (G13).
The first database device 1A updates the update information related to the record with the index value “4”, the status with the index value “4”, the index after the index value “4”, the index before the index value “5”, and the top index. It transmits to the apparatus 2A (G15).

例えば、ステップ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 second database device 2A, “DD” is written in the record of the index value “4” of the database 21A and is empty. The status of the index value “4” of the block management unit 21B changes to “in use”, the index value “4” of the chain information 21D changes to “Null”, and the index before the index value “5” becomes “Null” ", And the leading index changes to" 5 "(G21).
Thereafter, when the update information of step G5 is received, in the second database device 2A, “BB” is written in the record of the index value “2” of the database 21A, and the index value “ The status of “2” is changed to “in use”, the index value “2” of the chain information 21D is changed to “Null”, and the head index is changed to “4” (G23).
That is, at this time, the chain information 11D and the chain information 21D do not coincide with each other, and there is an order inconsistency in the chain information 21D.

すなわち、図12に示すように、チェーン情報21Dにおいては、Index値「4」の後Indexが「5」であり、Index値「5」の前Indexは「Null」であり、両者は矛盾する。
したがって、データベースのロックと解除(ステップS105、S125)を実行することで、このような矛盾の発生を防止する必要がある。
しかし、ステップS105、S125を実行すると、その一方で、あるレコードを更新している間は、他のレコードは更新できず、複数のレコードを更新するのに長時間を要する。
つまり、チェーン情報のような、複数の情報を有し且つ当該情報間で関連をもつテーブルとともに使用されるデータベースの更新が迅速に行えないという問題がある。
That is, as shown in FIG. 12, in the chain information 21D, the index after the index value “4” is “5”, the index before the index value “5” is “Null”, and both are contradictory.
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.

本実施の形態に係るレプリケーションシステムの構成図である。It is a block diagram of the replication system which concerns on this Embodiment. 図1の各データベース11A、21A、各空塞管理部11B、21B、各チェーン情報11D、21Dを例示した図である。It is the figure which illustrated each database 11A, 21A of FIG. 1, each empty block management part 11B, 21B, and each chain information 11D, 21D. 図1のレプリケーションシステム10における基本動作を示すシーケンス図である。It is a sequence diagram which shows the basic operation | movement in the replication system 10 of FIG. 図1のレプリケーションシステム10の具体的な動作例(動作例1)を説明するための図である。It is a figure for demonstrating the specific operation example (operation example 1) of the replication system 10 of FIG. 図1のレプリケーションシステム10の具体的な動作例(動作例2)を説明するための図である。It is a figure for demonstrating the specific operation example (operation example 2) of the replication system 10 of FIG. 変形例に係るチェーン情報を例示した図である。It is the figure which illustrated chain information concerning a modification. 変形例に係るデータベースを例示した図である。It is the figure which illustrated the database concerning a modification. 従来のレプリケーションシステム10Aの構成を示す図である。It is a figure which shows the structure of 10 A of conventional replication systems. 図8の各データベース11A、21A、各空塞管理部11B、21B、各チェーン情報11D、21Dを例示した図である。It is the figure which illustrated each database 11A, 21A of FIG. 8, each empty block management part 11B, 21B, and each chain information 11D, 21D. 図8のレプリケーションシステム10Aにおける基本動作を示すシーケンス図である。FIG. 9 is a sequence diagram showing a basic operation in the replication system 10A of FIG. 図8のレプリケーションシステム10Aにおいて更新情報の受け付けを一時的に中止する理由を説明するための図である。FIG. 9 is a diagram for explaining the reason for temporarily stopping acceptance of update information in the replication system 10A of FIG. 矛盾を含むチェーン情報の一例を示す図である。It is a figure which shows an example of the chain information containing a contradiction.

以下、本発明の実施の形態について図面を参照して説明する。   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 replication system 10 is a replication system that includes a first database device 1 and a second database device 2 connected via a communication network N.

第1データベース装置1は、記憶部11、更新処理部12(本発明の第1更新処理部に相当)を備え、記憶部11は、データベース11A(本発明の第1データベースに相当)、空塞管理部11B、チェーン情報記憶部11C(本発明の第1テーブル記憶部に相当)を備える。第1データベース装置1は、通信回線を介して、データ投入端末3に接続される。   The first database device 1 includes a storage unit 11 and an update processing unit 12 (corresponding to the first update processing unit of the present invention). The storage unit 11 includes a database 11A (corresponding to the first database of the present invention), an empty block A management unit 11B and a chain information storage unit 11C (corresponding to the first table storage unit of the present invention) are provided. The first database device 1 is connected to the data input terminal 3 via a communication line.

第2データベース装置2は、記憶部21、更新処理部22(本発明の第2更新処理部に相当)を備え、記憶部21は、データベース21A(本発明の第2データベースに相当)、空塞管理部21B、チェーン情報記憶部21C(本発明の第2テーブル記憶部に相当)を備える。   The second database device 2 includes a storage unit 21 and an update processing unit 22 (corresponding to the second update processing unit of the present invention). The storage unit 21 includes a database 21A (corresponding to the second database of the present invention), an empty block A management unit 21B and a chain information storage unit 21C (corresponding to the second table storage unit of the present invention) are provided.

レプリケーションシステム10は、通常では、まず、データベース11Aを更新し、データベース11Aを更新したら、データベース21Aをデータベース11Aに一致させるべく更新するようになっている。つまり、通常では、データベース11Aが所謂マスターデータベースである。   Normally, the replication system 10 first updates the database 11A, and when the database 11A is updated, the database 21A is updated to match the database 11A. That is, usually, the database 11A is a so-called master database.

しかし、場合によっては、まず、データベース21Aを更新し、次に、データベース11Aを更新することもある。この場合は、データベース21Aがマスターデータベースである。   However, in some cases, the database 21A is updated first, and then the database 11A is updated. In this case, the database 21A is a master database.

この目的故に、空塞管理部11B、21Bは同一構成を有し、チェーン情報記憶部11C、21Cは同一構成を有し、更新処理部12、22は同じ機能を備えている。   For this purpose, the airspace management units 11B and 21B have the same configuration, the chain information storage units 11C and 21C have the same configuration, and the update processing units 12 and 22 have the same function.

なお、以下の説明では、便宜上、データベース11Aがマスターデータベースである場合を主に述べる。   In the following description, the case where the database 11A is a master database is mainly described for convenience.

図2に示すように、各データベース11A、21Aは、データを記憶するための複数のレコードを有する。図では、便宜的に、レコードの数は6とし、各レコードを示すIndex値「1」〜「6」も示す。   As shown in FIG. 2, each of the databases 11A and 21A has a plurality of records for storing data. In the figure, for convenience, the number of records is 6, and Index values “1” to “6” indicating the records are also shown.

各空塞管理部11B、21Bは、それぞれデータベース11A、21Aにつき、各レコードが空きレコードか否かを示すステータスを有する。図では、対応するレコードのIndex値「1」〜「6」も示す。   Each empty block management unit 11B, 21B has a status indicating whether each record is an empty record for each of the databases 11A, 21A. In the figure, Index values “1” to “6” of corresponding records are also shown.

各チェーン情報11D、21Dは、データベース11A、21Aの空きレコードならびに当該空きレコードにデータを書き込む順序を示すもので、それぞれ、チェーン情報記憶部11C、21Cに記憶される。図では、対応するレコードのIndex値「1」〜「6」も示す。各チェーン情報11D、21Dは、データベース11A、21Aを高速に検索するのに使用される。   The chain information 11D and 21D indicate the empty records in the databases 11A and 21A and the order in which data is written in the empty records, and are stored in the chain information storage units 11C and 21C, respectively. In the figure, Index values “1” to “6” of corresponding records are also shown. The chain information 11D and 21D are used for searching the databases 11A and 21A at high speed.

各チェーン情報11D、21Dは、データを書き込む順序の先頭のレコードのIndex値と同じ先頭Index、末尾のレコードのIndex値と同じ末尾Index、ならびに、各レコードにつき、1つ前の順序のレコードのIndex値と同じ前Indexおよび1つ後の順序のレコードのIndex値と同じ後Indexを有する。なお、空きレコードでないレコードの前Index、後Index、先頭のレコードの前Index、末尾のレコードの後Indexは、それぞれ「Null」となっている。   Each of the chain information 11D and 21D includes a head index that is the same as the index value of the first record in the data writing order, a tail index that is the same as the index value of the last record, and the index of the record in the previous order for each record. It has the same before index as the value and the same after index as the index value of the record in the next order. It should be noted that the front index, rear index, front index of the first record, and rear index of the last record are “Null”, respectively.

つまり、各チェーン情報11D、21Dは、各レコードについての情報からなる複数の情報を有し且つ当該情報間で関連をもつテーブルである。   That is, each chain information 11D and 21D is a table having a plurality of information including information about each record and having a relation between the information.

図1に戻り、データ投入端末3は、更新すべき部分に関する更新情報を第1データベース装置1に送信するものである。   Returning to FIG. 1, the data input terminal 3 transmits update information regarding a portion to be updated to the first database device 1.

更新処理部12は、データ投入端末3からの更新情報に基づき、データベース11Aを更新し、更新後のデータベース11Aに基づいて、空塞管理部11Bおよびチェーン情報11Dを更新し、データベース11Aおよび空塞管理部11Bの更新された部分に関する更新情報を第2データベース装置2に送信するものである。なお、以下の説明では省略するが、更新処理部22は、同様にデータベース21A、空塞管理部21Bおよびチェーン情報21Dを更新し、データベース21Aおよび空塞管理部21Bの更新された部分に関する更新情報を第1データベース装置1に送信することができる。   The update processing unit 12 updates the database 11A based on the update information from the data input terminal 3, updates the empty / busy management unit 11B and the chain information 11D based on the updated database 11A, and updates the database 11A and the empty / busy Update information regarding the updated portion of the management unit 11B is transmitted to the second database device 2. Although not described in the following description, the update processing unit 22 similarly updates the database 21A, the vacancy management unit 21B, and the chain information 21D, and updates information regarding the updated portions of the database 21A and the vacancy management unit 21B. Can be transmitted to the first database device 1.

更新処理部22は、第1データベース装置1からの更新情報に基づき、データベース21Aおよび空塞管理部21Bを更新し、更新後のデータベース21Aまたは更新後の空塞管理部21Bに基づいて、チェーン情報21Dを更新するものである。以下の説明では省略するが、更新処理部12は、同様にデータベース11A、空塞管理部11Bおよびチェーン情報11Dを更新することができる。   The update processing unit 22 updates the database 21A and the vacant / vacant management unit 21B based on the update information from the first database device 1, and the chain information based on the updated database 21A or the updated vacant / vacant management unit 21B. 21D is updated. Although omitted in the following description, the update processing unit 12 can similarly update the database 11A, the airspace management unit 11B, and the chain information 11D.

(基本動作)
図3は、レプリケーションシステム10における基本動作を示すシーケンス図である。
(basic action)
FIG. 3 is a sequence diagram showing a basic operation in the replication system 10.

なお、便宜上、データベース21Aがマスターデータベースである場合だけを述べる。   For convenience, only the case where the database 21A is a master database will be described.

データ投入端末3は、データベース11Aの更新すべき部分に関する更新情報を第1データベース装置1に送信する(S1)。   The data input terminal 3 transmits update information regarding the part to be updated in the database 11A to the first database device 1 (S1).

更新処理部12は、データベース11Aを更新情報に基づいて更新する(S3)。具体的には、更新処理部12は、先頭Indexに対応するレコードに対し、更新情報で指示されたデータを書き込む、または、更新情報で指示されたレコードのデータを消去する、または、更新情報で指示されたレコードのデータを更新情報で指示されたデータに変更する(S3)。   The update processing unit 12 updates the database 11A based on the update information (S3). Specifically, the update processing unit 12 writes the data instructed by the update information to the record corresponding to the head index, erases the data in the record instructed by the update information, or uses the update information. The data of the instructed record is changed to the data instructed by the update information (S3).

次に、更新処理部12は、このように更新したレコードについては、更新情報を受け付けないように、つまり、受け付けを一時的に中止する(S5)。この動作は、所謂レコードのロック(更新禁止)という。   Next, the update processing unit 12 does not accept update information for the record updated in this way, that is, temporarily suspends acceptance (S5). This operation is called so-called record lock (update prohibition).

更新処理部12は、このレコードにデータが書き込まれたなら、当該レコードに対応する空塞管理部11Bのステータスを「使用中」に置き換える(S7)。   When the data is written in this record, the update processing unit 12 replaces the status of the empty / busy management unit 11B corresponding to the record with “in use” (S7).

一方、更新処理部12は、このレコードからデータが消去されたなら、当該レコードに対応する空塞管理部11Bのステータスを「空き」に置き換える(S7)。   On the other hand, when the data is deleted from this record, the update processing unit 12 replaces the status of the empty / busy management unit 11B corresponding to the record with “available” (S7).

また、更新処理部12は、データが書き込まれたなら、または、消去されたなら、チェーン情報11Dを更新する(S7)。   Further, the update processing unit 12 updates the chain information 11D if data is written or erased (S7).

具体的には、チェーン情報11Dが、データを書き込む順序でIndex値が「2−4−5−6」となるようなものの場合、更新処理部12は、先頭Indexが示すレコードにデータを書き込んだなら、「2−4−5−6」が「4−5−6」となるようにチェーン情報11Dを更新する。   Specifically, when the chain information 11D has an index value “2-4-5-6” in the order in which data is written, the update processing unit 12 has written the data in the record indicated by the first index. Then, the chain information 11D is updated so that “2-4-5-6” becomes “4-5-6”.

一方、チェーン情報11Dが、データを書き込む順序でIndex値が「2−5−6」となるようなものの場合、更新処理部12は、例えば、Index値「3」のレコードからデータを消去したなら、「2−5−6」が「2−5−6−3」となるようにチェーン情報11Dを更新する。   On the other hand, when the chain information 11D is such that the index value is “2-5-6” in the order of writing data, the update processing unit 12 deletes the data from the record with the index value “3”, for example. The chain information 11D is updated so that “2-5-6” becomes “2-5-6-3”.

記憶部11は、こうしてデータベース11Aや空塞管理部11Bやチェーン情報11Dが更新されたら、更新内容を含む更新成功の更新応答を更新処理部12を送信する(S9)。   When the database 11A, the airspace management unit 11B, or the chain information 11D is updated in this manner, the storage unit 11 transmits an update response indicating that the update has been successful, including the update content, to the update processing unit 12 (S9).

更新処理部12は、更新成功の更新応答を受信したなら、データベース11Aおよび空塞管理部11Bの更新された部分に関する更新情報を第2データベース装置2に送信する(S11)。   If the update processing unit 12 receives an update response indicating that the update has been successful, the update processing unit 12 transmits update information regarding the updated portions of the database 11A and the air / vacancy management unit 11B to the second database device 2 (S11).

更新処理部22は、データベース21Aを更新情報に基づいて更新する(S13)。具体的には、更新処理部22は、更新情報で指示されたレコードに更新情報で指示されたデータを書き込む、または、更新情報で指示されたレコードのデータを消去する、または、更新情報で指示されたレコードのデータを更新情報で指示されたデータに変更する(S13)。   The update processing unit 22 updates the database 21A based on the update information (S13). Specifically, the update processing unit 22 writes the data indicated by the update information in the record indicated by the update information, erases the data of the record indicated by the update information, or indicates by the update information. The data of the recorded record is changed to the data indicated by the update information (S13).

更新処理部22は、例えば、更新情報で指示された空塞管理部21Bの位置にあるステータスを、更新情報内に含まれるステータスで置き換える(S17)。   For example, the update processing unit 22 replaces the status at the position of the air / vacancy management unit 21B indicated by the update information with the status included in the update information (S17).

記憶部21は、こうしてデータベース21Aや空塞管理部21Bが更新されたら、更新内容を含む更新成功の更新応答を更新処理部22に送信する(S19)。   When the database 21A and the air / vacancy management unit 21B are updated in this way, the storage unit 21 transmits an update success response including the update contents to the update processing unit 22 (S19).

また、更新処理部22は、こうしてデータベース21Aが更新されたなら、更新後のデータベース21Aに基づいて、チェーン情報21Dを更新する(S21)。   Further, when the database 21A is updated in this manner, the update processing unit 22 updates the chain information 21D based on the updated database 21A (S21).

具体的には、チェーン情報21Dが、データを書き込む順序でIndex値が「2−4−5−6」となるようなものの場合、更新処理部22は、先頭Indexが示すレコードにデータを書き込んだなら、「2−4−5−6」が「4−5−6」となるようにチェーン情報21Dを更新する。   Specifically, when the chain information 21D is such that the index value is “2-4-5-6” in the data writing order, the update processing unit 22 has written the data in the record indicated by the first index. Then, the chain information 21D is updated so that “2-4-5-6” becomes “4-5-6”.

一方、チェーン情報21Dが、データを書き込む順序でIndex値が「2−5−6」となるようなものの場合、更新処理部22は、例えば、Index値「3」のレコードからデータを消去したなら、「2−5−6」が「2−5−6−3」となるようにチェーン情報21Dを更新する。   On the other hand, when the chain information 21D is such that the Index value is “2-5-6” in the order of writing data, the update processing unit 22 deletes the data from the record with the Index value “3”, for example. The chain information 21D is updated so that “2-5-6” becomes “2-5-6-3”.

更新処理部22は、記憶部21から更新成功の更新応答を受信したなら、第1データベース装置1に更新成功の更新応答を送信する(S23)。   If the update processing unit 22 receives the update response indicating the successful update from the storage unit 21, the update processing unit 22 transmits an update response indicating the successful update to the first database device 1 (S23).

更新処理部12は、更新成功の更新応答を受信したなら、更新成功の更新応答をデータ投入端末3に送信し(S25)、更新情報の受け付けを中止したレコードについて、更新情報の受け付けを再開する(S27)。つまり、レコードのロックを解除する。   If the update processing unit 12 receives the update response indicating the successful update, the update processing unit 12 transmits an update response indicating the successful update to the data input terminal 3 (S25), and resumes accepting the update information for the record for which the acceptance of the update information is stopped. (S27). That is, the record is unlocked.

(動作例1)
次に、図4を参照し、レプリケーションシステム10の具体的な動作例(動作例1)について説明する。図2と同様、レコードの数は便宜的に6とする。
(Operation example 1)
Next, a specific operation example (operation example 1) of the replication system 10 will be described with reference to FIG. As in FIG. 2, the number of records is six for convenience.

まず、当初、各データベース11A、データベース21Aでは、Index値「1」のレコードにデータ「AA」、Index値「3」のレコードに「CC」があり、他のレコードは空きレコードになっている。つまり、データベース11Aとデータベース21Aは互いに一致している。   First, in each of the databases 11A and 21A, the record with the index value “1” has data “AA”, the record with the index value “3” has “CC”, and the other records are empty records. That is, the database 11A and the database 21A match each other.

また、当初、各空塞管理部11B、空塞管理部21Bでは、Index値「1」のステータスと、Index値「3」のステータスが「使用中」で、他のステータスは「空き」である。つまり、空塞管理部11Bと空塞管理部21Bは互いに一致している。   Initially, in each of the airfight management units 11B and the airfight management unit 21B, the status of the index value “1” and the status of the index value “3” are “in use”, and the other statuses are “empty”. . That is, the air / vagment management unit 11B and the air / vagment management unit 21B coincide with each other.

また、各チェーン情報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 chain information 11D and chain information 21D, the index before Index value “1” and the index after Index value “1” are “Null”, the index before Index value “2”, and Index value “2”. The index after the index is “Null” and “4”, respectively, the index before the index value “3”, the index after the index value “3” is “Null”, the index before the index value “4”, Index The index after the value “4” is “2” and “5”, respectively, the index before the Index value “5”, and the index after the Index value “5” are “4” and “6”, respectively. The index before Index value “6”, the index after Index value “6” are “5” and “Null”, the leading Index is “2”, and the trailing Index is “6”. That is, the chain information 11D and the chain information 21D match each other, and the chain information 11D and the chain information 21D have no contradiction such as missing order or duplication.

例えば、第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 first database device 1, when “BB” is written in the record of the index value “2” of the database 11A (T1), the status of the index value “2” of the air / vacancy management unit 11B becomes “in use”. The index is changed to “Null” after the index value “2” of the chain information 11D, the index before the index value “4” is changed to “Null”, and the head index is changed to “4” (T3).

第1データベース装置1は、Index値「2」のレコード、Index値「2」のステータスに関する更新情報を第2データベース装置2に送信する(T5)。   The first database device 1 transmits to the second database device 2 update information related to the record having the index value “2” and the status having the index value “2” (T5).

また、第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 first database device 1, when “DD” is written in the record of the index value “4” of the database 11A (T11), the status of the index value “4” of the empty block management unit 11B becomes “in use”. The index is changed to “Null” after the index value “4” of the chain information 11D, the index before the index value “5” is changed to “Null”, and the head index is changed to “5” (T13).

第1データベース装置1は、Index値「4」のレコード、Index値「4」のステータスに関する更新情報を第2データベース装置2に送信する(T15)。   The first database device 1 transmits to the second database device 2 update information regarding the record having the index value “4” and the status having the index value “4” (T15).

例えば、ステップ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 second database device 2, “DD” is written in the record of the index value “4” of the database 21A and is empty. The status of the index value “4” of the block management unit 21B changes to “in use”, the index value “2” of the chain information 21D changes to “5”, and the index before the index value “4” becomes “Null” The index is changed to “Null” after the index value “4” (T21).

その後、ステップ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 second database device 2, “BB” is written in the record of the index value “2” of the database 21A, and the index value “ The status of “2” is changed to “in use”, the index after the index value “2” of the chain information 21D is changed to “Null”, the index before the index value “5” is changed to “Null”, and the leading index is “ 5 "(T23).

つまり、チェーン情報11Dとチェーン情報21Dは互いに一致しており、各チェーン情報11D、チェーン情報21Dにおいては、順序の抜けや重複などの矛盾がない。   That is, the chain information 11D and the chain information 21D match each other, and the chain information 11D and the chain information 21D have no contradiction such as missing order or duplication.

(動作例2)
次に、図5を参照し、レプリケーションシステム10の具体的な動作例(動作例2)について説明する。
(Operation example 2)
Next, a specific operation example (operation example 2) of the replication system 10 will be described with reference to FIG.

まず、当初、各データベース11A、データベース21Aでは、Index値「1」のレコードに「AA」、Index値「3」のレコードに「CC」、Index値「4」のレコードに「DD」があり、他のレコードは空きレコードになっている。つまり、データベース11Aとデータベース21Aは互いに一致している。   First, in each of the databases 11A and 21A, a record with an index value “1” has “AA”, a record with an index value “3” has “CC”, and a record with an index value “4” has “DD”. Other records are empty records. That is, the database 11A and the database 21A match each other.

また、当初、各空塞管理部11B、空塞管理部21Bでは、Index値「1」のステータス、Index値「3」のステータス、Index値「4」のステータスが「使用中」で、他のステータスは「空き」である。つまり、空塞管理部11Bと空塞管理部21Bは互いに一致している。   Initially, each of the airspace management units 11B and 21B has an index value “1” status, an index value “3” status, and an index value “4” status of “in use”. The status is “free”. That is, the air / vagment management unit 11B and the air / vagment management unit 21B coincide with each other.

また、各チェーン情報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 chain information 11D and chain information 21D, the index before Index value “1” and the index after Index value “1” are “Null”, the index before Index value “2”, and Index value “2”. The index after the index is “Null” and “5”, respectively, the index before the index value “3”, the index after the index value “3” is “Null”, the index before the index value “4”, Index The index after the value “4” is “Null”, the index before the Index value “5”, the indexes after the Index value “5” are “2” and “6”, respectively, and the Index value “6”. The previous index and the subsequent index of index value “6” are “5” and “Null”, respectively, the leading index is “2”, and the trailing index is “6”. That is, the chain information 11D and the chain information 21D match each other, and the chain information 11D and the chain information 21D have no contradiction such as missing order or duplication.

例えば、第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 first database device 1, when “CC” is deleted from the record having the index value “3” in the database 11A (T31), the status of the index value “3” in the empty block management unit 11B becomes “free”. The index before the index value “3” of the chain information 11D is changed to “6”, the index after the index value “6” is changed to “3”, and the end index is changed to “3” (T33).

第1データベース装置1は、Index値「3」のレコード、Index値「3」のステータスに関する更新情報を第2データベース装置2に送信する(T35)。   The first database device 1 transmits to the second database device 2 update information regarding the record having the index value “3” and the status having the index value “3” (T35).

また、第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 first database device 1, when “AA” is deleted from the record with the index value “1” in the database 11A (T41), the status of the index value “1” in the empty block management unit 11B becomes “free”. The index before the index value “1” of the chain information 11D is changed to “3”, the index after the index value “3” is changed to “1”, and the end index is changed to “1” (T43).

第1データベース装置1は、Index値「1」のレコード、Index値「1」のステータスに関する更新情報を第2データベース装置2に送信する(T45)。   The first database device 1 transmits to the second database device 2 update information related to the record having the index value “1” and the status having the index value “1” (T45).

例えば、ステップ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 second database device 2 deletes “AA” from the record of the index value “1” in the database 21A, and is empty. The status of the index value “1” of the block management unit 21B changes to “free”, the index before the index value “1” of the chain information 21D changes to “6”, and the index after the index value “6” is “1”. The end index is changed to “1” (T51).

その後、ステップ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 second database device 2, “CC” is deleted from the record with the index value “3” in the database 21A, and the index value “ The status of “3” is changed to “empty”, the index is changed to “3” after the index value “1” of the chain information 21D, the index before the index value “3” is changed to “1”, and the end index is “3”. (T53).

つまり、チェーン情報11Dとチェーン情報21Dは互いに一致していないが、各チェーン情報11D、チェーン情報21Dにおいては、順序の抜けや重複などの矛盾がない。よって、データベース21Aがマスターデータベースとなっても問題はない。   That is, the chain information 11D and the chain information 21D do not match each other, but the chain information 11D and the chain information 21D have no contradiction such as missing order or duplication. Therefore, there is no problem even if the database 21A becomes the master database.

なお、このような場合であってもチェーン情報11Dとチェーン情報21Dを一致させるには、以下のようにすればよい。   Even in such a case, the chain information 11D and the chain information 21D may be matched as follows.

つまり、チェーン情報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 chain information 11D is such that the index value is “2-5-6” in the data writing order, the update processing unit 12 deletes the data from the record with the index value “3”, for example. , The chain information 11D is updated so that “2-5-6” becomes “2-3-5-6”, and the index value becomes “2-5-6” in the order in which the chain information 21D writes data. In such a case, for example, if the data is deleted from the record with the index value “3”, the update processing unit 22 chains so that “2-5-6” becomes “2-3-5-6”. Information 21D may be updated.

(変形例)
本実施の形態では、各チェーン情報11D、チェーン情報21Dは、図6(a)に示すように、先頭Indexと後Indexだけからなるものとしてもよい。また、各チェーン情報11D、チェーン情報21Dは、図6(b)に示すように、先頭Indexと後Indexだけからなるものとしてもよい。
(Modification)
In the present embodiment, each chain information 11D and chain information 21D may be composed of only a leading index and a trailing index, as shown in FIG. Further, each chain information 11D and chain information 21D may be composed of only a leading index and a trailing index, as shown in FIG. 6 (b).

また、各空塞管理部11B、空塞管理部21Bのステータスは、図7に示すように、それぞれデータベース11A、データベース21Aの対応するレコードに含めてもよい。   Further, the statuses of the air / burst management units 11B and 21B may be included in the corresponding records of the database 11A and the database 21A, respectively, as shown in FIG.

以上説明したように、本実施の形態によれば、第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 chain information 11D is not transmitted from the first database device 1 to the second database device 2, and the update processing unit 22 Since the chain information 21D is updated based on the updated database 21A, it is possible to update other records even while a certain record is being updated. Thus, the database 11A and the database used together with the chain information 11D and the chain information 21D 21A can be updated quickly.

また、チェーン情報11Dの更新された部分に関する更新情報を送信しないので、送信される更新情報の量を低減することができる。   Moreover, since the update information regarding the updated part of the chain information 11D is not transmitted, the amount of update information transmitted can be reduced.

なお、チェーン情報21Dを更新する代わりに、更新後のデータベース21Aに基づいて新たにチェーン情報21Dを生成し、これで既存のチェーン情報21Dを置き換えてもよい。この場合であっても、結果的には、更新後のデータベース21Aに基づいてチェーン情報21Dが更新されたことになる。   Instead of updating the chain information 21D, the chain information 21D may be newly generated based on the updated database 21A, and the existing chain information 21D may be replaced with this. Even in this case, as a result, the chain information 21D is updated based on the updated database 21A.

また、空塞管理部11B、空塞管理部21Bのステータスは、データベース11A、データベース21Aに基づいて、適宜取得できるので、空塞管理部11B、空塞管理部21Bを設けなくてもよい。   Moreover, since the status of the air / vagment management unit 11B and the air / vagment management unit 21B can be appropriately acquired based on the database 11A and the database 21A, the air / vagment management unit 11B and the air / vagment management unit 21B may not be provided.

また、本実施の形態では、複数の情報を有し且つ当該情報間で関連をもつテーブルの例として、チェーン情報を用いたが、チェーン情報に限らず、テーブルは、複数の情報を有し且つ当該情報間で関連をもつものであればよい。   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 first database device 1 or the second database device 2 can be recorded on a computer-readable recording medium such as a semiconductor memory, a magnetic disk, an optical disk, a magneto-optical disk, or a magnetic tape, Further, it can be widely distributed by being transmitted via a communication network such as the Internet.

1 第1データベース装置
2 第2データベース装置
3 データ投入端末
10 レプリケーションシステム
11、21 記憶部
11A、21A データベース
11B、21B 空塞管理部
11C、21C チェーン情報記憶部
11D、21D チェーン情報
12、22 更新処理部
DESCRIPTION OF SYMBOLS 1 1st database apparatus 2 2nd database apparatus 3 Data input terminal 10 Replication system 11, 21 Memory | storage part 11A, 21A Database 11B, 21B Empty block management part 11C, 21C Chain information storage part 11D, 21D Chain information 12, 22 Update process Part

Claims (4)

第1データベース装置と第2データベース装置を備えるレプリケーションシステムであって、
前記第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.
前記第2更新処理部は、前記第2データベースを更新したなら、前記第1更新処理部に更新応答を送信するものであり、
前記第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データベース装置と第2データベース装置を備えるレプリケーションシステムの前記第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データベース装置と第2データベース装置を備えるレプリケーションシステムの前記第2データベース装置であって、
前記第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.
JP2012184863A 2012-08-24 2012-08-24 Replication system and its first and second database devices Active JP5449485B2 (en)

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)

* Cited by examiner, † Cited by third party
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

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