JP6043687B2 - Server / client system - Google Patents
Server / client system Download PDFInfo
- Publication number
- JP6043687B2 JP6043687B2 JP2013138615A JP2013138615A JP6043687B2 JP 6043687 B2 JP6043687 B2 JP 6043687B2 JP 2013138615 A JP2013138615 A JP 2013138615A JP 2013138615 A JP2013138615 A JP 2013138615A JP 6043687 B2 JP6043687 B2 JP 6043687B2
- Authority
- JP
- Japan
- Prior art keywords
- server
- state
- master
- database
- asynchronous
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
本発明は、分散データベースの技術に関する。 The present invention relates to a distributed database technology.
マスター状態の1つのサーバと、スレーブ状態の少なくとも1つのサーバとを備える分散データベースシステムがある。マスターサーバの記憶データはスレーブサーバに複製されているため、クライアントは、いずれのサーバにアクセスしても同じデータを参照できる。 There are distributed database systems comprising one server in the master state and at least one server in the slave state. Since the stored data of the master server is replicated to the slave server, the client can refer to the same data regardless of which server is accessed.
このようなシステムにおいて、何らかの原因によりデータ間の同一性が担保できない非同期状態となった場合、非同期状態のスレーブサーバは、自らその状態を検出してクライアントに通知することにより、古いデータが参照されるのを防止している。 In such a system, if for some reason the identity between the data cannot be guaranteed, the slave server in the asynchronous state detects the state itself and notifies the client by referring to the old data. Is prevented.
しかしながら、非同期状態のスレーブサーバが自ら非同期状態を検出するまでに一定の時間を要するため、通知される迄の間にクライアントが当該スレーブサーバの古いデータを参照する可能性があり、信頼性の面で課題がある。 However, since it takes a certain amount of time for an asynchronous slave server to detect the asynchronous state itself, there is a possibility that the client may refer to the old data of the slave server before the notification is given. There is a problem.
本発明は、上記事情を鑑みてなされたものであり、分散データベースシステムの信頼性を改善することを目的とする。 The present invention has been made in view of the above circumstances, and an object thereof is to improve the reliability of a distributed database system.
請求項1に記載のサーバ/クライアントシステムは、複数のサーバで構成される分散データベースシステムと、ネットワークを介していずれかのサーバにアクセスするクライアントとを備えたサーバ/クライアントシステムにおいて、前記サーバは、通信状況に基づき、他サーバのデータベースが自サーバのデータベースと同期しているかを検知し、自サーバのデータベースが他サーバのデータベースと同期しているかを検知する検知手段と、データベースが同期していないと検知された他サーバの状態を非同期状態とし、前記非同期状態の情報を前記クライアントに通知する通知手段と、を有し、前記クライアントは、前記全てのサーバ間でデータベースが同期しているか否かを示す同期・非同期情報を管理する管理テーブルを記憶しておく記憶手段と、前記記憶手段から管理テーブルを読み出して、前記サーバから通知された前記非同期状態の情報で前記同期・非同期情報を更新する更新手段と、更新された前記同期・非同期情報を参照し、データベースが同期している同期状態のサーバにのみアクセスするアクセス手段と、を有することを要旨とする。 The server / client system according to claim 1, wherein the server / client system includes a distributed database system including a plurality of servers, and a client that accesses any one of the servers via a network. based on the communication situation, to detect whether the other servers database is synchronized with the database of the server, detecting means for detecting whether the database of the server is synchronized with other servers database, not the database synchronization a state asynchronous state of the detected other servers and has a notification unit for notifying information of the asynchronous state to the client, the client, whether the database among all said servers are synchronized All stores a management table for managing the synchronous and asynchronous information that indicates the Storage means, reads out the management table from the storage means, and updating means for updating the synchronous and asynchronous information with information notified the asynchronous state from the server, with reference to the synchronous and asynchronous information updated, And an access means for accessing only a synchronized server in which the database is synchronized .
本発明によれば、分散データベースシステムを構成するサーバは、非同期であるサーバの非同期状態をクライアントに通知し、クライアントは、同期状態のサーバにのみアクセスするため、分散データベースシステムの信頼性を向上できる。 According to the present invention, the server constituting the distributed database system notifies the client of the asynchronous state of the asynchronous server, and the client accesses only the server in the synchronous state, so that the reliability of the distributed database system can be improved. .
請求項2に記載のサーバ/クライアントシステムは、請求項1に記載のサーバ/クライアントシステムにおいて、前記通知手段は、データベースが同期していないと検知された後ただちに前記非同期状態の情報を通知することを要旨とする。
Server / client system according to
本発明によれば、同期していないと検知された後ただちに上記サーバの非同期状態を通知するため、分散データベースシステムの信頼性をより向上できる。 According to the present invention, since the asynchronous state of the server is notified immediately after it is detected that it is not synchronized, the reliability of the distributed database system can be further improved.
請求項3に記載のサーバ/クライアントシステムは、請求項1又は2に記載のサーバ/クライアントシステムにおいて、前記通知手段は、前記クライアントからアクセスされた後に前記非同期状態の情報を通知することを要旨とする。
Server / client system according to
請求項4に記載のサーバ/クライアントシステムは、請求項1乃至3のいずれかに記載のサーバ/クライアントシステムにおいて、前記サーバは、他サーバとの間でデータベースが同期しているか否かを示す同期・非同期情報を管理する管理テーブルを記憶しておく記憶手段と、前記他サーバの状態が非同期状態の場合に当該非同期状態の情報で当該同期・非同期情報を更新する更新手段と、を更に有することを要旨とする。 The server / client system according to claim 4 is the server / client system according to any one of claims 1 to 3, wherein the server indicates synchronization indicating whether a database is synchronized with another server. - a storage means for storing a management table for managing asynchronous information, said the other server state further comprises updating means for updating the said synchronous and asynchronous information in the asynchronous state information for asynchronous state, the Is the gist.
請求項5に記載のサーバ/クライアントシステムは、1つのマスターサーバと複数のスレーブサーバで構成される分散データベースシステムと、ネットワークを介していずれかのサーバにアクセスするクライアントとを備えたサーバ/クライアントシステムにおいて、前記スレーブサーバは、全てのサーバのデータベースが同期している際に共有されたマスター状態インデックスを記憶しておく記憶手段と、前記マスターサーバのデータベースとデータベースが同期している同期スレーブサーバから、前記マスターサーバからのインデックスの通知に基づき更新されたマスター状態インデックスを含む同期状態の問合せ要求を受信する受信手段と、前記同期状態の問合せ要求からマスター状態インデックスを取得し、前記記憶手段に記憶されているマスター状態インデックスと比較する比較手段と、比較された2つのマスター状態インデックスが一致しない場合、自スレーブサーバの状態を非同期状態とし、前記非同期状態の情報を前記クライアントに通知する通知手段と、を有し、前記クライアントは、前記全てのサーバ間でデータベースが同期しているか否かを示す同期・非同期情報を管理する管理テーブルを記憶しておく記憶手段と、当該記憶手段から管理テーブルを読み出して、前記スレーブサーバから通知された前記非同期状態の情報で前記同期・非同期情報を更新する更新手段と、更新された前記同期・非同期情報を参照し、データベースが同期している同期状態のサーバにのみアクセスするアクセス手段と、を有することを要旨とする。 6. The server / client system according to claim 5, comprising: a distributed database system including one master server and a plurality of slave servers; and a client that accesses any one of the servers via a network. in the slave server includes a storage unit for storing the master state indexes shared when a database of all the servers are synchronized, the synchronization slave server database and database of the master server is synchronized Receiving means for receiving a synchronization state inquiry request including an updated master state index based on the notification of the index from the master server; acquiring the master state index from the synchronization state inquiry request; and storing the master state index in the storage means Is Comparing means for comparing the master state indexes are, if two master state indexes compared do not match, the state of the host slave server to an asynchronous state, a notification unit for notifying information of the asynchronous state to the client, the The client stores a management table for managing synchronization / asynchronous information indicating whether or not the database is synchronized among all the servers , and reads the management table from the storage unit. Update means for updating the synchronous / asynchronous information with the information on the asynchronous state notified from the slave server, and refer to the updated synchronous / asynchronous information , and only the synchronous server with which the database is synchronized And having access means for access.
本発明によれば、分散データベースシステムを構成するサーバは、非同期であるサーバの非同期状態をクライアントに通知し、クライアントは、同期状態のサーバにのみアクセスするため、分散データベースシステムの信頼性を向上できる。 According to the present invention, the server constituting the distributed database system notifies the client of the asynchronous state of the asynchronous server, and the client accesses only the server in the synchronous state, so that the reliability of the distributed database system can be improved. .
請求項6に記載のサーバ/クライアントシステムは、請求項5に記載のサーバ/クライアントシステムにおいて、前記スレーブサーバは、他サーバとの間でデータベースが同期しているか否かを示す同期・非同期情報を管理する管理テーブルを記憶しておく記憶手段と、前記非同期状態の情報で当該同期・非同期情報を更新する更新手段と、を更に有することを要旨とする。 The server / client system according to claim 6 is the server / client system according to claim 5, wherein the slave server receives synchronous / asynchronous information indicating whether or not a database is synchronized with another server. a storage means for storing a management table for managing, before and updating means Kihi update in the synchronous and asynchronous information synchronization state, and summarized in that further comprising a.
請求項7に記載のサーバ/クライアントシステムは、請求項5又は6に記載のサーバ/クライアントシステムにおいて、前記マスターサーバは、全てのサーバのデータベースが同期している際に共有されたマスター状態インデックスを記憶しておく記憶手段と、通信状況に基づき、前記複数のスレーブサーバのデータベースが自マスターサーバのデータベースと同期しているかを検知する検知手段と、データベースが同期していないスレーブサーバが検知された場合、前記マスター状態インデックスの値を変更する変更手段と、変更後のマスター状態インデックスを前記同期スレーブサーバに通知する通知手段と、を有することを要旨とする。 Server / client system according to claim 7, in the server / client system according to claim 5 or 6, wherein the master server, the master state indexes shared when a database of all the servers are synchronized Based on the communication means, storage means for storing, detecting means for detecting whether the databases of the plurality of slave servers are synchronized with the database of the own master server , and slave servers where the databases are not synchronized are detected In this case, the gist includes a changing unit that changes the value of the master state index and a notifying unit that notifies the synchronous slave server of the changed master state index.
請求項8に記載のサーバ/クライアントシステムは、請求項5乃至7のいずれかに記載のサーバ/クライアントシステムにおいて、前記同期スレーブサーバは、全てのサーバのデータベースが同期している際に共有されたマスター状態インデックスを記憶しておく記憶手段と、前記マスターサーバから通知された変更後のマスター状態インデックスを受信する受信手段と、受信した変更後のマスター状態インデックスを用いて当該記憶手段に記憶されているマスター状態インデックスを更新する更新手段と、更新されたマスター状態インデックスを用いてサーバの同期状態を問い合わせる同期状態の問合せ要求を他のスレーブサーバ及び前記マスターサーバに送信する送信手段と、を有することを要旨とする。 Server / client system according to claim 8, in the server / client system according to any one of claims 5 to 7, the synchronization slave server has been shared in a database of all the servers are synchronized Storage means for storing the master state index, receiving means for receiving the changed master state index notified from the master server, and storing the stored master means using the received changed master state index. Update means for updating the master status index, and transmission means for sending a synchronization status inquiry request for inquiring about the synchronization status of the server using the updated master status index to the other slave servers and the master server. Is the gist.
本発明によれば、分散データベースシステムの信頼性を向上できる。 According to the present invention, the reliability of a distributed database system can be improved.
以下、本発明を実施する一実施の形態について図面を用いて説明する。 Hereinafter, an embodiment for carrying out the present invention will be described with reference to the drawings.
〔第1の実施の形態〕
図1は、第1の実施の形態に係るサーバ/クライアントシステムの全体構成を示す図である。このサーバ/クライアントシステムは、複数のサーバ1で構成される分散データベースシステム100と、通信ネットワーク3を介していずれかのサーバ1にアクセスするクライアント2とを備える。
[First Embodiment]
FIG. 1 is a diagram showing an overall configuration of a server / client system according to the first embodiment. This server / client system includes a distributed
分散データベースシステム100は、マスター状態の1つのマスターサーバ1aと、スレーブ状態の2つのスレーブサーバ1b,1cとで構成される。マスターサーバ1aは、データベースの原本を記憶するマスターデータベースを備え、各スレーブサーバ1b,1cは、マスターデータベースの複製を記憶するスレーブデータベースを備えている。
The distributed
マスターサーバ1aは、マスターデータベースの原本データに変更(追加/削除/更新)があると、各スレーブサーバ1b,1cに当該データを送信してデータの複製を要求する。一方、各スレーブサーバ1b,1cは、その要求に基づいて各スレーブデータベース(1)(2)を更新する。これにより、分散データベースシステム内のいずれのサーバにアクセスされた場合でも同じデータを提供し、各サーバの負荷分散、アクセス時間の短縮、信頼性の向上を実現している。
When there is a change (addition / deletion / update) in the master data of the master database, the
ここで、マスターサーバ1aは、各スレーブサーバ1b,1cからデータ複製要求に対する正常応答があれば、データが複製されたと判断する。このように、マスターサーバ1aと各スレーブサーバ1b,1cとの間でデータが完全に複製された状態を同期状態と呼ぶ。
Here, if there is a normal response to the data replication request from each of the
一方、マスターサーバ1aが各スレーブサーバ1b,1cとの通信断を検出した場合や、各スレーブサーバ1b,1cからデータ複製要求に対する応答がなかった場合には、同期状態ではないと判断し、このような同期状態ではない状態を非同期状態と呼ぶ。
On the other hand, when the
ここで、本実施の形態に係るマスターサーバ1aの機能について詳述する。図2は、マスターサーバ1aの機能ブロック構成を示す図である。マスターサーバ1aは、データ複製要求部41と、同期状態検知部42と、データ管理部43と、同期状態通知部44と、管理テーブル記憶部45とで構成される。
Here, the function of the
データ複製要求部41は、前述したように、マスターデータベースの原本データに変更があった場合、各スレーブサーバ1b,1cに対して当該データを含むデータ複製要求を送信する機能部である。
As described above, the data
同期状態検知部42は、通信状況に基づき、各スレーブサーバ1b,1cが自サーバと同期しているかを検知し、自サーバが各スレーブサーバ1b,1cと同期しているかを検知する機能部である。
The synchronization
前述したように、データ複製要求に対して各スレーブサーバ1b,1cから正常応答があった場合には、それらスレーブサーバの状態を同期状態と検知する。一方、各スレーブサーバ1b,1cから応答がなかった場合や各スレーブサーバ1b,1cとの通信断を検出した場合には、それらスレーブサーバの状態を非同期状態と検知する。
As described above, when there is a normal response from each
データ管理部43は、後述するマスターサーバ同期状態管理テーブルを管理し、各スレーブサーバ1b,1cの状態(同期/非同期状態)の検知結果に基づき、そのマスターサーバ同期状態管理テーブルを更新する機能部である。
The
同期状態通知部44は、その検知結果に基づき、各スレーブサーバ1b,1cの状態(同期/非同期状態)をクライアント2に通知する機能部である。
The synchronization
管理テーブル記憶部45は、各スレーブサーバ1b,1cとの同期/非同期状態や、自サーバの同期/非同期状態を管理するマスターサーバ同期状態管理テーブル(図3参照)を記憶するメモリ等の記憶部である。
The management
次に、本実施の形態に係るスレーブサーバ(1)1bの機能について詳述する。図4は、スレーブサーバ1bの機能ブロック構成を示す図である。スレーブサーバ1bは、同期状態検知部51と、データ管理部52と、同期状態通知部53と、管理テーブル記憶部54とで構成される。
Next, the function of the slave server (1) 1b according to the present embodiment will be described in detail. FIG. 4 is a diagram showing a functional block configuration of the
同期状態検知部51は、通信状況に基づき、マスターサーバ1aが自サーバと同期しているかを検知し、自サーバがマスターサーバ1aと同期しているかを検知する機能部である。例えば、マスターサーバ1aとの通信断を検出した場合には、自身の状態を非同期状態と検知する。
The synchronization
データ管理部52は、後述するスレーブサーバ(1)同期状態管理テーブルを管理し、マスターサーバ1aの状態(同期/非同期状態)の検知結果に基づき、そのスレーブサーバ(1)同期状態管理テーブルを更新する機能部である。
The
同期状態通知部53は、クライアント2からのアクセス要求に応じて、自身の状態(同期/非同期状態)をクライアント2に通知する機能部である。
The synchronization
管理テーブル記憶部54は、マスターサーバ1aとの同期状態や、自サーバの同期状態を管理するスレーブサーバ(1)同期状態管理テーブル(図5参照)を記憶する記憶部である。
The management
なお、スレーブサーバ(2)1cも同様の機能を備え、図6に示すようなスレーブサーバ(2)同期状態管理テーブルを保有している。 The slave server (2) 1c also has the same function and has a slave server (2) synchronization state management table as shown in FIG.
次に、本実施の形態に係るクライアント2の機能について詳述する。図7は、クライアント2の機能ブロック構成を示す図である。クライアント2は、データ管理部61と、アクセス要求部62と、管理テーブル記憶部63とで構成される。
Next, functions of the
データ管理部61は、後述するクライアント同期状態管理テーブルを管理し、マスターサーバ1a又は各スレーブサーバ1b,1cから通知されたスレーブサーバの状態(同期/非同期状態)に基づき、そのクライアント同期状態管理テーブルを更新する機能部である。
The
アクセス要求部62は、更新後のクライアント同期状態管理テーブルを参照し、マスターサーバとスレーブサーバの状態が全て同期状態のサーバに対してのみアクセスし、そのサーバに保有されているデータを参照して取得する機能部である。
The
管理テーブル記憶部63は、マスターサーバ1a及び各スレーブサーバ1b,1cとの同期状態を管理するクライアント同期状態管理テーブル(図8参照)を記憶する記憶部である。
The management
以上がサーバ/クライアントシステムの構成及び機能である。なお、図9に示すように、スレーブサーバを3つ以上としても構わないし、クライアントを2つ以上としても構わない。また、分散データベースシステムの構成をクライアント側から隠蔽するため、分散データベースシステム100とクライアント2との間に、分散データベースシステムの同期状態を保持するフロントエンドサーバ4を配置しても構わない。
The above is the configuration and function of the server / client system. As shown in FIG. 9, the number of slave servers may be three or more, and the number of clients may be two or more. In order to conceal the configuration of the distributed database system from the client side, a front-end server 4 that maintains the synchronization state of the distributed database system may be arranged between the distributed
続いて、図10と図11を参照しながら、本実施の形態に係るサーバ/クライアントシステムの動作について説明する。図10は、マスターサーバ1aがスレーブサーバ(2)1cの非同期状態を検知し、その検知後ただちにクライアント2に通知する場合の動作例1である。
Subsequently, the operation of the server / client system according to the present embodiment will be described with reference to FIGS. 10 and 11. FIG. 10 shows an operation example 1 in which the
マスターサーバ1aとスレーブサーバ(1)1b及びスレーブサーバ(2)1cは同期状態であるとする。まず、マスターサーバ1aのデータ複製要求部41により、スレーブサーバ(1)1b及びスレーブサーバ(2)1cにデータ複製要求が送信される(ステップS101)。
Assume that the
このとき、スレーブサーバ(2)1cとの通信断が検出されると、マスターサーバ1aの同期状態検知部42により、そのスレーブサーバ(2)1cは非同期状態と検知される(ステップS102)。
At this time, when the communication disconnection with the slave server (2) 1c is detected, the slave server (2) 1c is detected to be in an asynchronous state by the synchronization
そして、マスターサーバ1aのデータ管理部43により、マスターサーバ同期状態管理テーブルのスレーブサーバ(2)の状態が「非同期」に更新される(ステップS103)。
Then, the state of the slave server (2) in the master server synchronization state management table is updated to “asynchronous” by the
その後、マスターサーバ1aの同期状態通知部44により、スレーブサーバ(2)の非同期状態がクライアント2に通知される(ステップS104)。
Thereafter, the asynchronous state of the slave server (2) is notified to the
マスターサーバ1aからの通知データは通信ネットワーク3を介してクライアント2で受信され、クライアント2のデータ管理部61により、クライアント同期状態管理テーブルのスレーブサーバ(2)の状態が「非同期」に更新される(ステップS105)。
Notification data from the
その後、クライアント2のアクセス要求部62により、更新されたクライアント同期状態管理テーブルが参照され、マスターサーバとスレーブサーバの状態が全て同期状態であるマスターサーバ1a又はスレーブサーバ1bにアクセス要求が送信され、アクセス先のデータが参照される(ステップS106)。
Thereafter, the
本動作例1によれば、マスターサーバ1aが、通信状況に基づきスレーブサーバ(2)の非同期状態を検知し、その検知後ただちにその非同期状態をクライアント2に通知し、クライアント2は、同期状態のサーバにのみアクセスするので、非同期状態のスレーブサーバにアクセスする確率を低減でき、分散データベースシステムの信頼性を向上できる。
According to this operation example 1, the
続いて、図11を参照しながら、クライアント2からアクセス要求された後にスレーブサーバ(2)の非同期状態を通知する場合の動作例2を説明する。
Next, an operation example 2 in the case where the asynchronous state of the slave server (2) is notified after an access request from the
マスターサーバ1aにより、上記ステップS101〜ステップS103が実行される(ステップS201〜ステップS203)。その際、マスターサーバ1aとの通信断が検出されると、スレーブサーバ(2)1cの同期状態検知部51により、自サーバが非同期状態と検知される(ステップS204)。
Steps S101 to S103 are executed by the
そして、スレーブサーバ(2)1cのデータ管理部52により、スレーブサーバ(2)同期状態管理テーブルの自サーバの状態が「非同期」に更新される(ステップS205)。
Then, the
その後、クライアント2がスレーブサーバ(2)1cにアクセス要求した場合、スレーブサーバ(2)1cの同期状態通知部53により、更新されたスレーブサーバ(2)同期状態管理テーブルが参照され、そのアクセス要求に対する応答にスレーブサーバ(2)の非同期状態が設定され、クライアント2に通知される(ステップS206)。
Thereafter, when the
同様に、クライアント2がマスターサーバ1aにアクセス要求した場合には、マスターサーバ1aの同期状態通知部44により、ステップS203で更新されたマスターサーバ同期状態管理テーブルが参照され、そのアクセス要求に対する応答にスレーブサーバ(2)の非同期状態が設定され、クライアント2に通知される(ステップS206’)。
Similarly, when the
その後、スレーブサーバ(2)1c又はマスターサーバ1aからの通知データがクライアント2で受信されると、クライアント2のデータ管理部61により、クライアント同期状態管理テーブルのスレーブサーバ(2)の状態が「非同期」に更新される(ステップS207)。
Thereafter, when notification data from the slave server (2) 1c or the
そして、クライアント2のアクセス要求部62により、更新されたクライアント同期状態管理テーブルが参照され、マスターサーバとスレーブサーバの状態が全て同期状態であるマスターサーバ1a又はスレーブサーバ1bにアクセス要求が送信される(ステップS208)。
Then, the
本動作例2によれば、スレーブサーバ(2)1c又はマスターサーバ1aが、クライアント2からのアクセス要求に応じてスレーブサーバ(2)の非同期状態を通知し、クライアント2は、同期状態のサーバにのみアクセスするので、非同期状態のスレーブサーバにアクセスする確率を低減でき、分散データベースシステムの信頼性を向上できる。
According to this operation example 2, the slave server (2) 1c or the
なお、動作例1では、マスターサーバ1aがクライアント2にスレーブサーバ(2)の非同期状態を通知しているが、スレーブサーバ(1)1bがマスターサーバ1aよりも先に当該非同期状態を検知した場合には、そのスレーブサーバ(1)1bが、クライアント2にスレーブサーバ(2)の非同期状態を通知しても構わない。
In operation example 1, the
また、動作例1,2を組み合わせ、スレーブサーバ(2)の非同期状態をステップS104とステップS206(ステップS206’)の両段階でそれぞれ通知しても構わない。 Further, the operation examples 1 and 2 may be combined to notify the asynchronous state of the slave server (2) at both the steps S104 and S206 (step S206 ').
以上より、本実施の形態によれば、いずれの動作例1,2においても、分散データベースシステムを構成するサーバが、非同期であるサーバの非同期状態をクライアントに通知し、そのクライアントは、同期状態のサーバにのみアクセスするので、非同期状態のスレーブサーバにアクセスする確率を低減でき、分散データベースシステムの信頼性を向上できる。 As described above, according to the present embodiment, in any of the operation examples 1 and 2, the server configuring the distributed database system notifies the client of the asynchronous state of the asynchronous server, and the client is in the synchronous state. Since only the server is accessed, the probability of accessing the asynchronous slave server can be reduced, and the reliability of the distributed database system can be improved.
特に、動作例1によれば、サーバの非同期状態を、検知後ただちに通知するので、クライアントに通知される迄の時間が短縮されることから、分散データベースシステムの信頼性をより向上できる。 In particular, according to the operation example 1, since the server asynchronous state is notified immediately after detection, the time until notification to the client is shortened, so that the reliability of the distributed database system can be further improved.
また、実施例2によれば、サーバの非同期状態を、クライアントからのアクセス要求を受信した後に通知するので、サーバからクライアントに対する通知が不要になることから、通知のためのシステムの負荷を低減できる。 Further, according to the second embodiment, since the server asynchronous state is notified after the access request from the client is received, notification from the server to the client becomes unnecessary, so the load on the system for notification can be reduced. .
〔第2の実施の形態〕
次に、第2の実施の形態について説明する。本実施の形態に係るサーバ/クライアントシステムの全体構成やクライアント2の機能については、第1の実施の形態と同様である(図1,図9参照)。以下、マスターサーバ1aと各スレーブサーバ1b,1cに追加される機能を中心に説明する。
[Second Embodiment]
Next, a second embodiment will be described. The overall configuration of the server / client system according to the present embodiment and the functions of the
図12は、本実施の形態に係るマスターサーバ1aの機能ブロック構成を示す図である。マスターサーバ1aは、インデックス記憶部46と、インデックス通知部47と、問合せ受付部48とを更に備えている。
FIG. 12 is a diagram showing a functional block configuration of the
インデックス記憶部46は、マスターサーバ自身が割り当て、分散データベースシステム内の全てのサーバが共有するマスター状態インデックスを記憶しておく記憶部である。
The
マスター状態インデックスとは、新旧を判断可能な一意な識別子であり、例えば、1,2,3,…等の連続番号でも構わないし、基準時刻として時系列を表す情報を利用しても構わない。 The master status index is a unique identifier that can be used to determine whether it is new or old. For example, it may be a serial number such as 1, 2, 3,..., Or information representing a time series may be used as a reference time.
インデックス通知部47は、マスター状態インデックスを同期状態のスレーブサーバにのみ通知する機能部である。
The
問合せ受付部48は、スレーブサーバから送信されたサーバ同期状態問合せ要求(後述)を受け付ける機能部である。
The
図13は、本実施の形態に係る各スレーブサーバ1b,1cの機能ブロック構成を示す図である。各スレーブサーバ1b,1cは、インデックス記憶部55と、インデックス受信部56と、同期状態問合せ部57と、問合せ受付部58とを更に備えている。
FIG. 13 is a diagram illustrating a functional block configuration of each of the
インデックス記憶部55は、マスターサーバ1aが割り当てたマスター状態インデックスと同じマスター状態インデックスを記憶しておく機能部である。
The
インデックス受信部56は、マスターサーバ1aから通知されたマスター状態インデックスを受信する機能部である。
The
同期状態問合せ部57は、インデックス記憶部55に記憶しているマスター状態インデックスを用いて、サーバの同期状態を問い合わせるためのサーバ同期状態問合せ要求を全てのサーバに送信する機能部である。
The synchronization
問合せ受付部58は、他のスレーブサーバから送信されたサーバ同期状態問合せ要求を受け付ける機能部である。
The
続いて、図14を参照しながら、本実施の形態に係るサーバ/クライアントシステムの動作について説明する。 Next, the operation of the server / client system according to the present embodiment will be described with reference to FIG.
マスターサーバ1aとスレーブサーバ(1)1b及びスレーブサーバ(2)1cは、同期状態であり、その同期状態の際にマスターサーバ1aにより割り当てられたマスター状態インデックス「1」を共有しているとする。
The
まず、マスターサーバ1aのデータ複製要求部41により、スレーブサーバ(1)1b及びスレーブサーバ(2)1cにデータ複製要求が送信される(ステップS301)。
First, the data
このとき、スレーブサーバ(2)1cとの通信断が検出されると、マスターサーバ1aの同期状態検知部42により、そのスレーブサーバ(2)1cは非同期状態と検知される(ステップS302)。
At this time, when the communication disconnection with the slave server (2) 1c is detected, the slave server (2) 1c is detected to be in an asynchronous state by the synchronization
そして、マスターサーバ1aのデータ管理部43により、マスターサーバ同期状態管理テーブルのスレーブサーバ(2)の状態が「非同期」に更新され、マスター状態インデックスの値が「2」に変更される(ステップS303)。
Then, the
その後、マスターサーバ1aのインデックス通知部47により、変更後のマスター状態インデックスが、同期状態であるスレーブサーバ(1)1bにのみ通知される(ステップS304)。
Thereafter, the
マスターサーバ1aからのインデックス通知データはスレーブサーバ(1)1bに送信され、スレーブサーバ(1)1bのインデックス受信部56により、送信された変更後のマスター状態インデックスが受信される(ステップS305)。
The index notification data from the
その後、スレーブサーバ(1)1bのデータ管理部52により、マスターサーバ1aからのインデックス通知に基づき、受信した変更後のマスター状態インデックスを用いて、インデックス記憶部55に記憶されているマスター状態インデックスが更新(「1」→「2」)される(ステップS306)。
Thereafter, based on the index notification from the
そして、分散データベースシステム内の全てのサーバの同期状態を確認するため、スレーブサーバ(1)1bの同期状態問合せ部57により、更新されたマスター状態インデックスを含むサーバ同期状態問合せ要求が全てのサーバに送信される(ステップS307)。
Then, in order to confirm the synchronization status of all the servers in the distributed database system, a server synchronization status inquiry request including an updated master status index is sent to all servers by the synchronization
その後、スレーブサーバ(2)1cの問合せ受付部58により、更新後のマスター状態インデックスを含むサーバ同期状態問合せ要求が受信される(ステップS308)。
Thereafter, the
そして、スレーブサーバ(2)1cのデータ管理部52により、サーバ同期状態問合せ要求から取得した更新後のマスター状態インデックスと、インデックス記憶部55に記憶されているマスター状態インデックスとが比較され、自サーバのマスター状態インデックスよりも値が新しいため、自サーバの同期状態が「非同期」と特定される(ステップS309)。
Then, the
その後、スレーブサーバ(2)1cのデータ管理部52により、スレーブサーバ(2)同期状態管理テーブルのスレーブサーバ(2)の状態が「非同期」に更新される(ステップS310)。
Thereafter, the state of the slave server (2) in the slave server (2) synchronization state management table is updated to “asynchronous” by the
一方、マスターサーバ1aでは、問合せ受付部48により、ステップS307でスレーブサーバ(1)1bから送信されたサーバ同期状態問合せ要求が受信される(ステップS311)。そして、データ管理部43により、受信したサーバ同期状態問合せ要求内での更新後のマスター状態インデックスと、インデックス記憶部46に記憶されているマスター状態インデックスとが比較され、自サーバのマスター状態インデックスと同じ値であるため、特に処理は行わない(ステップS312)。
On the other hand, in the
その後、クライアント2がスレーブサーバ(2)1cにアクセス要求した場合、スレーブサーバ(2)1cの同期状態通知部53により、ステップS310で更新されたスレーブサーバ(2)同期状態管理テーブルが参照され、そのアクセス要求に対する応答にスレーブサーバ(2)の非同期状態が設定され、クライアント2に通知される(ステップS313)。
Thereafter, when the
同様に、クライアント2がマスターサーバ1aにアクセス要求した場合には、マスターサーバ1aの同期状態通知部44により、ステップS303で更新されたマスターサーバ同期状態管理テーブルが参照され、そのアクセス要求に対する応答にスレーブサーバ(2)の非同期状態が設定され、クライアント2に通知される(ステップS313’)。
Similarly, when the
その後、スレーブサーバ(2)1c又はマスターサーバ1aからの通知データがクライアント2で受信されると、クライアント2のデータ管理部61により、クライアント同期状態管理テーブルのスレーブサーバ(2)の状態が「非同期」に更新される(ステップS314)。
Thereafter, when notification data from the slave server (2) 1c or the
そして、クライアント2のアクセス要求部62により、更新されたクライアント同期状態管理テーブルが参照され、マスターサーバとスレーブサーバの状態が全て同期状態であるマスターサーバ1a又はスレーブサーバ1bにアクセス要求が送信される(ステップS315)。
Then, the
なお、ステップS304の後、第1の実施の形態で実行したステップS104〜ステップS105を併せて実行しても構わない。また、ステップS310のタイミングで、スレーブサーバ(2)1cの同期状態通知部53により、スレーブサーバ(2)の非同期状態をクライアント2に通知しても構わない。
Note that step S104 to step S105 executed in the first embodiment may be executed after step S304. In addition, at the timing of step S310, the synchronization
また、マスターサーバ1aは、スレーブサーバから自身もマスター状態インデックスを受信し、マスターサーバ同期状態管理テーブルを参照して当該受信したマスター状態インデックスの送信元スレーブサーバが同期状態である場合、受信したマスター状態インデックスと自身のマスター状態インデックスとを比較し、同一でなければ送信元のスレーブサーバを非同期状態と検知するようにしても構わない。非同期状態と検知された場合は、ステップS303以降と同じ動作を実行する。
Further, the
以上より、本実施の形態によれば、第1の実施の形態と同様に、分散データベースシステムを構成するサーバが、非同期であるサーバの非同期状態をクライアントに通知し、そのクライアントは、同期状態のサーバにのみアクセスするので、非同期状態のスレーブサーバにアクセスする確率を低減でき、分散データベースシステムの信頼性を向上できる。 As described above, according to the present embodiment, as in the first embodiment, the server configuring the distributed database system notifies the client of the asynchronous state of the asynchronous server, and the client is in the synchronous state. Since only the server is accessed, the probability of accessing the asynchronous slave server can be reduced, and the reliability of the distributed database system can be improved.
また、スレーブサーバ(2)は、サーバの非同期状態を、クライアントからのアクセス要求を受信した後に通知するので、サーバからクライアントに対する通知が不要になることから、通知のためのシステムの負荷を低減できる。 Further, since the slave server (2) notifies the asynchronous state of the server after receiving the access request from the client, the notification from the server to the client becomes unnecessary, so the load on the system for notification can be reduced. .
最後に、本実施の形態で説明したマスターサーバ1a、各スレーブサーバ1b,1c、クライアント2は、コンピュータにより実現可能である。また、それらの構成要素の各動作をプログラムとして構築し、コンピュータにインストールして実行させることや、通信ネットワークを介して流通させることも可能である。
Finally, the
100…分散データベースシステム
1a…マスターサーバ装置
41…データ複製要求部
42…同期状態検知部
43…データ管理部
44…同期状態通知部
45…管理テーブル記憶部
46…インデックス記憶部
47…インデックス通知部
48…問合せ受付部
1b…スレーブサーバ(1)装置
1c…スレーブサーバ(2)装置
51…同期状態検知部
52…データ管理部
53…同期状態通知部
54…管理テーブル記憶部
55…インデックス記憶部
56…インデックス受信部
57…同期状態問合せ部
58…問合せ受付部
2…クライアント装置
61…データ管理部
62…アクセス要求部
63…管理テーブル記憶部
3…通信ネットワーク
4…フロントエンドサーバ
S101〜S106、S201〜S208、S301〜S315…ステップ
DESCRIPTION OF
Claims (8)
前記サーバは、
通信状況に基づき、他サーバのデータベースが自サーバのデータベースと同期しているかを検知し、自サーバのデータベースが他サーバのデータベースと同期しているかを検知する検知手段と、
データベースが同期していないと検知された他サーバの状態を非同期状態とし、前記非同期状態の情報を前記クライアントに通知する通知手段と、を有し、
前記クライアントは、
前記全てのサーバ間でデータベースが同期しているか否かを示す同期・非同期情報を管理する管理テーブルを記憶しておく記憶手段と、
前記記憶手段から管理テーブルを読み出して、前記サーバから通知された前記非同期状態の情報で前記同期・非同期情報を更新する更新手段と、
更新された前記同期・非同期情報を参照し、データベースが同期している同期状態のサーバにのみアクセスするアクセス手段と、
を有することを特徴とするサーバ/クライアントシステム。 In a server / client system comprising a distributed database system composed of a plurality of servers and a client that accesses one of the servers via a network,
The server
Based on the communication situation, a detection unit of another server database detects whether the synchronization with the database of the server, detects whether the database of the server is synchronized with other servers database,
The status of the other server database is detected and not synchronized with the asynchronous state has a notifying means for notifying the information of the asynchronous state to the client,
The client
Storage means for storing a management table for managing synchronous / asynchronous information indicating whether or not the database is synchronized among all the servers;
An update unit that reads the management table from the storage unit and updates the synchronous / asynchronous information with the asynchronous state information notified from the server;
An access means for referring to the updated synchronous / asynchronous information and accessing only a synchronous server in which the database is synchronized ;
A server / client system comprising:
データベースが同期していないと検知された後ただちに前記非同期状態の情報を通知することを特徴とする請求項1に記載のサーバ/クライアントシステム。 The notification means includes
Server / client system according to claim 1 where the database and notifies immediately before Kihi information synchronization state after being detected as not synchronized.
前記クライアントからアクセスされた後に前記非同期状態の情報を通知することを特徴とする請求項1又は2に記載のサーバ/クライアントシステム。 The notification means includes
Server / client system according to claim 1 or 2, wherein the notifying the front Kihi information synchronization state after being accessed from the client.
他サーバとの間でデータベースが同期しているか否かを示す同期・非同期情報を管理する管理テーブルを記憶しておく記憶手段と、
前記他サーバの状態が非同期状態の場合に当該非同期状態の情報で当該同期・非同期情報を更新する更新手段と、
を更に有することを特徴とする請求項1乃至3のいずれかに記載のサーバ/クライアントシステム。 The server
Storage means for storing a management table for managing synchronous / asynchronous information indicating whether or not the database is synchronized with another server;
Updating means for updating the synchronous / asynchronous information with the information of the asynchronous state when the state of the other server is an asynchronous state;
4. The server / client system according to claim 1, further comprising:
前記スレーブサーバは、
全てのサーバのデータベースが同期している際に共有されたマスター状態インデックスを記憶しておく記憶手段と、
前記マスターサーバのデータベースとデータベースが同期している同期スレーブサーバから、前記マスターサーバからのインデックスの通知に基づき更新されたマスター状態インデックスを含む同期状態の問合せ要求を受信する受信手段と、
前記同期状態の問合せ要求からマスター状態インデックスを取得し、前記記憶手段に記憶されているマスター状態インデックスと比較する比較手段と、
比較された2つのマスター状態インデックスが一致しない場合、自スレーブサーバの状態を非同期状態とし、前記非同期状態の情報を前記クライアントに通知する通知手段と、を有し、
前記クライアントは、
前記全てのサーバ間でデータベースが同期しているか否かを示す同期・非同期情報を管理する管理テーブルを記憶しておく記憶手段と、
当該記憶手段から管理テーブルを読み出して、前記スレーブサーバから通知された前記非同期状態の情報で前記同期・非同期情報を更新する更新手段と、
更新された前記同期・非同期情報を参照し、データベースが同期している同期状態のサーバにのみアクセスするアクセス手段と、
を有することを特徴とするサーバ/クライアントシステム。 In a server / client system comprising a distributed database system composed of one master server and a plurality of slave servers, and a client that accesses one of the servers via a network,
The slave server is
Storage means for database of all server stores the master state indexes shared when synchronized,
Receiving means for receiving a synchronization state inquiry request including a master state index updated based on an index notification from the master server, from a synchronization slave server in which the database of the master server is synchronized with the database ;
Comparing means for obtaining a master state index from the synchronous state inquiry request and comparing with a master state index stored in the storage means;
If the two master status indexes compared do not match, the slave server status is set to an asynchronous status, and the asynchronous status information is notified to the client.
The client
Storage means for storing a management table for managing synchronous / asynchronous information indicating whether or not the database is synchronized among all the servers;
An update unit that reads the management table from the storage unit and updates the synchronous / asynchronous information with the asynchronous state information notified from the slave server;
An access means for referring to the updated synchronous / asynchronous information and accessing only a synchronous server in which the database is synchronized ;
A server / client system comprising:
他サーバとの間でデータベースが同期しているか否かを示す同期・非同期情報を管理する管理テーブルを記憶しておく記憶手段と、
前記非同期状態の情報で当該同期・非同期情報を更新する更新手段と、
を更に有することを特徴とする請求項5に記載のサーバ/クライアントシステム。 The slave server is
Storage means for storing a management table for managing synchronous / asynchronous information indicating whether or not the database is synchronized with another server;
And updating means for updating the synchronous and asynchronous information in front Kihi synchronous status information,
The server / client system according to claim 5, further comprising:
全てのサーバのデータベースが同期している際に共有されたマスター状態インデックスを記憶しておく記憶手段と、
通信状況に基づき、前記複数のスレーブサーバのデータベースが自マスターサーバのデータベースと同期しているかを検知する検知手段と、
データベースが同期していないスレーブサーバが検知された場合、前記マスター状態インデックスの値を変更する変更手段と、
変更後のマスター状態インデックスを前記同期スレーブサーバに通知する通知手段と、
を有することを特徴とする請求項5又は6に記載のサーバ/クライアントシステム。 The master server is
Storage means for database of all server stores the master state indexes shared when synchronized,
Based on the communication situation, a detection unit configured to detect whether the database of the plurality of slave servers is synchronized with the database of its own master server,
A changing means for changing the value of the master state index when a slave server whose database is not synchronized is detected;
Notification means for notifying the synchronous slave server of the changed master state index;
The server / client system according to claim 5 or 6, characterized by comprising:
全てのサーバのデータベースが同期している際に共有されたマスター状態インデックスを記憶しておく記憶手段と、
前記マスターサーバから通知された変更後のマスター状態インデックスを受信する受信手段と、
受信した変更後のマスター状態インデックスを用いて当該記憶手段に記憶されているマスター状態インデックスを更新する更新手段と、
更新されたマスター状態インデックスを用いてサーバの同期状態を問い合わせる同期状態の問合せ要求を他のスレーブサーバ及び前記マスターサーバに送信する送信手段と、
を有することを特徴とする請求項5乃至7のいずれかに記載のサーバ/クライアントシステム。 The synchronous slave server is
Storage means for database of all server stores the master state indexes shared when synchronized,
Receiving means for receiving the changed master state index notified from the master server;
Update means for updating the master state index stored in the storage means using the received master state index after change,
A transmission means for transmitting a synchronization status inquiry request to the other slave servers and the master server for inquiring about the synchronization status of the server using the updated master status index;
8. The server / client system according to claim 5, wherein the server / client system comprises:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013138615A JP6043687B2 (en) | 2013-07-02 | 2013-07-02 | Server / client system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013138615A JP6043687B2 (en) | 2013-07-02 | 2013-07-02 | Server / client system |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2015011642A JP2015011642A (en) | 2015-01-19 |
JP6043687B2 true JP6043687B2 (en) | 2016-12-14 |
Family
ID=52304713
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013138615A Active JP6043687B2 (en) | 2013-07-02 | 2013-07-02 | Server / client system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6043687B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6571614B2 (en) * | 2016-09-02 | 2019-09-04 | 日本電信電話株式会社 | Distribution device, communication system, and data distribution method |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002278820A (en) * | 2001-03-21 | 2002-09-27 | Ricoh Co Ltd | Database management system |
US7020706B2 (en) * | 2002-06-17 | 2006-03-28 | Bmc Software, Inc. | Method and system for automatically updating multiple servers |
JP4760319B2 (en) * | 2005-11-11 | 2011-08-31 | 株式会社安川電機 | Master switching method and plant system for multiple server |
JP3823169B1 (en) * | 2005-12-06 | 2006-09-20 | データアクセス株式会社 | Data control apparatus, system, method, and program |
US20080140734A1 (en) * | 2006-12-07 | 2008-06-12 | Robert Edward Wagner | Method for identifying logical data discrepancies between database replicas in a database cluster |
WO2008139521A1 (en) * | 2007-04-27 | 2008-11-20 | Fujitsu Limited | Remote file system, terminal device, and server device |
EP2015182A3 (en) * | 2007-05-30 | 2010-03-24 | Hitachi Ltd. | Distributed system |
-
2013
- 2013-07-02 JP JP2013138615A patent/JP6043687B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2015011642A (en) | 2015-01-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101503202B1 (en) | Data synchronization | |
CN104935654B (en) | Caching method, write-in point client in a kind of server cluster system and read client | |
US8671151B2 (en) | Maintaining item-to-node mapping information in a distributed system | |
CN111368002A (en) | Data processing method, system, computer equipment and storage medium | |
US9411869B2 (en) | Replication between sites using keys associated with modified data | |
CN111274310A (en) | Distributed data caching method and system | |
CN105162879B (en) | Realize the method, apparatus and system of multimachine room data consistency | |
KR101545626B1 (en) | System for interoperation between dds and dbms | |
JP2012234333A (en) | Cluster system, synchronization control method, server device and synchronization control program | |
US9026493B1 (en) | Multi-master RDBMS improvements for distributed computing environment | |
US20170193070A1 (en) | System and method for a distributed replication lock for active-active geo-redundant systems | |
CN113010549A (en) | Data processing method based on remote multi-active system, related equipment and storage medium | |
JP5395517B2 (en) | Distributed data management system, data management apparatus, data management method, and program | |
JP2012146083A (en) | Session management system, session management apparatus, server device and session management method | |
JP2020184325A (en) | Method for processing replica, node, storage system, server, and readable storage medium | |
US11093334B2 (en) | Method, device and computer program product for data processing | |
US7979392B2 (en) | Method and apparatus for preventing duplicate saving of resource between universal plug and play devices providing content directory service | |
EP2025133B1 (en) | Repository synchronization in a ranked repository cluster | |
CN112328637B (en) | High-speed distributed data caching method, device, computer equipment and storage medium | |
EP3958139B1 (en) | Method and system for creating files in a file system | |
US9870402B2 (en) | Distributed storage device, storage node, data providing method, and medium | |
JP6043687B2 (en) | Server / client system | |
US8713059B2 (en) | Management of computer-file sharing between at least two devices | |
JP5685213B2 (en) | Differential replication system, master database device, and slave database device | |
CN115104295A (en) | Data processing method, data processing device, electronic device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20150817 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20160513 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20160614 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20160804 |
|
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: 20161108 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20161114 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6043687 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |