JP3563591B2 - Consistency management method for distributed database system and computer-readable recording medium storing program for causing a computer to execute each step of the method - Google Patents

Consistency management method for distributed database system and computer-readable recording medium storing program for causing a computer to execute each step of the method Download PDF

Info

Publication number
JP3563591B2
JP3563591B2 JP11230598A JP11230598A JP3563591B2 JP 3563591 B2 JP3563591 B2 JP 3563591B2 JP 11230598 A JP11230598 A JP 11230598A JP 11230598 A JP11230598 A JP 11230598A JP 3563591 B2 JP3563591 B2 JP 3563591B2
Authority
JP
Japan
Prior art keywords
site
consistency management
dbs
level
update
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.)
Expired - Fee Related
Application number
JP11230598A
Other languages
Japanese (ja)
Other versions
JPH11219309A (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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP11230598A priority Critical patent/JP3563591B2/en
Publication of JPH11219309A publication Critical patent/JPH11219309A/en
Application granted granted Critical
Publication of JP3563591B2 publication Critical patent/JP3563591B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、分散型データベースシステムにおける複製データの一貫性管理方法に関し、より詳細には、一貫性管理のレベルを複数段階に分け、トランザクションの種類に応じて異なる一貫性管理を行うことができるようにすることにより、分散型データベースシステムの利便性の向上を図った分散型データベースシステムの一貫性管理方法およびその方法の各工程をコンピュータに実行させるためのプログラムを記録したコンピュータ読み取り可能な記録媒体に関する。
【0002】
【従来の技術】
分散型データベースシステムにおいては、同一データについての複製データが複数のサイトにそれぞれ分散しており、かつ、複数のトランザクションが並行して実行されることになるため、システム上に存在する複製データ間の一貫性をいかに保つかが重要な課題となっている。
【0003】
分散型データベースシステムにおける一貫性管理方法の一例として、データの変更を直列化する操作を行う強い一貫性管理と呼ばれる方法がある。この方法によれば、直列化可能性を保証するが故に操作の並列性を低下させ、一貫性管理のコストが増大するという短所があるものの、直列化可能性が保証されるため、複製データ間の矛盾が一切生じないという長所がある。この強い一貫性管理は、銀行のOLTP(On−Line Transaction Processing)等に適用されていることが多い。
【0004】
また、一貫性管理方法の他の例として、複製データ間に矛盾が生じることを認める弱い一貫性管理と呼ばれる方法がある。この弱い一貫性管理では、一つのトランザクションの中でシステム全体の一貫性を保証するのではなく、別のトランザクションで更新伝播を行う。この方法によれば、複製データ間に矛盾が生じてしまうことがあるという短所があるものの、適用する応用によってはその矛盾も問題とならない場合があり、一貫性保持に要するコストを軽減することができるという長所がある。この弱い一貫性管理は、データの更新が少ない安定したシステムに適用されていることが多い。
【0005】
なお、弱い一貫性管理方式については各種の研究がなされており、大別すると、(1)マルチバージョン方式(Multi−version Control)、(2)差異限定管理方式(Bounded Divergence Control)、および(3)意味ベースの方式(Semantic−based Control)に分類することができる。したがって、分散型データベースシステムの規模やデータ内容を考慮して、どのような弱い一貫性管理方式を利用すべきかを決定する必要がある。
【0006】
【発明が解決しようとする課題】
しかしながら、従来の分散型データベースシステムの一貫性管理方法においては、上述した強い一貫性管理および弱い一貫性管理のいずれか一方しか利用することができないため、複製データの一貫性管理において不便な場合があるという問題点があった。この問題点は、分散型データベースシステムの規模・データ内容に応じて、トランザクションの種類毎に強い一貫性管理および弱い一貫性管理を使い分けすることができる方が便利であるという要求に基づくものである。
【0007】
また、弱い一貫性管理を採用した従来の分散型データベースシステムの一貫性管理方法においては、一つのトランザクションの中でシステム全体の一貫性を保証するのではなく、別のトランザクションで更新伝播を行うため、更新伝播がいつ行われるかユーザは認識することができないという問題点があった。すなわち、更新伝播を行うタイミングはシステムに依存しており、ユーザの所望するタイミングで更新伝播を行うことができるようにすることはできなかった。
【0008】
本発明は上記に鑑みてなされたものであって、分散型データベースシステムの一貫性管理のレベルを複数段階に分け、トランザクションの種類に応じて異なる一貫性管理を行うことができるようにすることにより、分散型データベースシステムの利便性の向上を図ることを第1の目的とする。
【0009】
本発明は上記に鑑みてなされたものであって、弱い一貫性管理を採用した場合に、更新伝播を行うタイミングを設定できるようにすることにより、分散型データベースシステムの利便性のさらなる向上を図ることを第2の目的とする。
【0010】
【課題を解決するための手段】
上記目的を達成するため、請求項1の分散型データベースシステムの一貫性管理方法は、任意のオブジェクトに対する複製データをそれぞれ有する第1のサイトと、前記複数の第1のサイトにおける複製データの一貫性を集中管理する第2のサイトと、を備えた分散型データベースシステムの一貫性管理方法において、予め前記複製データに対するリードまたは更新の処理を含むトランザクションに、一貫性管理のレベルを表す第1レベル,第2レベルおよび第3レベルのいずれかを設定する一貫性レベル設定工程と、システム内においてトランザクションが発生した場合に、該発生したトランザクションに設定されている前記一貫性管理のレベルを判定する判定工程と、前記判定工程で第1レベルであると判定された場合に、read−onlyのトランザクションまたは更新を含むトランザクションのいずれであっても、厳格な一貫性管理方法を用いて一貫性管理を行い、第2のサイトから複数の第1のサイトへの更新伝播を即時行う第1の一貫性管理工程と、前記判定工程で第2レベルであると判定された場合に、read−onlyのトランザクションは緩和された一貫性管理方法を用いて一貫性管理を行い、更新を含むトランザクションは厳格な一貫性管理方法を用いて一貫性管理を行い、第2のサイトから複数の第1のサイトへの更新伝播を緊急度に応じて遅延させて行う第2の一貫性管理工程と、前記判定工程で第3レベルであると判定された場合に、read−onlyのトランザクションまたは更新を含むトランザクションのいずれであっても、弱い一貫性管理方法を用いて一貫性管理を行い、第2のサイトから複数の第1のサイトへの更新伝播を緊急度に応じて遅延させて行う第3の一貫性管理工程とを含むものである。
【0011】
また、請求項の分散型データベースシステムの一貫性管理方法は、請求項に記載の分散型データベースシステムの一貫性管理方法において、前記第2および第3の一貫性管理工程における更新伝播の遅延について、第2のサイトにおいて予め設定されている更新伝播条件が満足された場合に更新伝播を行うこととしたものである。
【0012】
また、請求項の分散型データベースシステムの一貫性管理方法は、請求項1または2に記載の分散がデータベースシステムの一貫性管理方法において、前記第2および/または第3の一貫性管理工程における更新伝播の遅延とは、前記第1のサイトにおいて前記トランザクション毎に更新伝播を行うタイミングを定めた更新伝播条件が設定され、第2のサイトにおいて前記更新伝播条件を満足するように複数の第1のサイトへの更新伝播を行うこととしたものである。
【0013】
また、請求項の分散型データベースシステムの一貫性管理方法は、請求項に記載の分散型データベースシステムの一貫性管理方法において、前記第2および/または第3の一貫性管理工程が、少なくとも通信回線および放送波を用いて第2のサイトから複数の第1のサイトへの更新伝播を行うことができ、前記更新伝播条件が、前記通信回線および放送波のいずれを用いて更新伝播を行うかについての指定を含むものである。
【0014】
また、請求項の分散型データベースシステムの一貫性管理方法は、請求項1〜4のいずれか一つに記載の分散型データベースシステムの一貫性管理方法において、前記判定工程が、前記一貫性管理のレベルを判定することに加えて、データの新規登録か否かを判定し、前記新規登録であると判定した場合に、設定されているレベルに関係なく、前記第3レベルと判定するものである。
【0015】
さらに、請求項のコンピュータ読み取り可能な記録媒体にあっては、前記請求項1〜のいずれか一つに記載の分散型データベースシステムの一貫性管理方法の各工程をコンピュータに実行させるためのプログラムを記録したものである。
【0016】
【発明の実施の形態】
以下、本発明に係る分散型データベースシステムの一貫性管理方法およびその方法の各工程をコンピュータに実行させるためのプログラムを記録したコンピュータ読み取り可能な記録媒体の実施の形態について、添付の図面を参照しつつ詳細に説明する。
【0017】
〔実施の形態1〕
実施の形態1に係る分散型データベースシステムの一貫性管理方法においては、複製データを有するサイトが超多地点に存在する分散型データベースシステムに適用することを想定している。
【0018】
ここで、実施の形態1に係る分散型データベースシステムの一貫性管理方法を説明するに先立って、分散型データベースシステムを構築するために考慮すべき二つの条件について説明する。
【0019】
一つ目は、システム内に存在する複製データの更新を行うことができるサイトはどこかということであり、これには集中方式と分散方式とがある。集中方式は、分散型データベースシステムにおける複数のサイトを主サイトと主サイト以外のサイトに分類し、主サイトでのみシステム内に存在する複製データの更新を可能とし、他のサイトではその更新を行うことができないようにするものである。一方、分散方式は、どのサイトでもシステム内の複製データの更新を可能とし(Anysite Writable)、更新を行うサイトが全ての複製データとの調整を行うというものである。
【0020】
二つ目は、一時的なデータ矛盾を認めるか否かということであり、これには従来技術で説明した強い一貫性管理と弱い一貫性管理とがある。強い一貫性管理は、システム内に存在する複製データ間の矛盾を認めず、一つのトランザクションの中で全ての複製データ間の整合性を保証するものである。例えば、2相コミットプロトコルがこの方式に該当する。一方、弱い一貫性管理は、応用の内容に特化して考えることにより、システム内に存在する複製データ間の矛盾を一時的に認めるものである。この方式では、一つのトランザクションの中で全ての複製データ間の一貫性が保証されるのではなく、更新の伝播は別のトランザクションで行われる。
【0021】
図1は、集中管理または分散管理と、強い一貫性管理または弱い一貫性管理との組み合わせによって、分散型データベースシステムを構築した場合の長所および短所が変化することを示した説明図である。実施の形態1に係る分散型データベースシステムの一貫性管理方法においては、後述するようにトランザクションの種類に応じて強い一貫性管理および弱い一貫性管理を設定できるようにするために、プロトコルが簡単な集中管理方式を採用することにする。
【0022】
図2は、実施の形態1に係る分散型データベースシステムの一貫性管理方法を実現するための分散型データベースシステムの概念構成図である。図2に示す分散型データベースシステムは、複数のサイトからなり、複数のサイトは、任意のオブジェクトから生成した複製データをそれぞれ有するサイトDBS1 ,サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn と、複製データの一貫性を集中管理する主サイトDBSP と、から構成されている。なお、以下の説明において、サイトDBS1 ,サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn をまとめて示す場合にはサイトDBSと記述するものとする。
【0023】
ここで、主サイトDBSP が管理する情報には、システム内に存在する複製データに対する各オブジェクト毎に、対象オブジェクトID(いずれのオブジェクトに対する複製データかを特定するためのものであり、各サイトDBSが保有する複製データにも共通のものが付与されている),オブジェクトの最新値,最終更新タイムスタンプ,最終更新サイトID,最終更新トランザクションID等がある。一方、各サイトDBSは、システム内に存在する全てのオブジェクトの複製データを有していなければならないというわけではない。さらに、各オブジェクトのマスターデータについては、主サイトDBSP が集中管理しても良いし(主サイトDBSP が管理している「オブジェクトの最新値」をマスターデータととらえても良い)、各サイトDBS毎に管理することにしても良い。
【0024】
なお、図2には、主サイトDBSP の下にサイトDBSを設けた様子のみが示されているが、各サイトDBSの下にもさらに複数のサイトDBSを設けて階層構造を形成することもできる。このような場合においては、上位のサイトDBSを下位のサイトDBSの主サイトとして動作させることもできる。
【0025】
また、実施の形態1に係る分散型データベースシステムの一貫性管理方法においては、一貫性管理のレベルとしてレベルA〜Cを用意し、トランザクションの種類に応じて、異
【0026】
レベルA(本発明の第1レベルに該当する)は、read−onlyのトランザクションまたは更新を含むトランザクションのいずれであっても、厳格な一貫性管理方法を用いて複製データの一貫性管理を行い、主サイトDBSP から各サイトDBSへの更新伝播を即時行うというものである。
【0027】
換言すれば、レベルAは、一つのトランザクションの中で各サイトDBSへの更新伝播まで実行することによって複製データの一貫性管理を行うものであって、トランザクションの直列可能性を保証するものである。
【0028】
また、レベルB(本発明の第2レベルに該当する)は、read−onlyのトランザクションについては緩和された一貫性管理方法を用いて複製データの一貫性管理を行い、更新を含むトランザクションについては厳格な一貫性管理方法を用いて複製データの一貫性管理を行い、主サイトDBSP から各サイトDBSへの更新伝播を遅延させて行うというものである。
【0029】
レベルBにおいては、ある複製データの更新処理を行う場合に、複数のトランザクションに分散して、主サイトDBSP から各サイトDBSへの更新伝播が行われる。データアクセスに際しては、1コピー直列化可能性は保証する(P.A.Bernstein, V.Hadzilacos,and N.Goodman: Concurrency Control and Recovery in Database Systems,Addison−Wesley,1987)。1コピー直列化可能である場合、データ更新の際には同一データに対する複数の複製データの中から最新バージョンを探し、同一データに対する更新処理が競合しないように処理するが、読み出しだけの際には、多少データが古くても良いのでローカルデータをそのまま読むという処理を行う。
【0030】
さらに、レベルC(本発明の第3レベルに該当する)は、read−onlyのトランザクションまたは更新を含むトランザクションのいずれであっても、弱い一貫性管理方法を用いて一貫性管理を行い、主サイトDBSP から各サイトDBSへの更新伝播を遅延させて行うというものである。
【0031】
レベルCは、複製データ間の一時的な一貫性の崩壊を認め、各サイトDBS毎に複製データの更新を可能とするものである。更新結果は複数のトランザクションとなって主サイトDBSP から各サイトDBSへ伝播される。この場合、同一データに対する複製データについての更新の競合(衝突)が検出された場合の解決法が問題となる。レベルCにおいては、後述するように、コミットした後に更新の競合を検出する処理が行われるため、通常の方法のアボートはできない。更新の競合が生じた場合については、後に説明することにする。
【0032】
なお、上述したレベルA〜Cは、後述するように、read−onlyまたは更新を含むトランザクションの種類に応じて設定される。
【0033】
続いて、実施の形態1に係る分散型データベースシステムの一貫性管理方法を具体的に説明する。図3(a)は一貫性管理のレベルを設定する手順を、図3(b)は図3(a)に示すようにして設定した一貫性管理のレベルに基づいて一貫性管理方法を実行する手順を示すフローチャートである。ここでは、図3(a)および図3(b)を用いて一貫性管理手順の概略を説明した後、レベルA〜Cの一貫性管理方法について具体的に説明する。
【0034】
(一貫性管理手順の概略)
まず、図3(a)に示すように、分散型データベースシステムの規模・データ内容等を考慮し、システム内で発生するトランザクションの種類に応じて予め一貫性管理のレベルを設定する(S300:本発明の一貫性レベル設定工程に該当する)。すなわち、各トランザクションの種類に対して、レベルA〜Cが設定される。なお、一貫性管理のレベルは、分散型データベースシステムのセットアップ時に設定することができ、また、トランザクションの発生時に設定することもできる。
【0035】
図3(a)のステップS300においてレベルA〜Cを設定した後、図3(b)に示すように、分散型データベースシステム内にトランザクションが発生すると(S301)、発生したトランザクションに設定されている一貫性管理のレベルの判定処理を実行する(S302:本発明の判定工程に該当する)。
【0036】
そして、ステップS302における判定処理の結果に基づいて、発生したトランザクションに設定された一貫性管理のレベルがレベルA,レベルBおよびレベルCのいずれであるかを判定する(S303:本発明の判定工程に該当する)。ステップS303において、レベルAであると判定した場合には、レベルAの一貫性管理方法を実行し(S304:本発明の第1の一貫性管理工程に該当する)、レベルBであると判定した場合には、レベルBの一貫性管理方法を実行し(S305:本発明の第2の一貫性管理工程に該当する)、さらに、レベルCであると判定した場合には、レベルCの一貫性管理方法を実行する(S306:本発明の第3の一貫性管理工程に該当する)。
【0037】
(レベルAの一貫性管理方法)
次に、レベルAによる一貫性管理方法について、強い一貫性管理方法の概略について説明した後、実施の形態1のレベルAによる強い一貫性管理方法を具体的に説明することにする。
【0038】
強い一貫性管理方法としては、2相ロック,楽観的2相ロック,グローバルタイムスタンプに基づく楽観的方法,ベーシックタイムスタンプオーダリング等の各種があり、これらによって一つのトランザクションの中で全ての複製データを更新する場合には直列化可能となる。なお、「完全に複製されたシステムでは、楽観的2相ロックが最も適している」と述べている論文がある(M.J.Carey and M.Livny: “Conflict detection tradeoffs for replicated data," ACM TODS,Vol.16,No.4,pp.703−746,Dec.1991:シミュレーションでパフォーマンス評価を行った代表的論文である)。
【0039】
上記強い一貫性管理方法のうち、楽観的制御方式ではコミット時までロックを行わずにプライベート領域(ワークエリア)にのみ複製データの更新結果を保存しておき、コミット時になって初めてトランザクション間の競合があったかどうかを調べる。
【0040】
ここで、あるデータに対する複数の複製データがシステム内に存在する場合の楽観的2相ロック方式の代表例な処理の例を以下に示す(ICDCS95のJingのアルゴリズム)。
(1)readとwriteに対しては、全複製データX0,X1,・・・,XnをRlock(readモードのロック)する(Rlockはトランザクションが複製データを利用していることを示すためのものである)。
(2)トランザクションの終了時に、writeした複製データをWlock(writeモードのロック)する。Wlockできればトランザクションをコミットし、そうでなければアボートする。
(3)全ロックを解除する。
【0041】
上記楽観的2相ロック方式においては、確認相で全てのサイトDBSにロックをかけなければならないことが問題である。すなわち、実際には全てのサイトDBSにロックをかけることは難しいため、楽観的2相ロック方式は障害に弱いといえる。
【0042】
その理由について、集中管理に基づく2相ロック方式と比較して説明する。集中管理に基づく2相ロック方式の場合は、トランザクションがreadしたいとき、マスターデータに対してRlockをかけてから、ローカルデータを読み出す。writeの場合も同様で、マスターデータにWlockをかけてから全複製データをwriteする。したがって、マスターデータのみをロックすれば良いため、負荷を軽減できる。ところが、楽観的2相ロック方式の場合には、全てのサイトでwriteできなければアボートしなくてはならないため、障害に弱いといえる。
【0043】
また、ダウンしている(参加できない)サイトがあっても、処理が続けられるようにするために、以下の2つの方式が考えられる。
【0044】
第1の方式は、重み付き投票方式(Giffordによって提案されたもの)である。重み付き投票方式においては、以下の条件を満たす一定数のサイトが参加すれば、その中に必ず最新版の値が含まれることが保証されている。
【0045】
Read−quorum+Write−quorum>n
Write−quorum+Write−quorum>n
ここで、nは複製データの数を表す。
【0046】
第2の方式は、集中管理に基づくタイムスタンプベースの楽観的方式(PTO:Primary−based Timestamp Optimistic
Control)である。PTO方式は集中管理方式であるため、ダウンしているサイトについては無視することができる。
【0047】
具体的に、集中管理方式では、更新が承認された複製データの最新の値が主サイトDBSP に保持される。よって楽観的制御方式の確認相(validation phase)において一貫性のチェックを行う場合に主サイトDBSP に問い合わせるだけで済み、他の複製データにWlockをかけにいく必要はなくなる。切断していたサイトが再接続した場合の制御も同じで良い。PTO方式において複数種類の複製データにアクセスするトランザクションにあっては、ローカルサイトにそれらの複製を作成してから実行を始めることとする。
【0048】
実施の形態1に係る分散型データベースシステムの一貫性管理方法を超多地点にわたる分散型データベースシステムに適用することを想定した場合には、重み付き投票方法よりPTO方式の方が優れていると考えられる。なぜなら、PTO方式の場合、一貫性のチェックを行う場合に主サイトDBSP に問い合わせるだけで済むため、主サイトDBSP がダウンしない限り、通信コストの削減を図ることができるからである。
【0049】
そこで、実施の形態1に係る分散型データベースシステムの一貫性管理方法においては、レベルAの一貫性管理方法としてPTO方式を採用することにし、以下にレベルAの一貫性管理方式を具体的に説明する。ここでは、サイトDBS1 でread−onlyまたはread−only以外の更新を含むトランザクションTが発生するものとする。
【0050】
なお、以下の説明において、複製データはオブジェクトOに対してn個あると仮定し、それをO1 ,・・・,On と表すと共に、主サイトDBSP が有するオブジェクトOの複製データをO0 と表す。オブジェクトOの最後に更新された時刻を表すタイムスタンプをt(O)とし、またトランザクションTが保持するオブジェクトOの最終更新タイムスタンプをt(O,T)と表すことにする。
【0051】
サイトDBS1 は、トランザクションTが発生すると、そのトランザクションTに設定されている一貫性管理のレベルを判定する処理を行う。発生したトランザクションTがレベルAの場合、レベルAの一貫性管理方法が実行される。
【0052】
(1)更新を含むトランザクションの場合
〔1〕 読み出し相
サイトDBS1 は、ローカルデータ、即ち複製データOi にアクセスし、複製データOi をプライベート領域(ワークエリア)に読み出す。そして、プライベート領域に読み出された複製データOi についてreadおよびwriteが行われる。複製データOi をプライベート領域に読み出す際には、複製データOi の最後に更新された時刻を表すタイムスタンプt(Oi )をトランザクションTが保持する複製データOi の最終更新タイムスタンプに設定し、t(Oi ,T)とする。
【0053】
〔2〕 確認相
サイトDBS1 は、主サイトDBSP に対してレベルAの一貫性管理方法の要求を含むREQUESTメッセージを送信する。図4は、REQUESTメッセージを示す説明図であり、図4に示すデータがREQUESTメッセージに設定され、主サイトDBSP に対して送信される。なお、REQUESTメッセージには、メッセージの送信元であるサイトDBSのサイトID,トランザクションID,さらに、トランザクションTがアクセスした複製データOi毎に、操作(readまたはwrite),対象オブジェクトID,タイムスタンプt(Oi,T)および更新後の値が設定される。
【0054】
主サイトDBSP は、REQUESTメッセージを受信し、トランザクションTにレベルAが設定されていると判定して、受信したREQUESTメッセージを待ち行列に入力する。待ち行列に入力されたREQUESTメッセージは、入力された順番で処理される。
【0055】
ここで、主サイトDBSP は、サイトDBS1 によってアクセスされた複製データOi の全てについて、
【数1】

Figure 0003563591
の条件を満たすか否か危険領域(critical section)内で判定する。
【0056】
上記条件を満たすと判定した場合、サイトDBS1 で更新された複製データOi に該当する複製データO0 をREQUESTメッセージ中の更新後の値を用いて更新し(更新後の値を保持する)、そのタイムスタンプをt(O0 )=Clock(現在時刻のタイムスタンプ)に変更した後、図5に示すコミットメッセージを全てのサイトDBS(サイトDBS1 ,サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn :更新された複製データOiに該当する複製データを有するサイトDBS)に送信する。このコミットメッセージは、REQUESTメッセージに基づいて生成され、REQUESTメッセージの送信元であるサイトDBSのサイトID,トランザクションID,さらに、複製データOi毎に、対象オブジェクトID,タイムスタンプt(O0 )および更新後の値が設定される。
【0057】
すなわち、更新を含むトランザクションの場合、主サイトDBSP はそのトランザクション内でサイトDBS1 ,サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn の全てに更新情報の伝播を行う。ただし、2相コミット方式とは異なり、サイトDBS1 ,サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn からの返事は必要としない。つまり、ダウンしているサイトDBSがあっても無視して処理を進めることができる。
【0058】
なお、ダウンしているサイトDBSが復旧した場合、そのサイトDBSは、主サイトDBSP に対して何らかのトランザクションを実行することにより、最新の更新状態を知ることができる。また、復旧した後に、主サイトDBSP に対して最新の更新状態を問い合わせることができるようにすることもできる。
【0059】
一方、上記条件を満たさないと判定した場合、図6に示すアボートメッセージをサイトDBS1 に送信する。このアボートメッセージは、REQUESTメッセージに基づいて生成され、REQUESTメッセージの送信元であるサイトDBSのサイトID,トランザクションID,さらに、複製データOi毎に、対象オブジェクトID,タイムスタンプt(O0 )および現在の値O0 が設定される。
【0060】
〔3〕 書き込み相
サイトDBS1 ,サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn は、コミットメッセージを受信した場合、コミットメッセージに含まれている更新後の値およびその
【0061】
一方、サイトDBS1 は、アボートメッセージを受信した場合、トランザクションTをアボートし、アボートメッセージに含まれている最新値およびタイムスタンプ値を用いて複製データOi およびそのタイムスタンプt(Oi )を更新する。
【0062】
(2)read−onlyのトランザクションの場合
続いて、read−onlyのトランザクションの場合について説明する。サイトDBS1 は、ローカルデータ、即ち複製データOi にアクセスし、複製データOi をプライベート領域(ワークエリア)に読み出す。ここで、複製データOi をプライベート領域に読み出す際には、複製データOi のタイムスタンプt(Oi )をトランザクションTが保持する複製データOi のタイムスタンプに設定し、t(Oi ,T)とする。
【0063】
サイトDBS1 は、主サイトDBSP に対してレベルAの一貫性管理方法の要求を含むREQUESTメッセージを送信する。このREQUESTメッセージは図4に示したものと同様であるが、read−onlyのトランザクションであるため、更新後の値は除かれる。
【0064】
主サイトDBSP は、REQUESTメッセージを受信し、トランザクションTにレベルAが設定されていると判定して、受信したREQUESTメッセージを待ち行列に入力する。待ち行列に入力されたREQUESTメッセージは順番に処理される。
【0065】
主サイトDBSP は、サイトDBS1 によってアクセスされた複製データOi について、
【数2】
Figure 0003563591
の条件を満たすか否か危険領域(critical section)内で判定する。
【0066】
上記条件を満たすと判定した場合、図5に示したコミットメッセージをサイトDBS1 に送信する。ただし、read−onlyのトランザクションであるため、更新後の値は除かれる。一方、上記条件を満たさないと判定した場合、図6に示したアボートメッセージをサイトDBS1 に送信する。
【0067】
サイトDBS1 は、コミットメッセージを受信した場合、厳格に一貫性が保たれているとしてread−onlyのトランザクションをコミットする。一方、サイトDBS1 は、アボートメッセージを受信した場合、read−onlyのトランザクションをアボートし、アボートメッセージに含まれている最新値およびタイムスタンプ値を用いて複製データOi およびそのタイムスタンプt(Oi )を更新する。
【0068】
(レベルBの一貫性管理方法)
つぎに、レベルBによる一貫性管理方法について説明する。レベルAでは一つのトランザクションの中で全てのサイト(サイトDBS1 ,サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn )への更新を行うことにしているが、レベルBでは、別のトランザクションで更新を伝播させることにする。つまり、即時に更新を伝播させるのではなく、後述する各種の差異限定制約条件(本発明の更新伝播条件に該当する)を設け、その条件が満足された場合に更新伝播を行うという処理を行う。
【0069】
ここでは、サイトDBS1 でread−onlyまたはread−only以外の更新を含むトランザクションTが発生するものとして、レベルBの一貫性管理方法を具体的に説明する。
【0070】
サイトDBS1 は、トランザクションTが発生すると、そのトランザクションTに設定されている一貫性管理のレベルを判定する処理を行う。発生したトランザクションTがレベルBの場合、レベルBの一貫性管理方法が実行される。
【0071】
(1)更新を含むトランザクションの場合
〔1〕 読み出し相
サイトDBS1 は、ローカルデータ、即ち複製データOi にアクセスし、複製データOi をプライベート領域(ワークエリア)に読み出す。そして、プライベート領域に読み出された複製データOi についてreadおよびwriteが行われる。ここで、複製データOi をプライベート領域に読み出す際には、複製データOi の最後に更新された時刻を表すタイムスタンプt(Oi )をトランザクションTが保持する複製データOi の最終更新タイムスタンプに設定し、t(Oi ,T)とする。
【0072】
〔2〕 確認相
サイトDBS1 は、主サイトDBSP に対してレベルBの一貫性管理方法の要求を含むREQUESTメッセージを送信する。このREQUESTメッセージは、図4に示したものと同様のものである。
【0073】
主サイトDBSP は、REQUESTメッセージを受信し、トランザクションTにレベルBが設定されていると判定して、受信したREQUESTメッセージを待ち行列に入力する。待ち行列に入力されたREQUESTメッセージは、入力された順番で処理される。
【0074】
ここで、主サイトDBSP は、サイトDBS1 によってアクセスされた複製データOi の全てについて、
【数3】
Figure 0003563591
の条件を満たすか否か危険領域(critical section)内で判定する。
【0075】
上記条件を満たすと判定した場合、サイトDBS1 で更新された複製データOi に該当する複製データO0 をREQUESTメッセージ中の更新後の値に更新し(更新後の値を保持する)、そのタイムスタンプをt(O0 )=Clock(現在時刻のタイムスタンプ)に変更した後、図5に示したコミットメッセージをサイトDBS1 に送信する。加えて、主サイトDBSP は、上記トランザクションで更新された更新情報をキューに入れておき、差異限定制約条件が満足された場合に、この更新情報を別のトランザクションにおいて他のサイトDBS(サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn )に送信することによって更新伝播を行う。なお、REQUESTメッセージを送信して来たサイトDBS(ここではサイトDBS1 )に対しては、通信コストを下げるために更新伝播を行わないようにする。
【0076】
一方、上記条件を満たさないと判定した場合、図6に示したアボートメッセージをサイトDBS1 に送信する。
【0077】
ここで、上記差異限定制約条件について説明する。差異限定制約条件としては、例えば、以下のa)〜e)等を挙げることができる。
【0078】
a)リフレッシュする周期を設定し、設定した周期毎に更新伝播を行う。
主サイトDBSP は、一定の周期毎に、他の全てのサイトDBS(サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn )に更新情報を送信することにより、更新伝播を行う。主サイトDBSP は、データ更新情報をキューに入れておき、周期毎にそれを送り出す。受け側のサイトDBS(サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn )はこの更新情報が送られてくることにより、主サイトDBSP がダウンしていないことを知ることができる。
【0079】
b)キューにたまっている更新情報の数が一定数を超えた場合に更新伝播を行う。
例えば限度数を3とした場合は、更新情報がキューに3つたまったところで更新伝播が行われる。
【0080】
c)更新伝播を行う基準となるデータの領域を決めておき、その領域のデータが更新された場合に更新伝播を行う。
例えば、書誌情報のうち、タイトルおよび作者の2つの属性が更新された場合は即時に更新伝播を行うというものであり、直ちに更新情報を公知にする必要があるときに有効である。スキーマの属性として、オブジェクトやその属性に即時更新伝播フラグをつけておき、それがONになっている情報に更新があった場合は即時に更新伝播を行うようにする。ただし、この条件を設定する場合には、他の条件と共に設定する必要がある。
【0081】
d)更新伝播を行う基準となる閾値を設定し、設定した閾値を超えた場合に更新伝播を行う。
データの更新の度合いに対して閾値を設定しておく。例えば、コンテンツの1/20以上が更新された場合に更新伝播するというような絶対的な値を設定し、または、参照された回数が100を超えたら即時更新伝播するというような設定を行う。後者の場合、本や番組で人気が出たものはそれを参照する人が多いことを示しているため、即時に情報行進を行うほうが良いという考えに基づくものである。
【0082】
e)バージョンが大きく変わった場合に更新伝播を行う。
本の改訂版等でマイナーな誤字の直し程度であれば更新伝播を待つようにするが、大幅な修正が加えられた改訂版が出たような場合には、直ちに更新伝播を行うことにするというものである。
【0083】
なお、上記a)〜e)の差異限定制約条件は組み合わせて設定することができる。
【0084】
次に、差異限定制約条件を用いた更新伝播手順について説明する。図7(a)は差異限定制約条件を設定する手順を示すフローチャートである。図7(a)に示すように、システムのセットアップ時において、上記a)〜e)に示した差異限定制約条件を単独または組み合わせて主サイトDBSP に設定する(S700:本発明の更新伝播設定工程に該当する)。
【0085】
なお、差異限定制約条件を設定する際には、主サイトDBSP を操作して設定しても良いし、サイトDBS1 ,サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn から設定することもできる。
【0086】
また、差異限定制約条件は、上記ステップS700の処理を再び行うことによって後に変更することも可能であるが、図3(a)に示したステップS300において一貫性管理のレベルを設定する際にいずれかの差異限定制約条件を設定しておく必要がある。
【0087】
さらに、サイトDBS毎に異なる差異限定制約条件を設定することもできる。例えば、サイトDBS1 については差異限定制約条件a)で更新伝播を行い、サイトDBS2 については差異限定制約条件b)で更新伝播を行うように主サイトDBSP に対して設定することもできる。この場合、主サイトDBSP は、各サイトDBS毎に設定された差異限定制約条件を管理し、各サイト毎に異なる差異限定制約条件を用いて更新伝播を行うことになる。
【0088】
図7(b)は図7(a)に示すようにして設定した差異限定制約条件に基づいて更新伝播を行う手順を示すフローチャートである。主サイトDBSP は、常にまたは定期的にキューに入れられた更新情報について、差異限定制約が満足されたか否かを判定する(S701)。
【0089】
そして、ステップS701において差異限定制約が満足されたと判定した場合には、キューに入れられた更新情報をサイトDBS1 ,サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn に送信することによって更新伝播処理を行う(S702)。
【0090】
〔3〕 書き込み相
サイトDBS1 は、コミットメッセージを受信した場合、コミットメッセージに含まれている更新後の値およびそのタイムスタンプ値を用いて該当する複製データを更新する。
【0091】
また、サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn は、主サイトDBSP から更新伝播を受信した場合、更新後の値およびそのタイムスタンプ値を用いて該当する複製データを更新する。この際、2相コミット方式とは異なり、サイトDBS1 ,サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn からの返事は必要としない。つまり、ダウンしているサイトがあっても無視して処理を進めることができる。
【0092】
なお、ダウンしているサイトDBSが復旧した場合、そのサイトDBSは、主サイトDBSP に対して何らかのトランザクションを実行することにより、最新の更新状態を知ることができる。また、復旧した後に、主サイトDBSP に対して最新の更新状態を問い合わせることができるようにすることもできる。
【0093】
一方、サイトDBS1 は、アボートメッセージを受信した場合、トランザクションをアボートし、アボートメッセージに含まれている最新値およびタイムスタンプ値を用いて複製データOi およびそのタイムスタンプt(Oi )を更新する。
【0094】
(2)read−onlyのトランザクションの場合
レベルBの場合は、差異限定制約条件に基づいて更新伝播を行うため、主サイトDBSP を除き、サイトDBS1 ,サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn の複製データは最新バージョンではない可能性が常にある。それをread−onlyのトランザクションにおいて許可するかしないかでレベルAとレベルBとの差が生じる。
【0095】
レベルBにおけるread−onlyのトランザクション場合では、ローカルサイト(サイトDBS1 ,サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn )の複製データをそのままreadするようにして、直列可能性チェックを緩和する。つまりread−onlyのトランザクションであれば、他のサイトDBSとの調整を行うことなくローカルに実行してしまうことにする。このようにした場合であっても、1コピー直列化は保証される。つまり、他の更新が起こる前にreadしていたと考えることで直列化できる。
【0096】
(レベルCの一貫性管理方法)
レベルBによる一貫性管理方法は、更新を含むトランザクションに対しては厳格、つまり強い一貫性管理を採用している。これに対し、レベルCによる一貫性管理方法においては、システム全体の処理効率を更に向上させるため、更新を含むトランザクションも緩和して弱い一貫性管理を行うことにする。
【0097】
そこで、レベルCの一貫性管理方法を説明する。ここでは、サイトDBS1 でread−onlyまたはread−only以外の更新を含むトランザクションTが発生するものとする。
【0098】
サイトDBS1 は、トランザクションTが発生すると、そのトランザクションTに設定されている一貫性管理のレベルを判定する処理を行う。発生したトランザクションTがレベルCの場合、レベルCの一貫性管理方法が実行される。
【0099】
(1)更新を含むトランザクションの場合
〔1〕 読み出し相
サイトDBS1 は、ローカルデータ、即ち複製データOi にアクセスし、複製データOi をプライベート領域(ワークエリア)に読み出す。そして、プライベート領域に読み出された複製データOi についてreadおよびwriteが行われる。ここで、レベルCの一貫性管理方法においては、弱い一貫性管理を採用することにより、主サイトDBSP を介することなく、サイトDBS1 ,サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn 毎に単独で複製データの更新を行うことができる。そのため、サイトDBS1 は、読み出した複製データOi を更新し、更新を含むトランザクションをコミットする。
【0100】
〔2〕 確認相
サイトDBS1 は、上記コミット時に主サイトDBSP 宛てに承認リクエストメッセージ(更新ログ)を送信する。承認リクエストメッセージは、図4に示したREQUESTメッセージと同様のものである。
【0101】
主サイトDBSP は、サイトDBS1 からの承認リクエストメッセージに対して承認または非承認を与える。承認・非承認の判定条件はPTO方式の中で説明した通常のタイムスタンプ方式によるものである。
【0102】
ここで、承認・非承認を判定する際に、サイトDBS1 の承認リクエストメッセージと競合する他のサイトDBSの承認リクエストメッセージが存在しない場合には、サイトDBS1 において行われた更新が承認される。その結果、主サイトDBSP の該当する複製データが更新される(更新後の値を保持し、タイムスタンプを変更)と共に、レベルBで説明したように、その更新情報がキューに入れられ、差異限定制約条件が満足された場合に、この更新情報をサイトDBS(サイトDBS1 ,サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn )に送信することによって更新伝播が行われる。なお、差異限定制約条件については、レベルBで説明した通りであるため、ここでは説明を省略する。また、レベルBの場合と同様に、承認リクエストメッセージを送信して来たサイトDBS(ここではサイトDBS1 )に対しては、通信コストを下げるために更新伝播を行わないようにする。
【0103】
一方、例えば、サイトDBS1 およびサイトDBS2 の承認リクエストメッセージが競合したものとする。具体的には、サイトDBS1 およびサイトDBS2 で同一の複製データOi を保持していて、両方のトランザクションで同時刻に複製データOi を更新し、両方のトランザクションがコミットされた後、承認リクエストメッセージ(更新ログ)が主サイトに届いたものとする。主サイトDBSP は、承認リクエストメッセージが先に届いたサイトの更新を承認し、後から届いた方の更新は承認しない。ここで、サイトDBS2 の承認リクエストメッセージがサイトDBS1 の承認リクエストメッセージより先に主サイトDBSP に届いたものとすると、サイトDBS1 の更新は承認されないことになる。この場合、主サイトDBSP は、サイトDBS1 に対してアボートメッセージを送信する。
【0104】
〔3〕 書き込み相
更新が承認された場合、サイトDBS1 は、既に複製データを更新するためのトランザクションはコミットされているため何ら処理を行う必要はない。一方、他のサイトDBSは、差異限定制約条件によって更新情報が伝播されて来るため、その更新情報に基づいて複製データを更新する。この際、2相コミット方式とは異なり、サイトDBS1 ,サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn からの返事は必要としない。つまり、ダウンしているサイトがあっても無視して処理を進めることができる。
【0105】
なお、ダウンしているサイトDBSが復旧した場合、そのサイトDBSは、主サイトDBSP に対して何らかのトランザクションを実行することにより、最新の更新状態を知ることができる。また、復旧した後に、主サイトDBSP に対して最新の更新状態を問い合わせることができるようにすることもできる。
【0106】
一方、アボートメッセージを受信した場合は、既にトランザクションはコミットにより完了してしまっているため通常のアボートを行うことはできない。そこで、レベルCにおいては、他のサイトDBSから必要なバージョンの複製データをコピーすることにより更新してしまった複製データを回復することにする。
【0107】
ここで、上記承認リクエストメッセージ中の複製データのうち、主サイトDBSP から更新されている値をコピーする処理、つまりトランザクション自身がアボート用にデータを格納しておき、このデータを用いて更新してしまった複製データを回復するという処理も考えられる。しかしながら、マルチメディアデータは一般にサイズが大きいため、トランザクションの中で複製を作ることはコストがかかり問題となる。また、更新頻度の小さい応用においては更新が衝突する可能性が少ないため、そのような応用においてアボート用にデータの複製を作ることは効率的ではない。
【0108】
よって、アボートメッセージを受信した場合の処理として、記憶容量およびコピーに要する時間の点からも他のサイトDBSから必要なバージョンの複製データをコピーして回復する処理を行う方が効率的であるといえる。
【0109】
(2)read−onlyのトランザクションの場合
レベルCにおけるread−onlyのトランザクション場合では、ローカルサイト(サイトDBS1 ,サイトDBS2 ,サイトDBS3 ,・・・,サイトDBSn )の複製データをreadするようにして、直列可能性チェックを緩和する。つまりread−onlyのトランザクションであれば、他のサイトとの調整を行うことなくローカルに実行してしまうことにする。このようにした場合であっても1コピー直列化は保証される。つまり、他の更新が起こる前にreadしていたと考えることで直列化できる。
【0110】
ここで、レベルCの応用例として、検索エージェント(人間に代わって複数のDBサイトを縦断検索してくれるようなプログラム)のDBを考える。従来のデータベースはオブジェクト値を永続的に格納することを目的としていた。ところが、検索エージェントのような応用を考えた場合、その記憶としてデータベースを使うならば、永続的というよりは「少々間違っていても良く、間違っていることが判定できれば良い。そして、間違っていたら正しい値に更新すれば良い。」という特徴を持つ。検索サイト名等を格納している場合において、もし、そのサイトが移動したとしても、そのサイトにアクセスしたときに初めて「そのサイトが移動していたこと」がわかれば良い。人間の記憶の変わりにDBを利用とする場合、このような「多少間違ったデータでも良い」という応用例を多く見出すことができる。
【0111】
なお、以上説明した一貫性管理のレベルA〜Cの特徴を一つにまとめると、図8のようになる。
【0112】
このように、実施の形態1に係る分散型データベースシステムの一貫性管理方法によれば、分散型データベースシステムの一貫性管理のレベルとしてレベルA〜Cを設け、トランザクションの種類に応じてレベルA〜Cによる異なる一貫性管理を行うことにより、複製データの一貫性管理における利便性の向上を図ることができる。
【0113】
また、実施の形態1に係る分散型データベースシステムの一貫性管理方法を用いることにより、それぞれ異なる一貫性管理のレベルでトランザクションを実行することができ、トランザクションの種類に応じて最適な複製データの一貫性管理を行うことができる。
【0114】
さらに、レベルBおよびレベルCの場合は、差異限定制約が満足された場合に更新伝播を行うことにしたことにより、更新がある毎に更新伝播を行う必要をなくすことができ、複製データの一貫性保持のコストを削減することができる。
【0115】
〔実施の形態2〕
つぎに、実施の形態2に係る分散型データベースシステムの一貫性管理方法について説明する。例えば、電子図書館等の応用においては、新規の書誌データを一括して登録することが多く、また、大学等でも新入生や新人のデータ登録を一括して行うことが多い。こうした新規登録トランザクションは、既にあるデータを参照しないで独立に処理することが可能であることから、他のトランザクションとの競合の確認処理を省略しても何ら問題は発生せず、むしろ処理の効率化を図る上で好ましい。そのため、実施の形態2に係る分散型データベースシステムの一貫性管理方法においては、実施の形態1で説明した処理に加えて、一貫性管理のレベルを判定する際に新規登録トランザクションか否かを判定し、新規登録トランザクションである場合には、他のトランザクションとの競合の確認処理を省略して、そのまま登録処理を行うことができるようにするものである。
【0116】
ところで、楽観的制御においては、読み出し相,確認相および書き込み相からなる処理を行う必要がある。ところが新規登録のみのトランザクションでは、他のトランザクションと競合する可能性は全くないため、トランザクションが競合するか否かの確認を省略し、読み出し相の処理が終わった後、直接書き込み相の処理を実行することができる。
【0117】
そこで、実施の形態2に係る分散型データベースシステムの一貫性管理方法においては、既存のデータと独立なデータを新規登録する場合について、独自のトランザクションレベル(例えば、新規登録処理フラグを設定する)を設け、そのレベルのトランザクションについては一切競合チェックを行わないことにする。
【0118】
新規登録トランザクションは、実施の形態1で説明したレベルA〜Cのいずれ対しても適用することができる。ただし、効率を考えた場合には、各サイトDBS単位で更新を行うことができるレベルCに適用することが最も優れている。そのため、実施の形態2においては、この新規登録トランザクションをレベルCに適用することを前提として、処理の概略を説明する。図9(a)は一貫性管理のレベルおよび新規登録トランザクションを設定する手順を、図9(b)は図9(a)に示すようにして設定した一貫性管理のレベルおよび新規登録トランザクションの設定に基づいて一貫性管理方法および新規登録を実行する手順を示すフローチャートである。
【0119】
まず、図9(a)に示すように、トランザクションの種類に応じて一貫性管理のレベルを設定し(実施の形態1参照)、かつ、データの新規登録のためのトランザクションを新規登録トランザクションとして設定する(S900)。
【0120】
図9(a)のステップS900で新規登録トランザクションについての一貫性管理レベルを設定した後、図9(b)に示すように、分散型データベースシステム内にトランザクションが発生すると(S901)、発生したトランザクションに設定されている一貫性管理のレベルの判定処理およびトランザクションが新規登録トランザクションか否かの判定処理を実行する(S902:本発明の判定工程に該当する)。
【0121】
そして、ステップS902において、トランザクションが新規登録トランザクションであると判定した場合、設定されているレベルに関係なく、レベルCと判定する(S903:本発明の判定工程に該当する)。そして、ステップS906に進み、レベルCの一貫性管理方法を実行する。
【0122】
なお、レベルCで新規登録トランザクションを実行する場合においては、他のサイトDBSにおけるトランザクションとの競合の可能性がないことから、承認リクエストメッセージを用いた競合のチェックは省略される。
【0123】
このように、実施の形態2に係る分散型データベースシステムの一貫性管理方法によれば、データの新規登録を行うためのトランザクションを実行する場合において、他のトランザクションとの競合をチェックする処理を省略することにしたため、データを新規登録する際の処理効率を向上させることができる。
【0124】
ただし、INSERT操作の中には既存のデータと意味的に関連付けられているものがある。例えば、readした2つの値の平均値を求め、その値を使ってINSERTするようなトランザクションの場合である。このような場合には、既存のデータと意味的に関連があるため、そのトランザクションは新規登録トランザクションではない。
【0125】
〔実施の形態3〕
上述したレベルBおよびレベルCの一貫性管理方法においては、主サイトDBSP に予め設定された差異限定制約条件が満足された場合に、主サイトDBSP から各サイトDBSに対して更新情報を送信し、更新伝播を行うことにしている(図7参照)。実施の形態3においては、更新伝播を行うタイミングとして、主サイトDBSP に設定された差異限定制約条件が満足された場合に加え、トランザクションが発生したサイトDBS側でコンテンツの内容に応じて更新伝播を行うタイミングを設定することができるようにする。このようにするのは、コンテンツによっては早期に公開すべきものや多少公開が遅れても良いとされるものがあり、例えば、台風情報等のように早期に公開すべき情報については5分以内に全てのサイトDBSに更新伝播を完了したいという要請に答えることができるようにするためである。
【0126】
図10は、本発明の実施の形態3に係る分散型データベースシステムの一貫性管理方法を実現するための分散型データベースシステムの概念構成図である。図10に示す分散型データベースシステムは、図2に示した構成に加えて、更新伝播を行う際に、衛星1000を用いた放送を利用して主サイトDBSP から各サイトDBSに更新情報を配信できるようにしたものである。一般に衛星1000等を利用して情報を配信することは例えばインターネットを利用する場合と比べてコストが高いが、緊急に全てのサイトDBSに更新伝播を行いたい場合等において放送により更新情報を配信することにより、全てのサイトDBSに対して更新情報を短時間にかつ一度に配信することができるという利点がある。
【0127】
なお、図10において、1001a〜1001eは、放送波を用いて更新情報を送信または受信するためのアンテナを、1002は実施の形態1および2で既に説明した各種情報を送受信するための通信回線をそれぞれ示している。
【0128】
また、図10には、衛星1000を用いた放送により情報やり取りを行うことができる分散型データベースシステムを一例として示したが、これに加えて、または代えて地上波等、情報を送信可能な他の手段を用いることにしても良い。
【0129】
次に、実施の形態3に係る分散型データベースシステムの一貫性管理方法について、サイトDBS1 でレベルCの一貫性管理方法が設定されたトランザクションが発生した場合を例にとって説明する。なお、ここではレベルCの場合について説明するが、レベルBの場合にも同様に適用できることは明らかである。また、実施の形態1および2で既に説明した事項については、簡単に説明することにする。
【0130】
図11は、更新伝播タイミング設定処理を示すフローチャートである。サイトDBS1のユーザは、複製データの更新を行う際に、例えば、予め用意された入力欄等に以下に説明する情報を設定する(S1101)。
【0131】
ステップS1101においては、緊急度,公開指定日時,伝播遅延許容日時,伝播方式が設定されるものとする。緊急度には例えば以下のようなレベルがあり、これらのレベルは予めシステム構築者が設定する。したがって、ユーザは設定されている緊急度レベルの中から所望のレベルを選択し、緊急度の項目に設定するすることになる。
【0132】
・緊急度1:10分以内に更新伝播を行う。
・緊急度2:60分以内に更新伝播を行う。
・緊急度3:1日以内に更新伝播を行う。
・緊急度4:3日以内に更新伝播を行う。
【0133】
公開指定日時の項目は、例えば報道ニュース等には明朝10時までは情報を公開してはならないという要求があることから設けられたものである。したがって、ユーザはこの項目に対して所望の日時を設定する。なお、この公開指定日時が指定された場合、主サイトDBSP は、公開指定日時が経過した後に更新された複製データに関する情報について更新伝播を行うようにする。また、これに代えて、公開指定日時の経過前に更新伝播を行うことにしても良い。いずれを用いるかについては、後述する更新伝播のスケジュールを設定する際(図13のステップS1304参照)に決定すれば良い。ただし、公開指定日時の経過前に更新伝播を行うことにする場合、各サイトDBSにおいて公開指定日時が経過する前に該当する更新後のデータを公開しないようにする手法を確立しておくことが必要となる。
【0134】
伝播遅延許容日時の項目には、更新伝播の遅れが許される最大限の日時を設定する。
【0135】
さらに、配信方式の項目には、通信(通信回線1002を用いる),衛星放送,地上波放送等のいずれの方式を用いて更新伝播を行うかを設定する。
【0136】
そして、ここではレベルCであるため、サイトDBS1においてトランザクションをコミットするかアボートするかが判定され、コミットの場合はサイトDBS1 の該当する複製データが更新される。なお、実施の形態2で説明した新規登録トランザクションの場合には、他のトランザクションとの競合のチェック処理は省略される。
【0137】
コミットの場合、サイトDBS1 は、上述したように承認リクエストメッセージを主サイトDBSP に通信回線1002を介して送信するが、その際、図12(a)および図12(b)に例として示すデータを承認リクエストメッセージ(図4に示したREQUESTメッセージと同一内容:レベルBの場合も同様)に添付する。その結果、図11のステップS1101で設定した緊急度等は、属性値として承認リクエストメッセージに設定されることになる。
【0138】
主サイトDBSP は、サイトDBS1 から承認リクエストメッセージを受信すると、他のサイトDBSで行われた更新処理と競合しないか否かを判定し、競合しないと判定した場合は以下の更新伝播管理処理を実行する。なお、新規登録トランザクションの場合は競合のチェック処理は省略される。また、競合のチェック処理と並行して更新伝播管理処理を実行することにしても良いが、他のサイトの更新処理と競合すると判定された場合は更新伝播管理処理を途中で終了することになる。
【0139】
図13は、主サイトDBSP による更新伝播管理処理を示すフローチャートである。主サイトDBSP は、サイトDBS1 から受信した承認リクエストメッセージから依頼元ID(サイトID),依頼日時,更新OIDリスト,緊急度,公開指定日時,更新遅延許容日時および配信方式をコピーし(S1301)、さらに、依頼到着日時(主サイトDBSP が承認リクエストメッセージを受信した日時),データサイズ(送るべきデータのサイズ)を計測・設定し(S1302)、図14に示すような更新伝播管理情報を生成する。この更新伝播管理情報は、課金のためのデータとして利用することができる。
【0140】
なお、ステップS1302において、承認リクエストメッセージに伝播遅延許容日時が設定されていない場合には、
依頼到着日時+指定された緊急度の許容時間(緊急度1なら10分)
という計算を行い、伝播遅延許容日時を設定する。
【0141】
更新伝播管理情報を生成した後、主サイトDBSP は、指定された緊急度が許容可能か否かについて、以下の基準に基づいて判定する(S1303)。
【0142】
・[依頼到着日時+指定された緊急度の許容時間]>伝播遅延許容日時の場合
・[公開指定日時+指定された緊急度の許容時間]>伝播遅延許容日時の場合
・(データサイズ×送付サイト数)の値が大きすぎる場合
なお、ここで、送付サイト数は、例えばサイトDBS1 が更新を行った複製データ(オブジェクト)と同一のオブジェクトに対する複製データを有する他のサイトDBSの数であり、どのサイトDBSが送付サイトに該当するかは主サイトDBSP が判断する。
【0143】
更新伝播管理情報中の値が上記3つの条件の少なくとも一つを満たすような場合、主サイトDBSP は、指定された緊急度が許容可能ではないと判定し、許容不可能メッセージを生成してサイトDBS1 (依頼元のサイト)に送信し、図12に示したデータのみを再度送信するように要求する(S1307)。
【0144】
そして、サイトDBS1 (依頼元のサイト)からメッセージに対する応答として図12に示したデータが送信され、そのデータを受信した場合(S1308)、主サイトDBSP はステップS1301に戻って再度更新伝播管理処理を実行する。
【0145】
一方、ステップS1303において、指定された緊急度が許容可能と判定した場合、主サイトDBSP は、更新伝播管理情報中の更新遅延許容日時より前に更新情報を各サイトDBSに配信できるように、更新伝播を行うスケジュールを設定する(S1304)。例えば、主サイトDBSP は、実施の形態1で説明した差異限定制約条件を用いて更新伝搬を行うスケジュールを設定する。いずれの差異限定制約条件を用いるかについては、例えば、図14に示した更新伝播管理情報中の伝播遅延許容日時に更新伝播が間に合うことを第1の基準とし、これに加えて更新伝播のコストが低いものはどれかを第2の基準として判断する。そして、主サイトDBSP は、選択した差異限定制約条件を用いて更新伝播を行うスケジューリングを行い、伝播遅延許容日時を守れるか否かを判定し、守れないと判定した場合には、より早い時期に更新伝播を行うことができる差異限定制約条件を用いて再度更新伝播を行うスケジューリングを行う。換言すれば、更新遅延伝播ルールとして各種の差異限定制約条件があるが、指定された緊急度を守ることができない可能性がある差異限定制約条件は採用しないことにする。
【0146】
その後、主サイトDBSP は、ステップS1304で設定したスケジュールに従い、更新伝播を実行する(S1305)。更新伝播は、更新伝播管理情報中に設定されている配信方式に従って更新情報を各サイトDBSに配信する。例えば、配信方式として「衛星」が設定されている場合は、衛星1000を用いて放送により更新情報を各サイトDBSに配信する。また、配信方式として「通信」が設定されている場合は、通信回線1002を介して更新情報を各サイトDBSに配信する。なお、通信回線1002を介して更新情報を各サイトDBSに配信する場合、承認リクエストメッセージを送信して来たサイトDBS(ここではサイトDBS1 )に対しては、通信コストを下げるために更新情報の配信は行わないようにする。
【0147】
そして、主サイトDBSP は、更新伝播の開始日時および完了日時のログと配信の遅れに関する情報とを更新伝播管理情報中に設定する(S1306)。配信の遅れに関する情報とは、更新伝播管理情報中の伝播遅延許容日時からどれくらい遅れて配信されたかを示し、
伝播完了日時−伝播遅延許容日時
で計算される。計算した結果が正の場合は、伝播遅延許容日時から遅れて更新伝播が行われたことを示し、その値を更新伝播管理情報中の「配信の遅れ」に設定する。一方、計算した結果が負の場合は、伝播遅延許容日時の前に更新伝播が完了したことを示し、負の場合は配信の遅れは生じていないため、「0」を更新伝播管理情報中の「配信の遅れ」に設定する。
【0148】
このように、実施の形態3に係る分散型データベースシステムの一貫性管理方法によれば、コンテンツの内容に適したタイミングで更新結果を各サイトDBSに配信することができるため、分散型データベースシステムの利便性の向上を図ることができる。
【0149】
また、更新結果を各サイトDBSに配信する方法として、衛星1000を用いた放送による配信方法や通信回線1002を用いた通信による配信方法等を選択することができるため、緊急度に応じて適切な配信方法を選択でき、分散型データベースシステムの利便性の向上を図ることができる。
【0150】
なお、詳細な説明については省略するが、レベルAの場合においても、放送により図4に示したコミットを配信することにしても良い。
【0151】
以上説明した実施の形態1〜3に係る分散型データベースシステムにおいては、トランザクションの種類毎に一貫性管理レベルについてレベルA〜Cのいずれかを設定し、設定したレベルで一貫性管理を行うことにしたが、例えば、レベルCの一貫性管理レベルのみが利用可能なシステムやレベルAおよびレベルCの一貫性管理レベルが利用可能なシステム等、分散型データベースシステムをどのように運用するかによって、様々な設計・変更が可能なことは明らかである。
【0152】
また、実施の形態1〜3に係る分散型データベースシステムの一貫性管理方法は、図3〜図5ならびに図11および図13に示したフローチャートの手順に従って、予め用意されたプログラムをコンピュータで実行することによって実現される。このプログラムは、ハードディスク,フロッピーディスク,CD−ROM,MO,DVD等のコンピュータで読み取り可能な記録媒体に記録され、コンピュータによって記録媒体から読み出されることによって実行可能である。また、このプログラムは、上記記録媒体を介して、またはネットワークを介して配布することができる。
【0153】
〔適用可能な応用分野〕
以上説明した実施の形態1〜3に係る分散型データベースシステムの一貫性管理方法は、以下に説明するような応用分野に適用することができる。ただし、本発明の分散型データベースシステムの一貫性管理方法を適用する応用分野を以下に説明するものに限定するものではない。
【0154】
本発明の分散型データベースシステムの一貫性管理方法は、
(1)マルチメディアのコンテンツを提供し、その視聴に対して課金を行うシステムであり、
(2)コンテンツの更新には時間的遅れを許し、
(3)システム内に構築されるDB(データベース)としては、コンテンツDB・インデックス情報DB(2次情報)・利用者統計情報DB・課金情報DBという種類を有する分散型データベースシステムに適用することができる。
【0155】
上記DBの特徴としては、以下のように考えられる。まず、コンテンツDBとしては、
(1)データのサイズが超大で、データはマルチメディアのBLOB(Binary Large Object)であり、
(2)複製データが多数必要であり(コンテンツがマルチメディアであるため、サイズが大きく、アクセスコストを下げるためには複製データを多数生成することが必要)、
(3)読み出す情報は多少古くても良く、
(4)読み出し頻度は大であるものである。
(5)更新伝播は遅延しても良い、
というものが考えられる。
【0156】
インデックス情報DBとしては、
(1)複製データは多数必要であり、
(2)複製データデータのサイズは小〜中であり、
(3)読み出す情報は多少古くても良く、
(4)読み出し頻度は大で、
(5)更新伝播は遅延しても良い、
というものが考えられる。
【0157】
利用者統計情報DBおよび課金情報DBとしては、
(1)複製データの数は少なくても良く、
(2)データのサイズはシステムに依存し、
(3)読み出す情報は多少古くても良く、
(4)読み出し頻度は小であり、
(5)更新伝播は遅延しても良く、集計する側への伝播は遅延しても良い、
というものが考えられる。ただし、利用者情報は紛失してもあまり問題とならないが、更新中に課金情報が紛失または欠落することは許されない。
【0158】
上記分散型データベースシステムにおいて発生する典型的なトランザクションとしては、
(1)利用者によるコンテンツ検索(アクセス頻度大)、
(2)コンテンツ提供者によるコンテンツの新規追加および修正(更新頻度は小)、
(3)コンテンツ提供者によるインデックス情報の新規追加および修正(更新頻度は小)、
(4)課金情報の収集(各利用者に対する課金収集は頻度が小さいが、利用者数が膨大であるため、大きくなる)、および、
(5)利用統計情報の収集(各利用者に対する課金収集は頻度が小さいが、利用者数が膨大であるため、大きくなる)、
が考えられる。
【0159】
上記条件を満たすシステム例としては、
(1)電子図書館システム(コンテンツは書籍,雑誌,CD−ROM,ビデオ等。インデックス情報は書誌情報。)、
(2)ビデオ・オン・デマンド(VOD)システム(コンテンツはビデオ。インデックス情報はビデオの各種属性。)、
(3)カラオケシステム(コンテンツはMIDI等の音楽情報,動画情報および歌詞の文字情報等。インデックス情報は曲に関する各種属性。)、
等が考えられる。
【0160】
【発明の効果】
以上説明したように、本発明の分散型データベースシステムの一貫性管理方法(請求項1)によれば、予め前記複製データに対するリードまたは更新の処理を含むトランザクションに、一貫性管理のレベルを表す第1レベル,第2レベルおよび第3レベルのいずれかを設定する一貫性レベル設定工程と、システム内においてトランザクションが発生した場合に、該発生したトランザクションに設定されている前記一貫性管理のレベルを判定する判定工程と、前記判定工程で第1レベルであると判定された場合に、read−onlyのトランザクションまたは更新を含むトランザクションのいずれであっても、厳格な一貫性管理方法を用いて一貫性管理を行い、第2のサイトから複数の第1のサイトへの更新伝播を即時行う第1の一貫性管理工程と、前記判定工程で第2レベルであると判定された場合に、read−onlyのトランザクションは緩和された一貫性管理方法を用いて一貫性管理を行い、更新を含むトランザクションは厳格な一貫性管理方法を用いて一貫性管理を行い、第2のサイトから複数の第1のサイトへの更新伝播を緊急度に応じて遅延させて行う第2の一貫性管理工程と、前記判定工程で第3レベルであると判定された場合に、read−onlyのトランザクションまたは更新を含むトランザクションのいずれであっても、弱い一貫性管理方法を用いて一貫性管理を行い、第2のサイトから複数の第1のサイトへの更新伝播を緊急度に応じて遅延させて行う第3の一貫性管理工程とを含むことにより、トランザクションの種類に応じて最適なレベルの一貫性管理を行うことができるため、分散型データベースシステムの利便性の向上を図ることができる。
【0161】
また、本発明の分散型データベースシステムの一貫性管理方法(請求項)によれば、請求項に記載の分散型データベースシステムの一貫性管理方法において、第2および第3の一貫性管理工程における更新伝播の遅延について、第2のサイトにおいて予め設定されている更新伝播条件が満足された場合に更新伝播を行うこととしたことにより、更新が起こる毎に更新伝播を行う必要をなくすことができるため、データの一貫性保持のコストを削減することができる。
【0162】
また、本発明の分散型データベースシステムの一貫性管理方法(請求項)によれば、請求項1または2に記載の分散がデータベースシステムの一貫性管理方法において、第2および/または第3の一貫性管理工程における更新伝播の遅延とは、第1のサイトにおいてトランザクション毎に更新伝播を行うタイミングを定めた更新伝播条件が設定され、第2のサイトにおいて更新伝播条件を満足するように複数の第1のサイトへの更新伝播を行うこととしたため、ユーザの所望の更新伝播条件を設定することができる。したがって、ユーザの所望の更新伝播条件を設定することができるため、更新伝播がいつ行われるかを容易に予測することができ、分散型データベースシステムの利便性のさらなる向上を図ることができる。
【0163】
また、本発明の分散型データベースシステムの一貫性管理方法(請求項)によれば、請求項に記載の分散型データベースシステムの一貫性管理方法において、第2および/または第3の一貫性管理工程が、少なくとも通信回線および放送波を用いて第2のサイトから複数の第1のサイトへの更新伝播を行うことができ、更新伝播条件が、通信回線および放送波のいずれを用いて更新伝播を行うかについての指定を含むことにより、更新伝播条件に応じて適切な方法で更新伝播を行うことができるため、分散型データベースシステムの利便性の向上を図ることができる。すなわち、緊急に更新伝播を行う必要がある場合にはコストが高くても放送波を用いて更新伝播を行うことにし、時間的に余裕がある場合にはコストを抑えて通信回線を用いて更新伝播を行うという選択を行うことができる。
【0164】
また、本発明の分散型データベースシステムの一貫性管理方法(請求項)によれば、請求項1〜4のいずれか一つに記載の分散型データベースシステムの一貫性管理方法において、判定工程が、一貫性管理のレベルを判定することに加えて、データの新規登録か否かを判定し、新規登録であると判定した場合に、設定されているレベルに関係なく、第3レベルと判定するため、データを新規登録する際の処理効率を向上させることができる。
【0165】
さらに、本発明のコンピュータ読み取り可能な記録媒体(請求項)によれば、請求項1〜5のいずれか一つに記載の分散型データベースシステムの一貫性管理方法の各工程をコンピュータに実行させるためのプログラムを記録したため、このプログラムをコンピュータに実行させることにより、分散型データベースシステムの一貫性管理のレベルを複数段階に分け、トランザクションの種類に応じて異なる一貫性管理を行うことができ、分散型データベースシステムの利便性の向上を図ることができる。
【図面の簡単な説明】
【図1】集中管理または分散管理と、強い一貫性管理または弱い一貫性管理との組み合わせによって、分散型データベースシステムを構築した場合の長所および短所が変化することを示した説明図である。
【図2】本発明の実施の形態1に係る分散型データベースシステムの一貫性管理方法を実現するための分散型データベースシステムの概念構成図である。
【図3】本発明の実施の形態1に係る分散型データベースシステムの一貫性管理方法において、(a)は一貫性管理のレベルを設定する手順を、(b)は(a)に示すようにして設定した一貫性管理のレベルに基づいて一貫性管理方法を実行する手順を示すフローチャートである。
【図4】本発明の実施の形態1に係る分散型データベースシステムの一貫性管理方法において、各サイトから主サイトに送信されるREQUESTメッセージの説明図である。
【図5】本発明の実施の形態1に係る分散型データベースシステムの一貫性管理方法において、主サイトから各サイトに送信されるコミットメッセージの説明図である。
【図6】本発明の実施の形態1に係る分散型データベースシステムの一貫性管理方法において、主サイトから各サイトに送信されるアボートメッセージの説明図である。
【図7】本発明の実施の形態1に係る分散型データベースシステムの一貫性管理方法において、(a)は差異限定制約条件を設定する手順を、(b)は(a)に示すようにして設定した差異限定制約条件に基づいて更新伝播を行う手順を示すフローチャートである。
【図8】本発明の実施の形態1に係る分散型データベースシステムの一貫性管理方法において、一貫性管理のレベルA〜Cの特徴をまとめた説明図である。
【図9】本発明の実施の形態2に係る分散型データベースシステムの一貫性管理方法において、(a)は一貫性管理のレベルおよび新規登録トランザクションを設定する手順を、(b)は(a)に示すようにして設定した一貫性管理のレベルおよび新規登録トランザクションの設定に基づいて一貫性管理方法および新規登録を実行する手順を示すフローチャートである。
【図10】本発明の実施の形態3に係る分散型データベースシステムの一貫性管理方法を実現するための分散型データベースシステムの概念構成図である。
【図11】本発明の実施の形態3に係る分散型データベースシステムの一貫性管理方法において、更新伝播タイミング設定処理を示すフローチャートである。
【図12】本発明の実施の形態3に係る分散型データベースシステムの一貫性管理方法において、更新伝播タイミングをサイト側で設定する場合に、リクエストメッセージに添付されるデータを示す説明図である。
【図13】本発明の実施の形態3に係る分散型データベースシステムの一貫性管理方法において、主サイトによる更新伝播管理処理を示すフローチャートである。
【図14】本発明の実施の形態3に係る分散型データベースシステムの一貫性管理方法において、主サイトによって管理される更新伝播管理情報の一例を示す説明図である。
【符号の説明】
DBSP 主サイト
DBS1 ,DBS2 ,DBS3 ,・・・,DBSn サイト
1000 衛星
1001a〜1001e アンテナ
1002 通信回線[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a consistency management method for replicated data in a distributed database system, and more particularly, to divide a consistency management level into a plurality of stages and perform different consistency management depending on the type of transaction. The present invention relates to a distributed database system consistency management method for improving the convenience of a distributed database system, and a computer-readable recording medium storing a program for causing a computer to execute each step of the method. .
[0002]
[Prior art]
In a distributed database system, replicated data of the same data is distributed to a plurality of sites, and a plurality of transactions are executed in parallel. How to maintain consistency is an important issue.
[0003]
As an example of a consistency management method in a distributed database system, there is a method called strong consistency management for performing an operation of serializing data changes. According to this method, although the serialization is guaranteed, the parallelism of the operation is reduced, and the cost of consistency management is increased. There is an advantage that no contradiction occurs. This strong consistency management is often applied to bank OLTP (On-Line Transaction Processing) and the like.
[0004]
As another example of the consistency management method, there is a method called weak consistency management that recognizes that inconsistency occurs between replicated data. In this weak consistency management, update propagation is performed by another transaction instead of guaranteeing the consistency of the entire system in one transaction. Although this method has the disadvantage that inconsistencies may occur between replicated data, the inconsistencies may not be a problem depending on the applied application, and the cost required for maintaining consistency can be reduced. There is an advantage that you can do it. This weak consistency management is often applied to stable systems with little data updates.
[0005]
Various studies have been made on the weak consistency management method. When roughly classified, (1) a multi-version control method, (2) a difference-limited control method (Bounded Divergence Control), and (3) ) It can be classified into a semantic-based control. Therefore, it is necessary to determine what weak consistency management method should be used in consideration of the size and data content of the distributed database system.
[0006]
[Problems to be solved by the invention]
However, in the conventional method of managing the consistency of a distributed database system, only one of the above-described strong consistency management and weak consistency management can be used. There was a problem. This problem is based on the demand that it is more convenient to be able to use strong consistency management and weak consistency management for each type of transaction according to the size and data content of the distributed database system. .
[0007]
Also, in the conventional consistency management method of a distributed database system that adopts weak consistency management, instead of guaranteeing the consistency of the entire system in one transaction, update propagation is performed in another transaction. However, there is a problem that the user cannot recognize when the update propagation is performed. That is, the timing for performing update propagation depends on the system, and it has not been possible to perform update propagation at the timing desired by the user.
[0008]
The present invention has been made in view of the above, and by dividing the level of consistency management of a distributed database system into a plurality of stages so that different consistency management can be performed depending on the type of transaction. A first object is to improve the convenience of a distributed database system.
[0009]
The present invention has been made in view of the above, and aims to further improve the convenience of a distributed database system by enabling the timing of update propagation to be set when weak consistency management is employed. This is a second object.
[0010]
[Means for Solving the Problems]
To achieve the above object, the consistency management method for a distributed database system according to claim 1, wherein the first site having replicated data for an arbitrary object and the consistency of replicated data at the plurality of first sites are provided. And a second site that centrally manages the replicated data. Transactions that include lead or update processing A consistency level setting step of setting any of a first level, a second level, and a third level representing a level of consistency management; and, when a transaction occurs in the system, Set in the transaction that occurred A determining step of determining the level of the coherence management; and strict consistency of the read-only transaction or the transaction including the update when the level is determined to be the first level in the determining step. A first consistency management step of performing consistency management using the management method and immediately transmitting updates from the second site to the plurality of first sites; and the determination step determines that the level is the second level. In this case, the read-only transaction performs consistency management using the relaxed consistency management method, and the transaction including the update performs consistency management using the strict consistency management method. A second consistency management step of delaying update propagation from the first to a plurality of first sites in accordance with the degree of urgency, and a case where the third step is determined in the determination step , Read-only transaction or transaction including update, the consistency management is performed using a weak consistency management method, and the update propagation from the second site to the plurality of first sites is urgent. And a third consistency management step performed with a delay according to
[0011]
Claims 2 Management method for distributed database system 1 In the consistency management method for a distributed database system according to the item 2, when update propagation conditions set in advance at the second site are satisfied with respect to update propagation delay in the second and third consistency management processes Update propagation.
[0012]
Claims 3 Management method for distributed database system 1 or 2 In the consistency management method for a database system according to the above, the update propagation delay in the second and / or third consistency management step is a timing at which the first site performs update propagation for each transaction. Is set, and the update propagation is performed to a plurality of first sites so that the second site satisfies the update propagation condition.
[0013]
Claims 4 Management method for distributed database system 3 2. The consistency management method for a distributed database system according to claim 1, wherein the second and / or third consistency management step includes: at least a communication line and a broadcast wave from the second site to the plurality of first sites. , And the update propagation condition includes a designation as to which of the communication line and the broadcast wave is used to perform the update propagation.
[0014]
Claims 5 Management method for distributed database system 1-4 In the consistency management method for a distributed database system according to any one of the above, in addition to determining the level of the consistency management, the determination step determines whether or not new registration of data, When it is determined that the registration is a new registration, the third level is determined regardless of the set level.
[0015]
Claims 6 The computer-readable recording medium according to claim 1, 5 And a program for causing a computer to execute each step of the consistency management method for a distributed database system according to any one of the above.
[0016]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, an embodiment of a consistency management method of a distributed database system according to the present invention and a computer-readable recording medium recording a program for causing a computer to execute each step of the method will be described with reference to the accompanying drawings. This will be described in detail.
[0017]
[Embodiment 1]
The consistency management method for a distributed database system according to the first embodiment is assumed to be applied to a distributed database system in which sites having replicated data exist at very many points.
[0018]
Here, prior to describing the consistency management method of the distributed database system according to the first embodiment, two conditions to be considered for constructing the distributed database system will be described.
[0019]
First, there is a site that can update the replicated data existing in the system, and there are a centralized system and a distributed system. In the centralized system, multiple sites in a distributed database system are classified into a main site and a site other than the main site, and only the main site can update the replicated data existing in the system, and the other sites perform the update. To make it impossible. On the other hand, the distribution method allows any site to update the replicated data in the system (Anysite Writable), and the updating site coordinates with all the replicated data.
[0020]
The second is whether or not to recognize temporary data inconsistency, which includes the strong consistency management and the weak consistency management described in the related art. Strong consistency management does not recognize inconsistency between replicated data existing in the system, and guarantees consistency between all replicated data in one transaction. For example, a two-phase commit protocol corresponds to this method. On the other hand, weak consistency management temporarily recognizes inconsistencies between replicated data existing in the system by considering the application in detail. In this method, consistency of all replicated data in one transaction is not guaranteed, and update propagation is performed in another transaction.
[0021]
FIG. 1 is an explanatory diagram showing that the merits and demerits of a distributed database system changed by a combination of centralized management or distributed management and strong or weak consistency management. In the consistency management method of the distributed database system according to the first embodiment, a protocol is simplified so that strong consistency management and weak consistency management can be set according to the type of transaction as described later. A centralized management system will be adopted.
[0022]
FIG. 2 is a conceptual configuration diagram of a distributed database system for realizing the consistency management method of the distributed database system according to the first embodiment. The distributed database system shown in FIG. 2 includes a plurality of sites, and the plurality of sites have site DBSs each having duplicate data generated from an arbitrary object. 1 , Site DBS Two , Site DBS Three , ..., site DBS n And the main site DBS that centrally manages the consistency of replicated data P And is composed of In the following description, the site DBS 1 , Site DBS Two , Site DBS Three , ..., site DBS n Are collectively described as site DBS.
[0023]
Here, the main site DBS P The information managed by the system includes, for each object with respect to the copy data existing in the system, a target object ID (for specifying which object is the copy data, and the copy data held by each site DBS is also included). Common object), the latest value of the object, the last update time stamp, the last update site ID, the last update transaction ID, and the like. On the other hand, each site DBS does not have to have duplicate data of all objects existing in the system. For master data of each object, refer to the main site DBS P May be managed centrally (main site DBS P May be regarded as master data), and may be managed for each site DBS.
[0024]
FIG. 2 shows the main site DBS P Although only the state in which the site DBS is provided below is shown, a plurality of site DBS may be further provided below each site DBS to form a hierarchical structure. In such a case, the upper site DBS can be operated as the main site of the lower site DBS.
[0025]
In the consistency management method of the distributed database system according to the first embodiment, levels A to C are prepared as consistency management levels, and different levels are set according to the types of transactions.
[0026]
Level A (corresponding to the first level of the present invention) performs a consistency management of the replicated data using a strict consistency management method, regardless of whether the transaction is a read-only transaction or a transaction including an update. Main site DBS P The update is immediately propagated to each site DBS.
[0027]
In other words, level A performs consistency management of replicated data by executing up to update propagation to each site DBS in one transaction, and guarantees the serializability of transactions. .
[0028]
In level B (corresponding to the second level of the present invention), read-only transactions perform consistency management of replicated data using a relaxed consistency management method, and transactions that include updates are strictly controlled. Maintains the consistency of replicated data using a P Update propagation from the site to each site DBS.
[0029]
At the level B, when performing update processing of certain replicated data, it is divided into a plurality of transactions and the main site DBS P Is transmitted to each site DBS. When data is accessed, the possibility of one copy serialization is guaranteed (PA Bernstein, V. Hadzilacos, and N. Goodman: Concurrency Control and Recovery in Database Systems, Addison-Wesley, 87). When one copy serialization is possible, when data is updated, the latest version is searched for from a plurality of duplicate data for the same data, and processing is performed so that update processing for the same data does not conflict. Since the data may be slightly older, the local data is read as it is.
[0030]
Further, in the level C (corresponding to the third level of the present invention), whether the transaction is a read-only transaction or a transaction including an update, the consistency management is performed using a weak consistency management method, and the main site is managed. DBS P Update propagation from the site to each site DBS.
[0031]
Level C is for recognizing temporary degradation of consistency between replicated data and enabling updating of replicated data for each site DBS. The update result becomes multiple transactions and the main site DBS P To each site DBS. In this case, there is a problem of a solution in a case where update conflict (collision) of duplicate data with respect to the same data is detected. At level C, as described later, a process of detecting update conflict is performed after committing, so that the normal method cannot be aborted. The case where the update conflict occurs will be described later.
[0032]
Note that the above-described levels A to C are set according to the type of transaction including read-only or update, as described later.
[0033]
Next, the consistency management method of the distributed database system according to the first embodiment will be specifically described. FIG. 3A shows a procedure for setting a consistency management level, and FIG. 3B shows a procedure for executing a consistency management method based on the consistency management level set as shown in FIG. 3A. It is a flowchart which shows a procedure. Here, after an outline of the consistency management procedure is described with reference to FIGS. 3A and 3B, a consistency management method of levels A to C will be specifically described.
[0034]
(Outline of consistency management procedure)
First, as shown in FIG. 3A, the level of consistency management is set in advance in accordance with the type of transaction occurring in the distributed database system in consideration of the scale and data content of the distributed database system (S300: book). This corresponds to the step of setting the consistency level of the invention). That is, levels A to C are set for each type of transaction. The level of consistency management can be set when setting up the distributed database system, and can also be set when a transaction occurs.
[0035]
After setting the levels A to C in step S300 in FIG. 3A, as shown in FIG. 3B, when a transaction occurs in the distributed database system (S301), the transaction is set to the generated transaction. A consistency management level determination process is executed (S302: corresponds to the determination step of the present invention).
[0036]
Then, based on the result of the determination processing in step S302, it is determined whether the consistency management level set for the generated transaction is level A, level B, or level C (S303: determination step of the present invention). Corresponds to). If it is determined in step S303 that the level is level A, the consistency management method of level A is executed (S304: corresponds to the first consistency management step of the present invention), and the level is determined to be level B. In this case, the level B consistency management method is executed (S305: corresponds to the second consistency management step of the present invention). Further, when it is determined that the level is C, the consistency of level C is determined. The management method is executed (S306: corresponds to the third consistency management step of the present invention).
[0037]
(Level A consistency management method)
Next, with respect to the consistency management method based on level A, an outline of the strong consistency management method will be described, and then the strong consistency management method based on level A according to the first embodiment will be specifically described.
[0038]
There are various types of strong consistency management methods, such as two-phase lock, optimistic two-phase lock, optimistic method based on global time stamp, and basic time stamp ordering. When updating, serialization becomes possible. In addition, there is a paper stating that “optimistic two-phase lock is most suitable in a completely replicated system” (MJ Carey and M. Liveny: “Conflict detection tradeoffs for replicated data,” ACM TODS, Vol. 16, No. 4, pp. 703-746, Dec. 1991: This is a representative paper whose performance was evaluated by simulation).
[0039]
Among the strong consistency management methods described above, in the optimistic control method, update results of duplicate data are stored only in the private area (work area) without locking until commit time, and conflicts between transactions are only made at commit time. Find out if there was.
[0040]
Here, an example of a typical process of the optimistic two-phase locking method in the case where a plurality of replicated data for a certain data exists in the system is shown below (JDCS95 Jing algorithm).
(1) For read and write, Rlock (lock in read mode) all replicated data X0, X1,..., Xn (Rlock is used to indicate that a transaction uses replicated data) Is).
(2) At the end of the transaction, the written copy data is Wlocked (locked in the write mode). If Wlock is successful, commit the transaction; otherwise, abort.
(3) Release all locks.
[0041]
In the optimistic two-phase lock method, there is a problem in that all sites DBS must be locked in the confirmation phase. That is, since it is actually difficult to lock all the site DBSs, it can be said that the optimistic two-phase locking method is vulnerable to a failure.
[0042]
The reason will be described in comparison with a two-phase lock system based on centralized management. In the case of the two-phase locking method based on centralized management, when a transaction wants to read, local data is read after Rlock is applied to master data. Similarly, in the case of “write”, Wlock is applied to the master data, and then all replicated data is written. Therefore, since only the master data needs to be locked, the load can be reduced. However, in the case of the optimistic two-phase lock method, if all sites cannot write data, it is necessary to abort, so that it is vulnerable to a failure.
[0043]
In addition, the following two methods are conceivable in order to continue processing even if some sites are down (cannot participate).
[0044]
The first scheme is a weighted voting scheme (as proposed by Gifford). In the weighted voting method, if a certain number of sites that satisfy the following conditions participate, it is guaranteed that the latest version value is always included in the number.
[0045]
Read-quorum + Write-quorum> n
Write-quorum + Write-quorum> n
Here, n represents the number of duplicate data.
[0046]
The second method is a time-stamp-based optimistic method based on centralized management (PTO: Primary-based Timestamp Optimistic).
Control). Since the PTO method is a centralized management method, a site that is down can be ignored.
[0047]
Specifically, in the centralized management method, the latest value of the replicated data whose update has been approved is stored in the main site DBS. P Is held. Therefore, when the consistency check is performed in the validation phase of the optimistic control method, the main site DBS P , And there is no need to go to other replicated data for Wlock. The control in the case where the disconnected site is reconnected may be the same. In a transaction that accesses a plurality of types of copy data in the PTO method, execution is started after the copy is created at the local site.
[0048]
When it is assumed that the consistency management method of the distributed database system according to the first embodiment is applied to a distributed database system that spans multiple points, the PTO method is considered to be superior to the weighted voting method. Can be Because, in the case of the PTO method, when checking consistency, the main site DBS P The main site DBS because you only need to contact P This is because the communication cost can be reduced as long as the communication is not down.
[0049]
Therefore, in the consistency management method of the distributed database system according to the first embodiment, the PTO method is adopted as the level A consistency management method, and the level A consistency management method will be specifically described below. I do. Here, site DBS 1 , A transaction T including a read-only or an update other than read-only occurs.
[0050]
In the following description, it is assumed that there are n pieces of duplicate data for the object O, and 1 , ..., O n And the main site DBS P The copy data of the object O of 0 It expresses. A time stamp representing the last updated time of the object O is represented by t (O), and the last updated time stamp of the object O held by the transaction T is represented by t (O, T).
[0051]
Site DBS 1 Performs a process of determining the consistency management level set for the transaction T when the transaction T occurs. When the generated transaction T is at level A, the level A consistency management method is executed.
[0052]
(1) For transactions that include updates
[1] Readout phase
Site DBS 1 Represents local data, that is, duplicate data O i To access the duplicate data O i To the private area (work area). Then, the duplicate data O read to the private area i Are read and written. Duplicate data O i Is read to the private area, the duplicate data O i A time stamp t (O i ) In the transaction T i Set to the last update timestamp of i , T).
[0053]
[2] Confirmation phase
Site DBS 1 Is the main site DBS P Send a REQUEST message containing a request for a level A consistency management method to FIG. 4 is an explanatory diagram showing a REQUEST message. The data shown in FIG. 4 is set in the REQUEST message, and the main site DBS P Sent to. The REQUEST message includes a site ID of the site DBS that is the message transmission source, a transaction ID, and an operation (read or write), a target object ID, and a time stamp t () for each copy data Oi accessed by the transaction T. Oi, T) and the updated value are set.
[0054]
Main site DBS P Receives the REQUEST message, determines that the level A is set in the transaction T, and inputs the received REQUEST message to the queue. REQUEST messages entered in the queue are processed in the order entered.
[0055]
Here, the main site DBS P Is the site DBS 1 Data O accessed by i For all of
(Equation 1)
Figure 0003563591
Is determined within a critical area.
[0056]
If it is determined that the above conditions are satisfied, the site DBS 1 Data O updated in i Data O corresponding to 0 Is updated using the updated value in the REQUEST message (the updated value is retained), and the time stamp is set to t (O 0 ) = Clock (the time stamp of the current time), and then the commit message shown in FIG. 1 , Site DBS Two , Site DBS Three , ..., site DBS n : Sent to the site DBS having the copy data corresponding to the updated copy data Oi. This commit message is generated based on the REQUEST message, and the site ID and the transaction ID of the site DBS that is the transmission source of the REQUEST message, and further, for each copy data Oi, the target object ID and the time stamp t (O 0 ) And the updated value are set.
[0057]
In other words, in the case of a transaction that includes an update, P Is the site DBS within that transaction 1 , Site DBS Two , Site DBS Three , ..., site DBS n Of the update information is propagated to all of. However, unlike the two-phase commit method, the site DBS 1 , Site DBS Two , Site DBS Three , ..., site DBS n No reply is required. That is, even if there is a down site DBS, the process can be ignored and ignored.
[0058]
When the down site DBS is restored, the site DBS becomes the main site DBS. P , The latest update state can be known. After restoration, the main site DBS P Can be inquired about the latest update status.
[0059]
On the other hand, if it is determined that the above condition is not satisfied, the abort message shown in FIG. 1 Send to This abort message is generated based on the REQUEST message, and the site ID and the transaction ID of the site DBS that is the transmission source of the REQUEST message, and further, for each copy data Oi, the target object ID and the time stamp t (O 0 ) And the current value O 0 Is set.
[0060]
[3] Write phase
Site DBS 1 , Site DBS Two , Site DBS Three , ..., site DBS n When the commit message is received, the updated value contained in the commit message and its value
[0061]
On the other hand, site DBS 1 Receives the abort message, aborts the transaction T, and uses the latest value and the time stamp value included in the abort message to copy data O. i And its timestamp t (O i ) To update.
[0062]
(2) In the case of a read-only transaction
Next, a case of a read-only transaction will be described. Site DBS 1 Represents local data, that is, duplicate data O i To access the duplicate data O i To the private area (work area). Here, the duplicate data O i Is read to the private area, the duplicate data O i Timestamp t (O i ) In the transaction T i And set the time stamp to t (O i , T).
[0063]
Site DBS 1 Is the main site DBS P Send a REQUEST message containing a request for a level A consistency management method to This REQUEST message is the same as that shown in FIG. 4, but since it is a read-only transaction, the updated value is excluded.
[0064]
Main site DBS P Receives the REQUEST message, determines that the level A is set in the transaction T, and inputs the received REQUEST message to the queue. REQUEST messages entered in the queue are processed in order.
[0065]
Main site DBS P Is the site DBS 1 Data O accessed by i about,
(Equation 2)
Figure 0003563591
Is determined within a critical area.
[0066]
If it is determined that the above condition is satisfied, the commit message shown in FIG. 1 Send to However, since the transaction is a read-only transaction, the updated value is excluded. On the other hand, if it is determined that the above condition is not satisfied, the abort message shown in FIG. 1 Send to
[0067]
Site DBS 1 Commits a read-only transaction when it receives a commit message, assuming that strict consistency is maintained. On the other hand, site DBS 1 Aborts a read-only transaction upon receiving an abort message, and uses the latest value and timestamp value included in the abort message to copy data O i And its timestamp t (O i ) To update.
[0068]
(Level B consistency management method)
Next, a consistency management method using level B will be described. At level A, all sites (Site DBS) in one transaction 1 , Site DBS Two , Site DBS Three , ..., site DBS n ), But at level B, the update is propagated in another transaction. In other words, instead of immediately propagating the update, a process of setting various difference limitation conditions (corresponding to the update propagation condition of the present invention) described later and performing update propagation when the condition is satisfied is performed. .
[0069]
Here, site DBS 1 The consistency management method of level B will be specifically described on the assumption that a transaction T including a read-only or update other than read-only occurs.
[0070]
Site DBS 1 Performs a process of determining the consistency management level set for the transaction T when the transaction T occurs. When the generated transaction T is at level B, the level B consistency management method is executed.
[0071]
(1) For transactions that include updates
[1] Readout phase
Site DBS 1 Represents local data, that is, duplicate data O i To access the duplicate data O i To the private area (work area). Then, the duplicate data O read to the private area i Are read and written. Here, the duplicate data O i Is read to the private area, the duplicate data O i A time stamp t (O i ) In the transaction T i Set to the last update timestamp of i , T).
[0072]
[2] Confirmation phase
Site DBS 1 Is the main site DBS P Send a REQUEST message containing a request for a level B consistency management method to This REQUEST message is similar to that shown in FIG.
[0073]
Main site DBS P Receives the REQUEST message, determines that the level B is set in the transaction T, and inputs the received REQUEST message to the queue. REQUEST messages entered in the queue are processed in the order entered.
[0074]
Here, the main site DBS P Is the site DBS 1 Data O accessed by i For all of
(Equation 3)
Figure 0003563591
Is determined within a critical area.
[0075]
If it is determined that the above conditions are satisfied, the site DBS 1 Data O updated in i Data O corresponding to 0 Is updated to the updated value in the REQUEST message (keeping the updated value), and the time stamp is updated to t (O 0 ) = Clock (the timestamp of the current time), and then the commit message shown in FIG. 1 Send to In addition, the main site DBS P Queues update information updated in the above transaction, and when the difference limitation constraint condition is satisfied, the update information is transferred to another site DBS (site DBS) in another transaction. Two , Site DBS Three , ..., site DBS n ) To perform update propagation. In addition, the site DBS that transmitted the REQUEST message (here, the site DBS 1 For), update propagation is not performed to reduce communication costs.
[0076]
On the other hand, if it is determined that the above condition is not satisfied, the abort message shown in FIG. 1 Send to
[0077]
Here, the difference limitation constraint will be described. Examples of the difference limiting constraint condition include the following a) to e).
[0078]
a) A refresh cycle is set, and update propagation is performed for each set cycle.
Main site DBS P Means that all other site DBS (site DBS) Two , Site DBS Three , ..., site DBS n ), The update information is transmitted to perform update propagation. Main site DBS P Queues data update information and sends it out every cycle. Receiving site DBS (site DBS Two , Site DBS Three , ..., site DBS n ) Is sent to the main site DBS P Can be found that is not down.
[0079]
b) Update propagation is performed when the number of update information stored in the queue exceeds a certain number.
For example, if the limit number is 3, update propagation is performed when three pieces of update information are accumulated in the queue.
[0080]
c) A data area serving as a reference for performing update propagation is determined, and when data in the area is updated, update propagation is performed.
For example, in bibliographic information, when two attributes of title and author are updated, update propagation is performed immediately. This is effective when it is necessary to immediately disclose update information. As an attribute of the schema, an immediate update propagation flag is attached to an object or its attribute, and if information that is ON is updated, the update is immediately propagated. However, when setting this condition, it is necessary to set it together with other conditions.
[0081]
d) Set a threshold as a reference for performing update propagation, and perform update propagation when the set threshold is exceeded.
A threshold is set for the degree of data update. For example, an absolute value is set such that the update is propagated when 1/20 or more of the content is updated, or a setting is made such that the update is propagated immediately when the number of times referred to exceeds 100. In the latter case, it is based on the idea that it is better to perform an information march immediately because a popular book or program indicates that many people refer to it.
[0082]
e) Update propagation is performed when the version changes significantly.
In the case of a revised version of the book, etc., if the degree of minor typographical errors is corrected, we will wait for update propagation, but if a revised version with a significant correction is issued, we will immediately propagate the update. That is.
[0083]
Note that the difference limiting constraints of the above a) to e) can be set in combination.
[0084]
Next, an update propagation procedure using the difference limitation constraint condition will be described. FIG. 7A is a flowchart showing a procedure for setting a difference limitation constraint condition. As shown in FIG. 7A, at the time of system setup, the main site DBS is used alone or in combination with the difference limiting constraints shown in the above a) to e). P (S700: corresponds to the update propagation setting step of the present invention).
[0085]
Note that when setting the difference limitation constraint conditions, the main site DBS P May be set by operating the site DBS 1 , Site DBS Two , Site DBS Three , ..., site DBS n You can also set from.
[0086]
Further, the difference limiting constraint condition can be changed later by performing the process of step S700 again, but when the consistency management level is set in step S300 shown in FIG. It is necessary to set such difference limitation constraints.
[0087]
Further, a different limitation restriction condition can be set for each site DBS. For example, site DBS 1 Is updated and propagated under the difference limitation constraint a), and the site DBS Two For the main site DBS to perform update propagation under the difference limitation constraint b). P Can also be set for In this case, the main site DBS P Manages the difference limiting constraint set for each site DBS, and performs update propagation using the difference limiting constraint different for each site.
[0088]
FIG. 7B is a flowchart showing a procedure for performing update propagation based on the difference limiting constraint set as shown in FIG. 7A. Main site DBS P Determines whether or not the difference limitation constraint is satisfied with respect to the update information queued constantly or periodically (S701).
[0089]
If it is determined in step S701 that the difference limitation constraint is satisfied, the update information queued is transmitted to the site DBS. 1 , Site DBS Two , Site DBS Three , ..., site DBS n To perform update propagation processing (S702).
[0090]
[3] Write phase
Site DBS 1 Updates the corresponding copy data using the updated value and the time stamp value included in the commit message when the commit message is received.
[0091]
Site DBS Two , Site DBS Three , ..., site DBS n Is the main site DBS P , The corresponding replicated data is updated using the updated value and its timestamp value. At this time, unlike the two-phase commit method, the site DBS 1 , Site DBS Two , Site DBS Three , ..., site DBS n No reply is required. In other words, even if there is a site that is down, the process can be ignored and ignored.
[0092]
When the down site DBS is restored, the site DBS becomes the main site DBS. P , The latest update state can be known. After restoration, the main site DBS P Can be inquired about the latest update status.
[0093]
On the other hand, site DBS 1 Aborts the transaction when it receives the abort message, and uses the latest value and the time stamp value included in the abort message to copy data O. i And its timestamp t (O i ) To update.
[0094]
(2) In the case of a read-only transaction
In the case of level B, the main site DBS is used to perform update propagation based on the difference limitation constraint condition. P Except for site DBS 1 , Site DBS Two , Site DBS Three , ..., site DBS n Duplicate data may not always be the latest version. There is a difference between level A and level B depending on whether or not to permit it in a read-only transaction.
[0095]
In the case of a read-only transaction at level B, the local site (site DBS 1 , Site DBS Two , Site DBS Three , ..., site DBS n ) Is read as it is to ease the serial possibility check. In other words, a read-only transaction is executed locally without adjustment with another site DBS. Even in this case, one-copy serialization is guaranteed. That is, it can be serialized by thinking that it was read before another update occurred.
[0096]
(Level C consistency management method)
The consistency management method based on Level B employs strict, that is, strong consistency management for transactions including updates. On the other hand, in the consistency management method using the level C, in order to further improve the processing efficiency of the entire system, a transaction including an update is relaxed and weak consistency management is performed.
[0097]
Thus, a level C consistency management method will be described. Here, site DBS 1 , A transaction T including a read-only or an update other than read-only occurs.
[0098]
Site DBS 1 Performs a process of determining the consistency management level set for the transaction T when the transaction T occurs. When the generated transaction T is at level C, the level C consistency management method is executed.
[0099]
(1) For transactions that include updates
[1] Readout phase
Site DBS 1 Represents local data, that is, duplicate data O i To access the duplicate data O i To the private area (work area). Then, the duplicate data O read to the private area i Are read and written. Here, in the level C consistency management method, by adopting weak consistency management, the main site DBS P Site DBS without going through 1 , Site DBS Two , Site DBS Three , ..., site DBS n It is possible to independently update the duplicate data every time. Therefore, site DBS 1 Is the read duplicate data O i And commit the transaction containing the update.
[0100]
[2] Confirmation phase
Site DBS 1 Is the main site DBS at the time of the above commit P Send an approval request message (update log) to. The approval request message is similar to the REQUEST message shown in FIG.
[0101]
Main site DBS P Is the site DBS 1 Approve or reject the approval request message from. The acceptance / rejection determination condition is based on the normal time stamp method described in the PTO method.
[0102]
Here, when determining approval / non-approval, the site DBS 1 If there is no approval request message of another site DBS that conflicts with the approval request message of 1 Updates made in are approved. As a result, the main site DBS P Is updated (the updated value is retained and the time stamp is changed), and the update information is queued as described in level B, and the difference limitation constraint is satisfied. In this case, this update information is stored in the site DBS (site DBS 1 , Site DBS Two , Site DBS Three , ..., site DBS n ) Causes update propagation. Note that the difference limitation constraint conditions are as described for the level B, and thus description thereof is omitted here. Also, as in the case of level B, the site DBS that has transmitted the approval request message (here, the site DBS 1 For), update propagation is not performed to reduce communication costs.
[0103]
On the other hand, for example, site DBS 1 And site DBS Two It is assumed that the approval request message of has conflicted. Specifically, site DBS 1 And site DBS Two And the same duplicate data O i And the duplicate data O i Is updated and an approval request message (update log) arrives at the main site after both transactions are committed. Main site DBS P Approves the update of the site where the approval request message arrived earlier, and does not approve the update of the one that arrived later. Where the site DBS Two Approval request message is site DBS 1 Main site DBS before the approval request message of P Site DBS 1 Will not be approved. In this case, the main site DBS P Is the site DBS 1 Send an abort message to.
[0104]
[3] Write phase
If the update is approved, the site DBS 1 Does not require any processing since the transaction for updating the replicated data has already been committed. On the other hand, the other site DBS updates the copy data based on the update information because the update information is propagated by the difference limitation constraint. At this time, unlike the two-phase commit method, the site DBS 1 , Site DBS Two , Site DBS Three , ..., site DBS n No reply is required. In other words, even if there is a site that is down, the process can be ignored and ignored.
[0105]
When the down site DBS is restored, the site DBS becomes the main site DBS. P , The latest update state can be known. After restoration, the main site DBS P Can be inquired about the latest update status.
[0106]
On the other hand, when an abort message is received, a normal abort cannot be performed because the transaction has already been completed by commit. Therefore, at level C, the updated copy data is recovered by copying the necessary version of the copy data from another site DBS.
[0107]
Here, of the duplicate data in the approval request message, the main site DBS P It is also conceivable that the transaction itself stores data for aborting, and that this data is used to recover updated duplicate data. However, since multimedia data is generally large in size, making copies in a transaction is costly and problematic. Also, in applications where the update frequency is low, there is a low possibility that updates will collide, and it is not efficient to create a copy of data for abort in such applications.
[0108]
Therefore, it is considered that it is more efficient to copy and recover a necessary version of duplicate data from another site DBS from the viewpoint of storage capacity and time required for copying as a process when an abort message is received. I can say.
[0109]
(2) In the case of a read-only transaction
In the case of a read-only transaction at level C, the local site (site DBS 1 , Site DBS Two , Site DBS Three , ..., site DBS n ) Is read to reduce the serial possibility check. In other words, a read-only transaction will be executed locally without adjustment with other sites. Even in this case, one-copy serialization is guaranteed. That is, it can be serialized by thinking that it was read before another update occurred.
[0110]
Here, as an application example of the level C, consider a DB of a search agent (a program that performs a longitudinal search of a plurality of DB sites on behalf of a human). Traditional databases have been designed to store object values permanently. However, when considering an application such as a search agent, if a database is used as its memory, it may be "slightly wrong, if it can be determined that it is wrong. The value should be updated. " In the case where a search site name or the like is stored, even if the site moves, it is only necessary to know that "the site has moved" when accessing the site. In the case where a DB is used instead of human memory, there are many such application examples that “slightly wrong data may be used”.
[0111]
FIG. 8 summarizes the features of the consistency management levels A to C described above.
[0112]
As described above, according to the consistency management method of the distributed database system according to the first embodiment, the levels A to C are provided as the levels of the consistency management of the distributed database system, and the levels A to C are set according to the types of transactions. By performing different consistency management by C, it is possible to improve the convenience in the consistency management of the replicated data.
[0113]
Further, by using the consistency management method of the distributed database system according to the first embodiment, it is possible to execute transactions at different consistency management levels, and to optimize the consistency of replicated data according to the type of transaction. Sex management can be performed.
[0114]
Further, in the case of the level B and the level C, the update propagation is performed when the difference limitation constraint is satisfied, so that it is not necessary to perform the update propagation every time there is an update. The cost of maintaining sex can be reduced.
[0115]
[Embodiment 2]
Next, a consistency management method of the distributed database system according to the second embodiment will be described. For example, in an application such as an electronic library, new bibliographic data is often registered in a lump, and in a university or the like, data of new students or newcomers is often registered in a lump. Since these newly registered transactions can be processed independently without referring to the existing data, there is no problem even if the process of confirming the conflict with other transactions is omitted, and the processing efficiency is rather improved. This is preferable for achieving the desired structure. Therefore, in the consistency management method of the distributed database system according to the second embodiment, in addition to the processing described in the first embodiment, when determining the level of the consistency management, it is determined whether the transaction is a newly registered transaction. If the transaction is a newly registered transaction, the process of confirming the conflict with another transaction is omitted, and the registration process can be performed as it is.
[0116]
By the way, in the optimistic control, it is necessary to perform a process including a reading phase, a confirmation phase, and a writing phase. However, since there is no possibility of conflicting with other transactions in a transaction with only new registration, it is not necessary to check whether the transaction conflicts, and after the reading phase processing is completed, the direct writing phase processing is executed. can do.
[0117]
Therefore, in the consistency management method of the distributed database system according to the second embodiment, a unique transaction level (for example, a new registration processing flag is set) for newly registering data independent of existing data. And no conflict checking is performed for the transaction at that level.
[0118]
The newly registered transaction can be applied to any of the levels A to C described in the first embodiment. However, from the viewpoint of efficiency, it is most excellent to apply to level C where updating can be performed in each site DBS unit. Therefore, in the second embodiment, an outline of the processing will be described on the assumption that this newly registered transaction is applied to level C. 9A shows a procedure for setting a consistency management level and a newly registered transaction, and FIG. 9B shows a procedure for setting the consistency management level and a newly registered transaction set as shown in FIG. 9A. 6 is a flowchart showing a procedure for executing a consistency management method and new registration based on the above.
[0119]
First, as shown in FIG. 9A, a consistency management level is set according to the type of transaction (see Embodiment 1), and a transaction for newly registering data is set as a newly registered transaction. (S900).
[0120]
After setting the consistency management level for a newly registered transaction in step S900 of FIG. 9A, as shown in FIG. 9B, when a transaction occurs in the distributed database system (S901), the generated transaction (S902: Corresponds to the determination step of the present invention).
[0121]
If it is determined in step S902 that the transaction is a newly registered transaction, the transaction is determined to be level C regardless of the set level (S903: corresponds to a determination step of the present invention). Then, the process advances to step S906 to execute the level C consistency management method.
[0122]
In the case where a newly registered transaction is executed at level C, there is no possibility of conflict with a transaction in another site DBS, so that a check for conflict using an approval request message is omitted.
[0123]
As described above, according to the consistency management method of the distributed database system according to the second embodiment, when executing a transaction for newly registering data, a process of checking for a conflict with another transaction is omitted. Therefore, the processing efficiency when newly registering data can be improved.
[0124]
However, some INSERT operations are semantically associated with existing data. For example, there is a transaction in which an average value of two read values is obtained, and INSERT is performed using the average value. In such a case, the transaction is not a newly registered transaction because it is semantically related to the existing data.
[0125]
[Embodiment 3]
In the level B and level C consistency management methods described above, the main site DBS P When the difference limitation constraint condition set in advance is satisfied, the main site DBS P Transmits the update information to each site DBS to perform update propagation (see FIG. 7). In the third embodiment, the main site DBS P In addition to the case where the difference limitation constraint condition set in (1) is satisfied, the timing at which update propagation is performed can be set on the site DBS side where the transaction has occurred in accordance with the content. This is because, depending on the content, some content should be released early or some content may be delayed. For example, information that should be released early, such as typhoon information, should be released within 5 minutes. This is in order to be able to respond to a request to complete update propagation to all site DBSs.
[0126]
FIG. 10 is a conceptual configuration diagram of a distributed database system for realizing the consistency management method of the distributed database system according to Embodiment 3 of the present invention. The distributed database system shown in FIG. 10 has, in addition to the configuration shown in FIG. 2, a main site DBS using a broadcast using a satellite 1000 when performing update propagation. P Can distribute update information to each site DBS. Generally, distributing information using the satellite 1000 or the like is more expensive than, for example, using the Internet, but distributing update information by broadcasting when it is urgent to propagate updates to all the site DBSs. Thereby, there is an advantage that the update information can be delivered to all the site DBS in a short time and at once.
[0127]
In FIG. 10, 1001a to 1001e denote antennas for transmitting or receiving update information using broadcast waves, and 1002 denotes a communication line for transmitting and receiving various types of information already described in the first and second embodiments. Each is shown.
[0128]
FIG. 10 shows an example of a distributed database system capable of exchanging information by broadcasting using the satellite 1000. However, in addition to or instead of this, other types of information that can transmit information such as terrestrial waves are used. May be used.
[0129]
Next, regarding the consistency management method of the distributed database system according to the third embodiment, the site DBS 1 The following describes an example in which a transaction in which a level C consistency management method is set occurs. Although the case of level C is described here, it is clear that the same can be applied to the case of level B. In addition, matters already described in the first and second embodiments will be briefly described.
[0130]
FIG. 11 is a flowchart illustrating the update propagation timing setting process. When updating the copy data, the user of the site DBS1 sets information described below in, for example, an input field prepared in advance (S1101).
[0131]
In step S1101, the urgency, the release designation date and time, the propagation delay allowable date and time, and the propagation method are set. There are the following levels of urgency, for example, and these levels are set in advance by the system builder. Therefore, the user selects a desired level from the set urgency levels and sets the desired level.
[0132]
-Update propagation within 1:10 minutes.
-Urgency 2: Update propagation within 60 minutes.
-Urgency 3: Update propagation within one day.
・ Urgentity level 4: Update propagation within 3 days.
[0133]
The item of the release designation date and time is provided because, for example, there is a request in the news news or the like that the information must not be released until 10 o'clock in the morning. Therefore, the user sets a desired date and time for this item. In addition, when this publication designation date and time is designated, the main site DBS P Performs update propagation on the information on the duplicated data updated after the publication designation date and time has elapsed. In place of this, update propagation may be performed before the elapse of the designated release date and time. Which one to use may be determined when setting an update propagation schedule to be described later (see step S1304 in FIG. 13). However, in the case where update propagation is to be performed before the specified publication date and time has elapsed, it is necessary to establish a method for preventing the updated data from being published before the specified publication date and time has elapsed in each site DBS. Required.
[0134]
In the item of propagation delay allowable date and time, the maximum date and time at which update propagation delay is allowed is set.
[0135]
Further, in the item of the distribution method, it is set which of the communication (using the communication line 1002), the satellite broadcast, the terrestrial broadcast and the like is used for the update propagation.
[0136]
Since the level is C in this case, it is determined whether the transaction is committed or aborted in the site DBS1. 1 Is updated. In the case of the newly registered transaction described in the second embodiment, the process of checking for a conflict with another transaction is omitted.
[0137]
In case of commit, site DBS 1 Sends the approval request message to the main site DBS as described above. P In this case, the data shown as an example in FIGS. 12A and 12B is transmitted to the acknowledgment request message (the same content as the REQUEST message shown in FIG. 4; As well). As a result, the urgency and the like set in step S1101 in FIG. 11 are set in the approval request message as attribute values.
[0138]
Main site DBS P Is the site DBS 1 When an approval request message is received from the other site DBS, it is determined whether or not there is a conflict with the update process performed by another site DBS. When it is determined that there is no conflict, the following update propagation management process is executed. In the case of a newly registered transaction, the conflict check processing is omitted. In addition, the update propagation management process may be executed in parallel with the conflict check process, but if it is determined that the update propagation management process conflicts with the update process of another site, the update propagation management process is terminated halfway. .
[0139]
FIG. 13 shows the main site DBS P 9 is a flowchart showing an update propagation management process according to the embodiment. Main site DBS P Is the site DBS 1 The request source ID (site ID), request date and time, update OID list, urgency, release designation date and time, update delay allowable date and distribution method are copied from the approval request message received from the server (S1301). Site DBS P Measure and set the data size (the size of the data to be sent) (S1302), and generate update propagation management information as shown in FIG. This update propagation management information can be used as data for charging.
[0140]
In step S1302, if the propagation delay allowable date and time is not set in the approval request message,
Arrival date and time of request + allowable time of specified urgency (10 minutes for urgency 1)
Is calculated, and the propagation delay allowable date and time are set.
[0141]
After generating the update propagation management information, the main site DBS P Determines whether the specified urgency is acceptable based on the following criteria (S1303).
[0142]
-When [Request Arrival Date and Time + Specified Urgency Allowed Time]> Propagation Delay Allowed Date and Time
-When [Publication date / time + allowable time of specified urgency]> Propagation delay allowable date / time
-When the value of (data size x number of sending sites) is too large
Here, the number of sending sites is, for example, site DBS 1 Is the number of other site DBSs having duplicate data for the same object as the updated duplicate data (object), and which site DBS corresponds to the sending site is the main site DBS. P Judge.
[0143]
When the value in the update propagation management information satisfies at least one of the above three conditions, the main site DBS P Determines that the specified urgency is not acceptable, generates an unacceptable message, and 1 (Site of requesting site) and requests that only the data shown in FIG. 12 be transmitted again (S1307).
[0144]
And the site DBS 1 When the data shown in FIG. 12 is transmitted as a response to the message from the (request source site) and the data is received (S1308), the main site DBS P Returns to step S1301 to execute the update propagation management process again.
[0145]
On the other hand, if it is determined in step S1303 that the designated urgency is allowable, the main site DBS P Sets a schedule for performing update propagation so that the update information can be delivered to each site DBS before the update delay allowable date and time in the update propagation management information (S1304). For example, main site DBS P Sets a schedule for performing update propagation using the difference limiting constraint described in the first embodiment. As to which of the difference limitation constraints is used, for example, the first criterion is that the update propagation is in time for the propagation delay allowable date and time in the update propagation management information shown in FIG. Is determined as a second criterion. And the main site DBS P Performs scheduling to perform update propagation using the selected difference limitation constraint condition, determines whether or not the propagation delay allowable date and time can be observed, and if it is determined that the propagation delay cannot be observed, performs update propagation earlier. Is performed to perform update propagation again using the difference limitation constraint condition that can be performed. In other words, there are various difference limitation constraints as update delay propagation rules, but difference limitation constraints that may not be able to meet the specified urgency are not adopted.
[0146]
After that, the main site DBS P Executes update propagation according to the schedule set in step S1304 (S1305). The update propagation distributes the update information to each site DBS according to the distribution method set in the update propagation management information. For example, when “Satellite” is set as the distribution method, the update information is distributed to each site DBS by broadcasting using the satellite 1000. When “communication” is set as the distribution method, the update information is distributed to each site DBS via the communication line 1002. When the update information is distributed to each site DBS via the communication line 1002, the site DBS that transmitted the approval request message (here, the site DBS 1 For), distribution of update information is not performed to reduce communication costs.
[0147]
And the main site DBS P Sets the log of the update propagation start date and time and the completion date and time and information on the distribution delay in the update propagation management information (S1306). The information about the distribution delay indicates how long the distribution was delayed from the propagation delay allowable date and time in the update propagation management information,
Propagation completion date-Propagation delay allowable date
Is calculated by If the calculated result is positive, it indicates that update propagation has been performed later than the propagation delay allowable date and the value is set to “delivery delay” in the update propagation management information. On the other hand, if the calculated result is negative, it indicates that the update propagation has been completed before the propagation delay allowable date and time, and if the calculated result is negative, there is no delay in distribution, so “0” is set in the update propagation management information. Set to "Delay of delivery".
[0148]
As described above, according to the consistency management method of the distributed database system according to the third embodiment, the update result can be delivered to each site DBS at a timing suitable for the content of the content. Convenience can be improved.
[0149]
Further, as a method of distributing the update result to each site DBS, a distribution method by broadcasting using the satellite 1000, a distribution method by communication using the communication line 1002, and the like can be selected. The distribution method can be selected, and the convenience of the distributed database system can be improved.
[0150]
Although detailed description is omitted, even in the case of level A, the commit shown in FIG. 4 may be distributed by broadcasting.
[0151]
In the distributed database system according to the first to third embodiments described above, one of the levels A to C is set as the consistency management level for each type of transaction, and the consistency management is performed at the set level. However, depending on how the distributed database system is operated, for example, a system in which only the level C consistency management level can be used or a system in which level A and level C consistency management levels can be used, It is clear that various designs and changes are possible.
[0152]
Further, the consistency management method of the distributed database system according to the first to third embodiments executes a prepared program on a computer according to the procedures of the flowcharts shown in FIGS. 3 to 5 and FIGS. 11 and 13. This is achieved by: This program is recorded on a computer-readable recording medium such as a hard disk, a floppy disk, a CD-ROM, an MO, and a DVD, and can be executed by being read from the recording medium by the computer. Further, this program can be distributed via the recording medium or via a network.
[0153]
[Applicable application fields]
The consistency management method of the distributed database system according to the first to third embodiments described above can be applied to the following application fields. However, the application field to which the consistency management method of the distributed database system of the present invention is applied is not limited to those described below.
[0154]
The consistency management method of the distributed database system according to the present invention includes:
(1) A system that provides multimedia contents and charges for viewing the contents.
(2) Allow time delay for content update,
(3) As a DB (database) constructed in the system, the present invention can be applied to a distributed database system having a content DB, an index information DB (secondary information), a user statistical information DB, and a billing information DB. it can.
[0155]
The characteristics of the DB are considered as follows. First, as a content DB,
(1) The data size is very large, and the data is multimedia BLOB (Binary Large Object),
(2) A large number of duplicated data is required (since the content is multimedia, the size is large and a large number of duplicated data must be generated to reduce the access cost),
(3) The information to be read may be somewhat old,
(4) The reading frequency is high.
(5) Update propagation may be delayed,
That is conceivable.
[0156]
As the index information DB,
(1) A large number of duplicate data is required,
(2) The size of the replicated data is small to medium,
(3) The information to be read may be somewhat old,
(4) The reading frequency is high,
(5) Update propagation may be delayed,
That is conceivable.
[0157]
As the user statistical information DB and the billing information DB,
(1) The number of duplicate data may be small,
(2) The size of the data depends on the system,
(3) The information to be read may be somewhat old,
(4) The reading frequency is low,
(5) Update propagation may be delayed, and propagation to the counting side may be delayed.
That is conceivable. However, even if the user information is lost, it does not matter much, but the billing information is not allowed to be lost or missing during the update.
[0158]
Typical transactions that occur in the above distributed database system include:
(1) Content search by users (high access frequency),
(2) New addition and correction of content by the content provider (update frequency is low),
(3) New addition and correction of index information by the content provider (update frequency is low),
(4) Collection of accounting information (account collection for each user is infrequent, but becomes large because the number of users is enormous), and
(5) Usage statistics information collection (account collection for each user is infrequent, but large because the number of users is enormous),
Can be considered.
[0159]
Examples of systems that satisfy the above conditions include:
(1) Digital library system (contents are books, magazines, CD-ROMs, videos, etc., index information is bibliographic information),
(2) Video on demand (VOD) system (content is video; index information is various attributes of video);
(3) Karaoke system (contents are music information such as MIDI, moving image information, character information of lyrics, etc., and index information is various attributes related to music),
And so on.
[0160]
【The invention's effect】
As described above, according to the consistency management method for a distributed database system of the present invention (claim 1), the consistency of the Transactions that include lead or update processing A consistency level setting step of setting any of a first level, a second level, and a third level representing a level of consistency management; and, when a transaction occurs in the system, Set in the transaction that occurred A determining step of determining the level of the coherence management; and strict consistency of the read-only transaction or the transaction including the update when the level is determined to be the first level in the determining step. A first consistency management step of performing consistency management using the management method and immediately transmitting updates from the second site to the plurality of first sites; and the determination step determines that the level is the second level. In this case, the read-only transaction performs consistency management using the relaxed consistency management method, and the transaction including the update performs consistency management using the strict consistency management method. A second consistency management step of delaying update propagation from the first to a plurality of first sites in accordance with the degree of urgency, and a case where the third step is determined in the determination step , Read-only transaction or a transaction including an update, the consistency management is performed using the weak consistency management method, and the update propagation from the second site to the plurality of first sites is urgent. And the third consistency management step performed with a delay in accordance with the type of the transaction, it is possible to perform the optimal level of consistency management in accordance with the type of transaction, thereby improving the convenience of the distributed database system. Can be planned.
[0161]
Further, a consistency management method for a distributed database system according to the present invention (claim 2 According to claim) 1 In the consistency management method of the distributed database system described in the above, the update propagation delay in the second and third consistency management steps is performed when an update propagation condition set in advance at the second site is satisfied. Since the update propagation is performed, it is not necessary to perform the update propagation every time an update occurs, so that the cost of maintaining data consistency can be reduced.
[0162]
Further, a consistency management method for a distributed database system according to the present invention (claim 3 According to claim) 1 or 2 In the consistency management method of the database system described in the above, the delay of update propagation in the second and / or third consistency management process defines the timing at which update propagation is performed for each transaction at the first site. Since the update propagation condition is set and the update propagation is performed to the plurality of first sites so as to satisfy the update propagation condition at the second site, the update propagation condition desired by the user can be set. Therefore, the update propagation condition desired by the user can be set, so that it is possible to easily predict when the update propagation will be performed, and it is possible to further improve the convenience of the distributed database system.
[0163]
Further, a consistency management method for a distributed database system according to the present invention (claim 4 According to claim) 3 In the consistency management method for a distributed database system according to the item 1, the second and / or third consistency management step includes the step of at least using a communication line and a broadcast wave to transmit from the second site to the plurality of first sites. Update propagation can be performed, and the update propagation condition includes a specification of whether to perform update propagation using a communication line or a broadcast wave, and performs update propagation in an appropriate method according to the update propagation condition. Therefore, the convenience of the distributed database system can be improved. That is, when it is necessary to perform update propagation urgently, the update propagation will be performed using the broadcast wave even if the cost is high, and if there is enough time, the cost is reduced and the update is performed using the communication line. A choice can be made to do the propagation.
[0164]
Further, a consistency management method for a distributed database system according to the present invention (claim 5 According to claim) 1-4 In the consistency management method for a distributed database system according to any one of the above, in addition to determining the level of consistency management, the determination step determines whether or not new registration of data, If it is determined that there is, the third level is determined irrespective of the set level, so that the processing efficiency when newly registering data can be improved.
[0165]
Further, the computer-readable recording medium of the present invention (claim 6 According to claim) 1-5 Recording a program for causing a computer to execute each step of the method for consistency management of a distributed database system described in any one of the above, by causing the computer to execute the program, the consistency management of the distributed database system is performed. Can be divided into a plurality of levels, and different consistency management can be performed according to the type of transaction, and the convenience of the distributed database system can be improved.
[Brief description of the drawings]
FIG. 1 is an explanatory diagram showing that advantages and disadvantages when a distributed database system is constructed are changed by a combination of centralized management or distributed management and strong consistency management or weak consistency management.
FIG. 2 is a conceptual configuration diagram of the distributed database system for realizing the consistency management method of the distributed database system according to the first embodiment of the present invention.
FIG. 3A shows a procedure for setting a consistency management level in the consistency management method for a distributed database system according to the first embodiment of the present invention, and FIG. 9 is a flowchart showing a procedure for executing a consistency management method based on a consistency management level set in the above manner.
FIG. 4 is an explanatory diagram of a REQUEST message transmitted from each site to a main site in the consistency management method of the distributed database system according to the first embodiment of the present invention.
FIG. 5 is an explanatory diagram of a commit message transmitted from the main site to each site in the consistency management method for the distributed database system according to the first embodiment of the present invention.
FIG. 6 is an explanatory diagram of an abort message transmitted from the main site to each site in the consistency management method of the distributed database system according to the first embodiment of the present invention.
FIG. 7A shows a procedure for setting a difference limiting constraint condition in the consistency management method for a distributed database system according to the first embodiment of the present invention, and FIG. 9 is a flowchart illustrating a procedure for performing update propagation based on a set difference limitation constraint condition.
FIG. 8 is an explanatory diagram summarizing features of consistency management levels A to C in the consistency management method of the distributed database system according to the first embodiment of the present invention.
FIG. 9 (a) shows a procedure for setting a consistency management level and a newly registered transaction, and FIG. 9 (b) shows a procedure (a) in the consistency management method of the distributed database system according to the second embodiment of the present invention. 7 is a flowchart showing a consistency management method and a procedure for executing a new registration based on a consistency management level and a newly registered transaction set as shown in FIG.
FIG. 10 is a conceptual configuration diagram of a distributed database system for realizing a distributed database system consistency management method according to a third embodiment of the present invention.
FIG. 11 is a flowchart showing an update propagation timing setting process in the consistency management method of the distributed database system according to the third embodiment of the present invention.
FIG. 12 is an explanatory diagram showing data attached to a request message when update propagation timing is set on the site side in the consistency management method of the distributed database system according to the third embodiment of the present invention.
FIG. 13 is a flowchart illustrating an update propagation management process performed by a main site in a consistency management method for a distributed database system according to Embodiment 3 of the present invention.
FIG. 14 is an explanatory diagram showing an example of update propagation management information managed by a main site in a consistency management method for a distributed database system according to Embodiment 3 of the present invention.
[Explanation of symbols]
DBS P Primary site
DBS 1 , DBS Two , DBS Three , ..., DBS n site
1000 satellites
1001a-1001e antenna
1002 communication line

Claims (6)

任意のオブジェクトに対する複製データをそれぞれ有する第1のサイトと、前記複数の第1のサイトにおける複製データの一貫性を集中管理する第2のサイトと、を備えた分散型データベースシステムの一貫性管理方法において、
予め前記複製データに対するリードまたは更新の処理を含むトランザクションに、一貫性管理のレベルを表す第1レベル,第2レベルおよび第3レベルのいずれかを設定する一貫性レベル設定工程と、
システム内においてトランザクションが発生した場合に、該発生したトランザクションに設定されている前記一貫性管理のレベルを判定する判定工程と、
前記判定工程で第1レベルであると判定された場合に、read−onlyのトランザクションまたは更新を含むトランザクションのいずれであっても、厳格な一貫性管理方法を用いて一貫性管理を行い、第2のサイトから複数の第1のサイトへの更新伝播を即時行う第1の一貫性管理工程と、
前記判定工程で第2レベルであると判定された場合に、read−onlyのトランザクションは緩和された一貫性管理方法を用いて一貫性管理を行い、更新を含むトランザクションは厳格な一貫性管理方法を用いて一貫性管理を行い、第2のサイトから複数の第1のサイトへの更新伝播を緊急度に応じて遅延させて行う第2の一貫性管理工程と、
前記判定工程で第3レベルであると判定された場合に、read−onlyのトランザクションまたは更新を含むトランザクションのいずれであっても、弱い一貫性管理方法を用いて一貫性管理を行い、第2のサイトから複数の第1のサイトへの更新伝播を緊急度に応じて遅延させて行う第3の一貫性管理工程と、
を含むことを特徴とする分散型データベースシステムの一貫性管理方法。
A consistency management method for a distributed database system, comprising: a first site having replicated data for an arbitrary object; and a second site for centrally managing consistency of replicated data at the plurality of first sites. At
A consistency level setting step of previously setting any one of a first level, a second level, and a third level representing a consistency management level to a transaction including a read or update process for the duplicated data;
When a transaction occurs in the system, a determining step of determining the level of the consistency management set for the generated transaction ;
If it is determined in the determination step that the level is the first level, the consistency management is performed using a strict consistency management method, regardless of whether the transaction is a read-only transaction or a transaction including an update, and the second level is performed. A first consistency management step for immediately propagating updates from a site to a plurality of first sites;
If it is determined in the determination step that the transaction is at the second level, the read-only transaction performs the consistency management using the relaxed consistency management method, and the transaction including the update uses the strict consistency management method. A second consistency management step of performing consistency management using the second site and delaying update propagation from the second site to the plurality of first sites according to the degree of urgency;
If it is determined in the determination step that the level is the third level, consistency management is performed using a weak consistency management method, regardless of whether the transaction is a read-only transaction or a transaction including an update, and the second level is performed. A third consistency management step of delaying the update propagation from the site to the plurality of first sites according to the urgency;
A consistency management method for a distributed database system, comprising:
前記第2および第3の一貫性管理工程における更新伝播の遅延とは、第2のサイトにおいて予め設定されている更新伝播条件が満足された場合に更新伝播を行うことであることを特徴とする請求項に記載の分散型データベースシステムの一貫性管理方法。The delay of update propagation in the second and third consistency management processes is characterized in that update propagation is performed when an update propagation condition set in advance at the second site is satisfied. The consistency management method for a distributed database system according to claim 1 . 前記第2および/または第3の一貫性管理工程における更新伝播の遅延とは、前記第1のサイトにおいて前記トランザクション毎に更新伝播を行うタイミングを定めた更新伝播条件が設定され、第2のサイトにおいて前記更新伝播条件を満足するように複数の第1のサイトへの更新伝播を行うことであることを特徴とする請求項1または2に記載の分散がデータベースシステムの一貫性管理方法。The update propagation delay in the second and / or third consistency management step is defined as an update propagation condition that defines a timing at which the first site performs update propagation for each transaction. 3. The method according to claim 1, wherein the update propagation is performed to a plurality of first sites so as to satisfy the update propagation condition. 前記第2および/または第3の一貫性管理工程は、少なくとも通信回線および放送波を用いて第2のサイトから複数の第1のサイトへの更新伝播を行うことができ、
前記更新伝播条件は、前記通信回線および放送波のいずれを用いて更新伝播を行うかについての指定を含むことを特徴とする請求項に記載の分散型データベースシステムの一貫性管理方法。
The second and / or third consistency management step can perform update propagation from the second site to the plurality of first sites using at least a communication line and a broadcast wave;
4. The consistency management method for a distributed database system according to claim 3 , wherein the update propagation condition includes a designation as to which one of the communication line and the broadcast wave is used to perform the update propagation.
前記判定工程は、前記一貫性管理のレベルを判定することに加えて、データの新規登録か否かを判定し、前記新規登録であると判定した場合に、設定されているレベルに関係なく、前記第3レベルと判定することを特徴とする請求項1〜4のいずれか一つに記載の分散型データベースシステムの一貫性管理方法。The determining step, in addition to determining the level of consistency management, determines whether or not new registration of data, when it is determined that the new registration, regardless of the set level, 5. The consistency management method for a distributed database system according to claim 1 , wherein the third level is determined. 前記請求項1〜5のいずれか一つに記載の分散型データベースシステムの一貫性管理方法の各工程をコンピュータに実行させるためのプログラムを記録したことを特徴とするコンピュータ読み取り可能な記録媒体。A computer-readable recording medium having recorded thereon a program for causing a computer to execute each step of the consistency management method for a distributed database system according to any one of claims 1 to 5 .
JP11230598A 1997-09-29 1998-04-22 Consistency management method for distributed database system and computer-readable recording medium storing program for causing a computer to execute each step of the method Expired - Fee Related JP3563591B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11230598A JP3563591B2 (en) 1997-09-29 1998-04-22 Consistency management method for distributed database system and computer-readable recording medium storing program for causing a computer to execute each step of the method

Applications Claiming Priority (5)

Application Number Priority Date Filing Date Title
JP26464397 1997-09-29
JP9-264643 1997-11-28
JP32821797 1997-11-28
JP9-328217 1997-11-28
JP11230598A JP3563591B2 (en) 1997-09-29 1998-04-22 Consistency management method for distributed database system and computer-readable recording medium storing program for causing a computer to execute each step of the method

Publications (2)

Publication Number Publication Date
JPH11219309A JPH11219309A (en) 1999-08-10
JP3563591B2 true JP3563591B2 (en) 2004-09-08

Family

ID=27312230

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11230598A Expired - Fee Related JP3563591B2 (en) 1997-09-29 1998-04-22 Consistency management method for distributed database system and computer-readable recording medium storing program for causing a computer to execute each step of the method

Country Status (1)

Country Link
JP (1) JP3563591B2 (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6493796B1 (en) * 1999-09-01 2002-12-10 Emc Corporation Method and apparatus for maintaining consistency of data stored in a group of mirroring devices
JP4381655B2 (en) 2002-05-31 2009-12-09 株式会社日立製作所 Storage system, storage device, and information sharing method using the storage device
JP4227399B2 (en) * 2002-11-29 2009-02-18 キヤノン株式会社 Information processing method and apparatus
WO2004077298A1 (en) * 2003-02-28 2004-09-10 Canon Kabushiki Kaisha Information processing method and apparatus
US7299378B2 (en) * 2004-01-15 2007-11-20 Oracle International Corporation Geographically distributed clusters
US7529888B2 (en) * 2004-11-19 2009-05-05 Intel Corporation Software caching with bounded-error delayed update
US20100198789A1 (en) 2007-06-06 2010-08-05 Kunio Kamimura Database contradiction solution method
US8171003B2 (en) 2007-06-06 2012-05-01 Kunio Kamimura Method and apparatus for changing reference of database
JP4923140B2 (en) * 2008-06-04 2012-04-25 株式会社アテナテレコムラボ Database parallel editing method
WO2010032278A1 (en) 2008-09-17 2010-03-25 富士通株式会社 Data update synchronization method and system by two-phase commit
JP5449462B2 (en) * 2012-06-22 2014-03-19 株式会社東芝 Distributed database system and program
JP6292810B2 (en) 2013-10-02 2018-03-14 キヤノン株式会社 Data synchronization method, data synchronization apparatus, and program
JP6475820B2 (en) * 2015-03-30 2019-02-27 株式会社野村総合研究所 Data processing system

Also Published As

Publication number Publication date
JPH11219309A (en) 1999-08-10

Similar Documents

Publication Publication Date Title
CN109977171B (en) Distributed system and method for ensuring transaction consistency and linear consistency
US6938070B2 (en) Conflict resolution for collaborative work system
CN109739935B (en) Data reading method and device, electronic equipment and storage medium
US7103586B2 (en) Collision avoidance in database replication systems
US6792436B1 (en) Method for synchronizing multiple software caches in a memory
Helal et al. Replication techniques in distributed systems
EP1704470B1 (en) Geographically distributed clusters
US7275074B2 (en) Propagating commit times
US7801855B2 (en) Method and apparatus for merging log entries in a database management system
JP3563591B2 (en) Consistency management method for distributed database system and computer-readable recording medium storing program for causing a computer to execute each step of the method
EP1241592A2 (en) Collision avoidance in Bidirectional database replication
US20070226277A1 (en) Data input routing after failure
WO2013019894A1 (en) Systems and methods for asynchronous distributed database management
JP2002528814A (en) Distributed transaction processing system and method
EP4276651A1 (en) Log execution method and apparatus, and computer device and storage medium
CN112162846B (en) Transaction processing method, device and computer readable storage medium
US20230081900A1 (en) Methods and systems for transactional schema changes
US20130006920A1 (en) Record operation mode setting
Adly Management of replicated data in large scale systems
US20230145054A1 (en) Multi-region database systems and methods
US20240045887A1 (en) Systems and methods for controlling replica placement in multi-region databases
Hu Exploiting laziness for improving performance in data replication management
Jolson A Method for Selective Update Propagation in Replicated Databases
Yakovlev A multi-version data model and semantic-based transaction processing protocol
Yakovlev A multi-version concurrency control model for distributed mobile databases

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: 20040601

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040603

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20080611

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20080611

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090611

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20090611

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100611

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110611

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20110611

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20120611

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20130611

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees