JP2011028658A - Database device, cache device, database system, cache maintenance method and program thereof - Google Patents

Database device, cache device, database system, cache maintenance method and program thereof Download PDF

Info

Publication number
JP2011028658A
JP2011028658A JP2009175924A JP2009175924A JP2011028658A JP 2011028658 A JP2011028658 A JP 2011028658A JP 2009175924 A JP2009175924 A JP 2009175924A JP 2009175924 A JP2009175924 A JP 2009175924A JP 2011028658 A JP2011028658 A JP 2011028658A
Authority
JP
Japan
Prior art keywords
cache
database
data
base table
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.)
Granted
Application number
JP2009175924A
Other languages
Japanese (ja)
Other versions
JP5071990B2 (en
Inventor
Keita Mikami
啓太 三上
Makoto Onizuka
真 鬼塚
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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2009175924A priority Critical patent/JP5071990B2/en
Publication of JP2011028658A publication Critical patent/JP2011028658A/en
Application granted granted Critical
Publication of JP5071990B2 publication Critical patent/JP5071990B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To reduce the load of cache maintenance processing in a database system. <P>SOLUTION: The database device obtains the latest cache entry on a cache 231 by a cache track part of the cache device 200, and records it on a cache management table 1312. The database device refers to the cache management table 1312, upon update processing of the a base table 1311, to identify data on the base table 1311 which is affected by the update processing of the base table 1311 and exists on the cache 231. The database device transmits a destruction message for the cache entry of the identified data to the cache device 200. The cache device 200 destroys the cache entry on the cache 231 designated by the destruction message. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、データベースにおけるデータのキャッシュエントリをメンテナンスするキャッシュメンテナンス技術に関する。   The present invention relates to a cache maintenance technique for maintaining a cache entry of data in a database.

今日、インターネットの爆発的な普及に伴い、多くのサービスがインターネットを通じて提供されている。インターネットを通じて提供されるサービスとしては、例えば、オンラインショッピング、オンラインバンキング、ソーシャルネットワーキングサービス(SNS)等があげられる。これらのサービスを提供するシステムは、殆どの場合、ユーザのアカウント情報や商品情報、ユーザによる投稿記事等のデータを保管するデータベース(DB)と、アプリケーションとで構成される。このアプリケーションは、サービスに合わせてデータベースに問い合わせ(クエリ)を発行し、データベースから返却されるデータを用いて、ユーザに提示する結果を作成する。   Today, with the explosion of the Internet, many services are provided through the Internet. Examples of services provided through the Internet include online shopping, online banking, social networking service (SNS), and the like. In most cases, a system that provides these services includes a database (DB) that stores data such as user account information, product information, and posted articles by the user, and an application. This application issues a query to the database in accordance with the service, and creates a result to be presented to the user by using data returned from the database.

これらのシステムでは、ユーザの増加等の原因によりデータベースヘのアクセス数が大
きく増加した場合、データベースの帯域幅やCPU(Central Processing Unit)資源を使い果たし、パフォーマンスの低下やサーバダウンが発生することがある。また、これらのシステムでは、アクセス数が増加しない場合でも、データベースへの問い合わせが複雑な場合、問い合わせの結果を返却するのに長い時間がかかってしまう。
In these systems, if the number of accesses to the database increases significantly due to an increase in the number of users, etc., the database bandwidth and CPU (Central Processing Unit) resources may be exhausted, resulting in performance degradation and server down. . In these systems, even if the number of accesses does not increase, if the query to the database is complicated, it takes a long time to return the query result.

そこで、上記のデータベースの処理負荷や参照性能の問題を解決する手法として、データベースとは別に、高速なアクセスが可能な記憶領域(キャッシュ)に、このデータベースヘの問い合わせ結果を利用して作られたデータを格納することが行われている。   Therefore, as a technique to solve the above-mentioned database processing load and reference performance problems, it was created by using this database query result in a storage area (cache) that can be accessed at high speed separately from the database. Data is being stored.

ここで、キャッシュからデータを取得する場合、アプリケーションは、必要なデータがキャッシュ上に存在するか否かを確認する。キャッシュ上に当該データが存在しなかった場合、データベースからデータを取得するのと同時に、キャッシュにユーザからのリクエストを関連付けたデータを格納する。以降、同じデータが必要になった場合、アプリケーションは、キャッシュからこのデータを読み出して利用する。これによって、データベースにアクセスする必要がなくなるため、キャッシュを用いたシステムでは、高速にデータを参照可能とする他、データベースヘのアクセス数を低減してデータベースの負荷を軽減することができる。   Here, when acquiring data from the cache, the application checks whether the necessary data exists on the cache. If the data does not exist in the cache, the data associated with the request from the user is stored in the cache at the same time as obtaining the data from the database. Thereafter, when the same data is needed, the application reads this data from the cache and uses it. This eliminates the need to access the database, so that a system using a cache can make it possible to refer to data at high speed and reduce the number of accesses to the database to reduce the load on the database.

一方、キャッシュを利用する場合、データベースに更新処理(登録、更新、削除)が発生すると、キャッシュに保存されたデータとデータベースに格納されたデータとに不整合が発生する可能性がある。例えば、データベースで更新されたデータをキャッシュで参照する場合、キャッシュに保存されたデータは更新されていないため、アプリケーションは、更新前の古いデータを参照してしまう。   On the other hand, when the cache is used, if update processing (registration, update, deletion) occurs in the database, inconsistency may occur between the data stored in the cache and the data stored in the database. For example, when referring to data updated in the database in the cache, the data stored in the cache is not updated, and thus the application refers to old data before update.

従来から、この問題を解決するために、データベースに対して更新が行われた際、キャッシュの一貫性(cache consistency)を保つためのキャッシュメンテナンス技術が提案さ
れている。
Conventionally, in order to solve this problem, a cache maintenance technique for maintaining cache consistency when a database is updated has been proposed.

この技術としては、キャッシュを破棄するものが提案されている(例えば、非特許文献1参照)。この非特許文献1に記載の方式では、データベースに対してキャッシュに不整合が発生するような更新が行われた場合、データベースがキャッシュに対して破棄メッセージを送信して、キャッシュで不整合が発生するデータを破棄し、キャッシュに保存された更新前のデータが参照されてしまうことを防止する。   As this technique, one that discards the cache has been proposed (see, for example, Non-Patent Document 1). In the method described in Non-Patent Document 1, when an update that causes inconsistency in the cache is performed on the database, the database transmits a discard message to the cache, and inconsistency occurs in the cache. Data to be discarded is prevented, and data before update stored in the cache is prevented from being referred to.

また、このキャッシュ破棄後に、データベースに再度問い合わせを行うことでキャッシュに保存された全データを入れ替えて最新に保つ、再問い合わせ方式も提案されている(例えば、非特許文献2参照)。   In addition, a re-inquiry method has also been proposed in which all data stored in the cache is replaced and kept up-to-date by making an inquiry to the database again after discarding the cache (see, for example, Non-Patent Document 2).

Greg Barish,Katia obraczka,“World Wide Web Caching: Trens and techniques",IEEE Communications Magazine 2000.5Greg Barish, Katia obraczka, “World Wide Web Caching: Trens and techniques”, IEEE Communications Magazine 2000.5 James Gwertzman,Margo Seltzer,“World Wide Web Cache Consistency",USENIX technical Conference,1996James Gwertzman, Margo Seltzer, “World Wide Web Cache Consistency”, USENIX technical Conference, 1996

しかし、前記した技術のいずれもが、データベースに対してキャッシュに不整合が発生するような更新が行われるたび、データベースがキャッシュに対して破棄メッセージを送信しなければならず処理負荷が大きかった。また、データベースは、データベースの更新内容およびデータベースを元に破棄メッセージの対象となるキャッシュを求めていた。このため、データベースは、実際にはキャッシュ上に存在しないキャッシュエントリの特定や、キャッシュエントリの破棄メッセージの送信処理を行う必要もあり、キャッシュメンテナンスの処理負荷が大きかった。   However, in any of the above-described techniques, the database has to send a discard message to the cache each time an update that causes inconsistency in the cache is performed on the database, which increases the processing load. In addition, the database seeks a cache to be a target of the discard message based on the update contents of the database and the database. For this reason, it is necessary for the database to identify a cache entry that does not actually exist in the cache and to transmit a cache entry discard message, and the processing load of cache maintenance is large.

そこで、本発明は、前記した課題を解決し、データベースのキャッシュメンテナンス処理の負荷を軽減することを目的とする。   Therefore, an object of the present invention is to solve the above-described problems and reduce the load of the cache maintenance processing of the database.

前記した課題を解決するため、本発明は、データベース装置から読み出されたデータのキャッシュを記憶するキャッシュ装置と、このキャッシュ装置とネットワーク経由で接続されたデータベース装置とを有するデータベースシステムにおいて、自身のデータベース装置のデータの更新処理が行われたとき、ネットワーク経由でキャッシュ装置におけるキャッシュの破棄メッセージを送信するデータベース装置であって、データを記憶するベーステーブルと、ベーステーブルに記憶されたデータのうち、キャッシュにキャッシュエントリのあるデータを示したキャッシュ管理テーブルとを記憶する。そして、データベース装置は、ネットワーク経由で、キャッシュ装置との間の各種情報の送受信を司る入出力部とを備え、ベーステーブルの更新処理が発生したとき、キャッシュ管理テーブルと、ベーステーブルの更新処理内容とを参照して、ベーステーブルの更新処理の影響を受けるデータのうち、キャッシュにキャッシュエントリが存在するデータを特定する。次に、データベース装置は、キャッシュ装置に対し、特定したデータのキャッシュエントリの破棄メッセージを送信する。そして、キャッシュ装置におけるキャッシュの更新情報を受信したとき、この更新情報に基づき、キャッシュ管理テーブルを更新する。   In order to solve the above-described problems, the present invention provides a database system having a cache device that stores a cache of data read from a database device, and a database device connected to the cache device via a network. When the database device data update process is performed, the database device transmits a cache discard message in the cache device via the network, and the base table for storing the data and the data stored in the base table, A cache management table indicating data having cache entries is stored in the cache. The database device includes an input / output unit that controls transmission / reception of various information to / from the cache device via the network, and when a base table update process occurs, the cache management table and the update process contents of the base table Referring to the above, among the data affected by the update process of the base table, data having a cache entry in the cache is specified. Next, the database device transmits a cache entry discard message for the specified data to the cache device. When cache update information is received in the cache device, the cache management table is updated based on the update information.

このようなデータベース装置は、ベーステーブルの更新処理の発生時、この更新処理の影響を受けるデータのうち、キャッシュ上にキャッシュエントリが存在するデータを特定する。そして、データベース装置は、この特定したデータのキャッシュエントリの破棄メッセージを、キャッシュ装置へ送信する。つまり、データベース装置は、キャッシュ装置のキャッシュ上に存在するキャッシュエントリを対象として破棄メッセージを送信するので、実際にはキャッシュ上に存在しないキャッシュエントリの特定を行う必要がなくなる。また、無駄な破棄メッセージを送信することがない。よって、データベース装置によるキャッシュメンテナンスの処理負荷を軽減することができる。   When such a database table update process occurs, such a database apparatus identifies data having a cache entry on the cache among data affected by the update process. Then, the database device transmits a cache entry discard message for the specified data to the cache device. In other words, the database device transmits a discard message for the cache entry existing on the cache of the cache device, so that it is not necessary to specify a cache entry that does not actually exist on the cache. Further, a useless discard message is not transmitted. Therefore, it is possible to reduce the processing load of cache maintenance by the database device.

また、本発明は、データベース装置を備えるデータベースシステムにおけるキャッシュ装置について、キャッシュの更新処理を監視し、ネットワーク経由で、キャッシュの更新情報をデータベース装置へ送信するキャッシュトラック部を備える構成とした。   According to the present invention, a cache device in a database system including a database device includes a cache track unit that monitors cache update processing and transmits cache update information to the database device via a network.

このようにすることで、データベース装置は、キャッシュ装置のキャッシュが更新されたとき、キャッシュ装置からその更新情報を受信できるので、キャッシュ上に存在する最新のキャッシュエントリを把握することができる。   In this way, when the cache of the cache device is updated, the database device can receive the update information from the cache device, so that the latest cache entry existing on the cache can be grasped.

また、本発明は、前記したデータベース装置と、キャッシュ装置を1以上含んでなることを特徴とするデータベースシステムとした。   According to the present invention, there is provided a database system including at least one of the above-described database device and a cache device.

このようにすることで、データベース装置によるキャッシュメンテナンスの処理負荷を軽減するデータベースシステムを実現することができる。   By doing so, it is possible to realize a database system that reduces the processing load of cache maintenance by the database device.

また、本発明は、キャッシュメンテナンス方法を、コンピュータであるデータベース装置に実行させるためのプログラムとした。   In the present invention, the cache maintenance method is a program for causing a database device, which is a computer, to execute.

このようにすることで、一般的なデータベース装置に、前記したキャッシュメンテナンス方法を実行させることができる。   By doing so, it is possible to cause a general database device to execute the above-described cache maintenance method.

本発明によれば、データベースにおけるキャッシュメンテナンスの負荷を軽減することができる。   According to the present invention, it is possible to reduce the load of cache maintenance in a database.

本実施の形態のデータベースシステムの構成例を示した図である。It is the figure which showed the structural example of the database system of this Embodiment. 図1のデータベースシステムの概要を概念的に示した図である。It is the figure which showed notionally the outline | summary of the database system of FIG. (a)は、図1のベーステーブルを例示した図であり、(b)は、キャッシュ作成用クエリを例示した図である。(A) is the figure which illustrated the base table of FIG. 1, (b) is the figure which illustrated the query for cache creation. 図1のキャッシュ管理テーブルを例示した図である。It is the figure which illustrated the cache management table of FIG. 図1のキャッシュを例示した図である。It is the figure which illustrated the cache of FIG. 図1のデータベース装置の処理手順を示した図である。It is the figure which showed the process sequence of the database apparatus of FIG. 図1のベーステーブル更新時の処理(S330)の詳細フローを示した図である。It is the figure which showed the detailed flow of the process (S330) at the time of base table update of FIG. 図1のベーステーブルの更新処理により影響を受けるキャッシュエントリの特定処理の例を説明した図である。FIG. 6 is a diagram for explaining an example of cache entry identification processing affected by the base table update processing of FIG. 1; 図7のベーステーブルの絞り込み処理(S420)の詳細フローを示した図である。FIG. 8 is a diagram showing a detailed flow of a base table narrowing-down process (S420) in FIG. 7; 図7のベーステーブルの絞り込み処理の例を示した図である。It is the figure which showed the example of the narrowing-down process of the base table of FIG. (a)は、図1のキャッシュ管理テーブルによるベーステーブルの絞り込みの問い合わせを例示した図であり、(b)は、絞り込み結果を例示した図である。(A) is the figure which illustrated the inquiry of narrowing down the base table by the cache management table of FIG. 1, (b) is the figure which illustrated the narrowing-down result. 本実施の形態のデータベースシステムの構成例を示した図である。It is the figure which showed the structural example of the database system of this Embodiment.

以下、本発明を実施するための形態(以下、実施の形態とする)について説明する。まず、図1を用いて本実施の形態のデータベースシステムの概要を説明する。データベースシステムは、データベース装置100と、キャッシュ231を備えるキャッシュ装置200と、データベース装置100のデータの更新リクエストや読み出しリクエストを送信する端末装置300とを含んで構成される。このデータベース装置100、キャッシュ装置200および端末装置300は、インターネット等のネットワーク400により接続される。キャッシュ装置200のキャッシュ231には、端末装置300からデータベース装置100ヘの読み出し結果を利用して作られたデータ(キャッシュエントリ)が格納される。そして、端末装置300が、キャッシュ231からデータを読み出す場合、キャッシュ231に当該データがあるか否かを判断し、当該データがない場合、データベース装置100からデータを読み出す。そして、キャッシュ装置200は、キャッシュ231に、端末装置300からのリクエストを関連付けたデータ(キャッシュエントリ)を格納する。以降、端末装置300からのリクエストが同じデータのリクエストであれば、キャッシュ231から、そのデータのキャッシュエントリを読み出して利用する。このデータベースシステムの詳細は後記する。   Hereinafter, modes for carrying out the present invention (hereinafter referred to as embodiments) will be described. First, the outline of the database system according to the present embodiment will be described with reference to FIG. The database system includes a database device 100, a cache device 200 including a cache 231, and a terminal device 300 that transmits a data update request or read request of the database device 100. The database device 100, the cache device 200, and the terminal device 300 are connected by a network 400 such as the Internet. The cache 231 of the cache device 200 stores data (cache entry) created using the read result from the terminal device 300 to the database device 100. When the terminal device 300 reads data from the cache 231, the terminal device 300 determines whether or not the data exists in the cache 231. If there is no data, the terminal device 300 reads data from the database device 100. Then, the cache device 200 stores data (cache entry) associated with the request from the terminal device 300 in the cache 231. Thereafter, if the request from the terminal device 300 is a request for the same data, the cache entry of the data is read from the cache 231 and used. Details of this database system will be described later.

次に、このようなデータベースシステムの動作概要を、図2を用いて説明する。まず、データベースシステムのデータベース装置100は、ベーステーブル1311の更新リクエストを受け付けると、(1)ベーステーブル1311のデータのうち、キャッシュ装置200のキャッシュ231上にキャッシュエントリがあるデータを絞り込む。ここでキャッシュ231上にキャッシュエントリがあるデータについては、キャッシュ管理テーブル1312に記録されている。よって、データベース装置100は、このキャッシュ管理テーブル1312を参照することで、ベーステーブル1311のどのデータに絞り込めばよいかが分かる。例えば、キャッシュ管理テーブル1312にkey値=d,e,fの記録があれば、これに基づき、ベーステーブル1311のデータのうち、このkey値=d,e,fを持つデータに絞り込めばよいことが分かる。   Next, an outline of the operation of such a database system will be described with reference to FIG. First, when the database apparatus 100 of the database system receives an update request for the base table 1311, (1) among the data of the base table 1311, the data having a cache entry on the cache 231 of the cache apparatus 200 is narrowed down. Here, data having a cache entry on the cache 231 is recorded in the cache management table 1312. Therefore, the database apparatus 100 can determine which data in the base table 1311 should be narrowed down by referring to the cache management table 1312. For example, if there is a record of key value = d, e, f in the cache management table 1312, based on this, the data in the base table 1311 may be narrowed down to data having this key value = d, e, f. I understand that.

次に、(2)データベース装置100は、ベーステーブル1311の更新処理の内容を参照して、ベーステーブル1311の更新処理により影響を受けるデータを特定する。例えば、更新処理の内容が、ベーステーブル1311に、auther_uid=bのデータを挿入、というものであれば、更新処理により影響を受けるデータは、ベーステーブル1311のto_uid=bを持つデータである。よって、(1)で絞り込まれたベーステーブル1311のデータの中から、このto_uid=bを持つデータ(from_uid=d,fを持つデータ)を特定する。   Next, (2) the database apparatus 100 refers to the contents of the update process of the base table 1311 and identifies data affected by the update process of the base table 1311. For example, if the content of the update process is that the data of “auther_uid = b” is inserted into the base table 1311, the data affected by the update process is data having to_uid = b of the base table 1311. Therefore, data having to_uid = b (data having from_uid = d, f) is specified from the data in the base table 1311 narrowed down in (1).

そして、(3)データベース装置100は、(2)で特定したデータを参照して、キャッシュ231から破棄するキャッシュエントリのkey値のリスト(例えば、key値=d,f)を作成し、キャッシュ装置200へ送信する。この後、キャッシュ装置200は、このリストに示されるキャッシュエントリを、キャッシュ231から破棄する。例えば、キャッシュ装置200は、データベース装置100から、key値=d,fを示したリスト(破棄メッセージ)を受信すると、このキャッシュ231から、このd,fをkey値とするキャッシュエントリを破棄する。   (3) The database device 100 refers to the data specified in (2), creates a list of key values of cache entries to be discarded from the cache 231 (for example, key value = d, f), and cache device 200. Thereafter, the cache device 200 discards the cache entry shown in this list from the cache 231. For example, when the cache device 200 receives a list (discard message) indicating the key value = d, f from the database device 100, the cache device 200 discards the cache entry having the key value d, f from the cache 231.

このように、データベース装置100はベーステーブル1311の更新処理の発生時、この更新処理の影響を受けるデータのうち、キャッシュ231上にキャッシュエントリが存在するデータを特定し、このデータのキャッシュエントリの破棄メッセージを、キャッシュ装置200へ送信する。つまり、データベース装置100は、キャッシュ装置200のキャッシュ231上に存在するキャッシュエントリを対象として破棄メッセージを送信するので、実際にはキャッシュ231上に存在しないキャッシュエントリの特定を行う必要がなくなる。また、無駄な破棄メッセージを送信することがなくなる。よって、データベース装置によるキャッシュメンテナンスの処理負荷を軽減することができる。   As described above, when the update process of the base table 1311 occurs, the database apparatus 100 identifies data having a cache entry on the cache 231 among the data affected by the update process, and discards the cache entry of this data. The message is transmitted to the cache device 200. That is, since the database apparatus 100 transmits a discard message for the cache entry existing on the cache 231 of the cache apparatus 200, it is not necessary to specify a cache entry that does not actually exist on the cache 231. In addition, a useless discard message is not transmitted. Therefore, it is possible to reduce the processing load of cache maintenance by the database device.

次に、図1に戻り、データベースシステムの構成を詳細に説明する。
<データベース装置>
データベース装置100は、ネットワーク400経由で通信可能なコンピュータにより実現され、入出力部110、記憶部130および処理部120を備える。入出力部110は、ネットワーク400経由で、端末装置300等から、このデータベース装置100のベーステーブル1311の更新リクエストや読み出しリクエストの入力を受け付けたり、キャッシュ231上のキャッシュエントリの破棄メッセージを送信したりするためのインタフェースである。記憶部130は、ベーステーブル1311およびキャッシュ管理テーブル1312からなるデータベース部131を備える。処理部120は、このデータベース装置100全体の制御を司り、ここでは主に、キャッシュ管理テーブル1312の更新や、ベーステーブル1311の更新処理後、この更新処理により影響を受けるデータを特定し、キャッシュ装置200へ、このデータのキャッシュエントリの破棄メッセージを送信する。
Next, returning to FIG. 1, the configuration of the database system will be described in detail.
<Database device>
The database apparatus 100 is realized by a computer that can communicate via the network 400, and includes an input / output unit 110, a storage unit 130, and a processing unit 120. The input / output unit 110 receives an input of an update request or read request for the base table 1311 of the database device 100 from the terminal device 300 or the like via the network 400, or transmits a cache entry discard message on the cache 231. It is an interface to do. The storage unit 130 includes a database unit 131 including a base table 1311 and a cache management table 1312. The processing unit 120 controls the entire database apparatus 100. In this case, after the update of the cache management table 1312 and the update process of the base table 1311, mainly the data affected by the update process is specified. A discard message for the cache entry of this data is transmitted to 200.

入出力部110は、通信インタフェースや入出力インタフェースから構成される。また、処理部120は、このデータベース装置100が備えるCPU(Central Processing Unit)によるプログラム実行処理や、専用回路等により実現される。さらに、記憶部130は、RAM(Random Access Memory)、ROM(Read Only Memory)、HDD(Hard Disk Drive)、フラッシュメモリ等の記憶媒体から構成される。なお、処理部120の機能をプログラム実行処理により実現する場合、記憶部130には、このデータベース装置100の機能を実現するためのプログラムが格納される。   The input / output unit 110 includes a communication interface and an input / output interface. The processing unit 120 is realized by a program execution process by a CPU (Central Processing Unit) included in the database apparatus 100, a dedicated circuit, or the like. Further, the storage unit 130 includes a storage medium such as a random access memory (RAM), a read only memory (ROM), a hard disk drive (HDD), and a flash memory. When the function of the processing unit 120 is realized by program execution processing, the storage unit 130 stores a program for realizing the function of the database device 100.

記憶部130は、前記したとおりベーステーブル1311およびキャッシュ管理テーブル1312からなるデータベース部131を備える。   The storage unit 130 includes the database unit 131 including the base table 1311 and the cache management table 1312 as described above.

ベーステーブル1311は、1以上のデータを記憶するテーブルである。ベーステーブル1311は、例えば、図3(a)に示すmessageテーブル、followerテーブルのように複数であってもよい。なお、図3(a)に示すmessageテーブルはmessage_idごとに、そのメッセージのauther_uid(作成者)およびbody(本文)を示したテーブルである。followerテーブルはfrom_uid(メッセージの送信元ユーザ)ごとに、to_uid(メッセージの送信先ユーザ)を示したテーブルである。なお、このベーステーブル1311に対し、ベーステーブル処理部121は、キャッシュ作成用クエリ(キャッシュ231に格納するキャッシュエントリを作成するためのクエリ)として、例えば、図3(b)に示すクエリを作成する。このキャッシュ作成用クエリは、[UID]をパラメータとするプリペアードクエリであり、messageテーブルおよびfollowerテーブルから、followerテーブルのfrom_uidが、[UID](指定されたユーザID)のデータで、かつ、そのデータのto_uidが、messageテーブルのauthor_uidと同じuidであるデータのmessage_idを探すというクエリである。なお、パラメータ(例えば、[UID])で指定されたベーステーブル1311の属性をパラメータ属性という。前記した例では、followerテーブルのfrom_uidがパラメータ属性である。   The base table 1311 is a table that stores one or more data. There may be a plurality of base tables 1311 such as a message table and a follower table shown in FIG. Note that the message table shown in FIG. 3A is a table indicating the authenticator_uid (creator) and body (body) of the message for each message_id. The follower table is a table indicating to_uid (message transmission destination user) for each from_uid (message transmission source user). For this base table 1311, the base table processing unit 121 creates, for example, a query shown in FIG. 3B as a cache creation query (query for creating a cache entry stored in the cache 231). . This cache creation query is a prepared query with [UID] as a parameter. From the message table and follower table, the from_uid of the follower table is [UID] (specified user ID) data, and the data Is a query that searches for the message_id of the data whose to_uid is the same uid as the author_uid of the message table. Note that the attribute of the base table 1311 specified by a parameter (for example, [UID]) is referred to as a parameter attribute. In the above example, from_uid of the follower table is a parameter attribute.

図1のキャッシュ管理テーブル1312は、キャッシュ装置200のキャッシュ231上に存在するキャッシュエントリを示した情報である。このキャッシュ管理テーブル1312は、例えば、図4に示すようにキャッシュ231上に存在するキャッシュエントリのkey値を示した情報である。このキャッシュ管理テーブル1312は、キャッシュエントリ特定部123(後記)が、ベーステーブル1311のデータの絞り込みを行う際に参照される。   The cache management table 1312 in FIG. 1 is information indicating cache entries existing on the cache 231 of the cache device 200. The cache management table 1312 is information indicating the key value of the cache entry existing on the cache 231 as shown in FIG. The cache management table 1312 is referred to when the cache entry specifying unit 123 (described later) narrows down data in the base table 1311.

図1の処理部120は、ベーステーブル処理部121と、キャッシュ管理テーブル更新部122と、キャッシュエントリ特定部123と、キャッシュメンテナンス部124とを備える。   The processing unit 120 in FIG. 1 includes a base table processing unit 121, a cache management table updating unit 122, a cache entry specifying unit 123, and a cache maintenance unit 124.

ベーステーブル処理部121は、入出力部110経由で、端末装置300等からベーステーブル1311のデータの更新リクエスト(更新問い合わせ)や読み出しリクエストを受け付ける。そしてこれらのリクエストに応じて、ベーステーブル1311のデータの更新や読み出しを実行する。そして、ベーステーブル処理部121は、その実行結果を、キャッシュ装置200へ送信し、キャッシュ装置200は、キャッシュ231上にキャッシュエントリを追加する。なお、更新リクエスト(更新問い合わせ)は、例えば、ベーステーブル1311に対するINSERT、UPDATE、DELETE等である。   The base table processing unit 121 receives an update request (update inquiry) or a read request for data of the base table 1311 from the terminal device 300 or the like via the input / output unit 110. In response to these requests, the base table 1311 is updated or read. Then, the base table processing unit 121 transmits the execution result to the cache device 200, and the cache device 200 adds a cache entry on the cache 231. Note that the update request (update inquiry) is, for example, INSERT, UPDATE, DELETE, or the like for the base table 1311.

キャッシュ管理テーブル更新部122は、キャッシュ装置200のキャッシュトラック部223(後記)により、キャッシュ231上に存在するキャッシュエントリの情報を取得し、この情報をキャッシュ管理テーブル1312に記録する。つまり、キャッシュ管理テーブル1312を更新する。   The cache management table update unit 122 acquires information on the cache entry existing on the cache 231 by the cache track unit 223 (described later) of the cache device 200 and records this information in the cache management table 1312. That is, the cache management table 1312 is updated.

キャッシュエントリ特定部123は、ベーステーブル1311を監視し、ベーステーブル1311の更新処理が発生すると、その更新処理内容(例えば、更新されたベーステーブル1311の識別情報およびこのベーステーブル1311において更新されたレコード)を、記憶部130の所定領域に記憶する。そして、キャッシュ管理テーブル1312と、ベーステーブル1311の更新処理内容とを参照して、キャッシュ231に記憶されたデータのうち、この更新処理の対象となるデータに関するキャッシュエントリを特定する。具体的には、キャッシュエントリ特定部123は、まず、キャッシュ管理テーブル1312を参照して、ベーステーブル1311のデータのうち、キャッシュ231上にキャッシュエントリのあるデータ(レコード)を絞り込む。そして、キャッシュエントリ特定部123は、ベーステーブル1311の更新処理内容から、ベーステーブル1311の更新により影響を受けるデータ(例えば、更新されるデータのkey値と同じkey値を持つデータ)のキャッシュエントリを特定する。   The cache entry specifying unit 123 monitors the base table 1311. When update processing of the base table 1311 occurs, the update processing content (for example, the identification information of the updated base table 1311 and the record updated in the base table 1311) ) Is stored in a predetermined area of the storage unit 130. Then, with reference to the cache management table 1312 and the update processing content of the base table 1311, the cache entry related to the data to be updated is specified among the data stored in the cache 231. Specifically, the cache entry specifying unit 123 first refers to the cache management table 1312 and narrows down data (records) having a cache entry on the cache 231 among the data of the base table 1311. Then, the cache entry specifying unit 123 obtains the cache entry of the data affected by the update of the base table 1311 (for example, data having the same key value as the key value of the updated data) from the update processing contents of the base table 1311. Identify.

キャッシュメンテナンス部124は、キャッシュエントリ特定部123が特定したキャッシュエントリの破棄を指示する破棄メッセージをキャッシュ装置200へ送信する。また、キャッシュメンテナンス部124は、ベーステーブル処理部121において、端末装置300からのリクエストに応じ、ベーステーブル1311のデータの更新や読み出しを実行したとき、その実行結果を示すキャッシュエントリの追加を指示する追加メッセージをキャッシュ装置200へ送信する。   The cache maintenance unit 124 transmits a discard message instructing the discard of the cache entry specified by the cache entry specifying unit 123 to the cache device 200. In addition, when the base table processing unit 121 updates or reads data in the base table 1311 in response to a request from the terminal device 300, the cache maintenance unit 124 instructs addition of a cache entry indicating the execution result. An additional message is transmitted to the cache device 200.

<キャッシュ装置>
キャッシュ装置200は、データベース装置100のキャッシュ231を備え、このキャッシュ231上に新たなキャッシュエントリを追加(セット)したり、所定のキャッシュエントリを破棄(エクスパイヤ)したり、読み出し(ゲットし)たりする。このキャッシュ装置200は、ネットワーク400経由で通信可能なコンピュータにより実現され、入出力部210、記憶部230および処理部220を備える。
<Cache device>
The cache device 200 includes the cache 231 of the database device 100, and a new cache entry is added (set), a predetermined cache entry is discarded (expire), and read (get) is performed on the cache 231. . The cache device 200 is realized by a computer that can communicate via the network 400, and includes an input / output unit 210, a storage unit 230, and a processing unit 220.

入出力部210は、ネットワーク400経由で、端末装置300等から、データの更新や読み出しのリクエストの入力を受け付けたり、データベース装置100から、キャッシュエントリの破棄メッセージや追加メッセージ、キャッシュイン・アウト結果(キャッシュ231の更新処理結果)を出力したりするためのインタフェースである。記憶部230は、キャッシュ231を記憶する。処理部220は、キャッシュ装置200全体の制御を司り、ここでは主に、データベース装置100からの指示に従いキャッシュ231上のキャッシュエントリの追加や削除を行う。また、処理部220は、このキャッシュ231上のキャッシュエントリを監視し、その監視結果をデータベース装置100へ送信する。   The input / output unit 210 receives an input of a data update or read request from the terminal device 300 or the like via the network 400, or receives a cache entry discard message or an additional message, a cache in / out result (from the database device 100) This is an interface for outputting the update processing result of the cache 231). The storage unit 230 stores a cache 231. The processing unit 220 controls the entire cache device 200, and here, mainly adds or deletes cache entries in the cache 231 in accordance with instructions from the database device 100. Further, the processing unit 220 monitors the cache entry on the cache 231 and transmits the monitoring result to the database device 100.

入出力部210は、通信インタフェースや入出力インタフェースから構成される。また、処理部220は、このキャッシュ装置200が備えるCPUによるプログラム実行処理や、専用回路等により実現される。さらに、記憶部230は、RAMやHDD等の記憶媒体から構成される。なお、キャッシュ231は、例えば、この記憶部230のRAM上に形成される。キャッシュ装置200の処理部220の機能をプログラム実行処理により実現する場合、記憶部230には、処理部220の機能を実現するためのプログラムが格納される。   The input / output unit 210 includes a communication interface and an input / output interface. The processing unit 220 is realized by a program execution process by a CPU provided in the cache device 200, a dedicated circuit, or the like. Furthermore, the storage unit 230 includes a storage medium such as a RAM or an HDD. The cache 231 is formed on the RAM of the storage unit 230, for example. When the function of the processing unit 220 of the cache device 200 is realized by program execution processing, the storage unit 230 stores a program for realizing the function of the processing unit 220.

記憶部230は、1以上のキャッシュエントリからなるキャッシュ231を備える。キャッシュエントリとは、キャッシュ231における記憶単位である。このキャッシュ231は、例えば、図5に示すように、key値(ベーステーブル1311のデータの読み出し要求に用いたkey値)ごとに、そのkey値に用いて読み出したデータの値(value)を示した情報である。ここでは、1つのkey値に対するvalueを1つのキャッシュエントリとする。   The storage unit 230 includes a cache 231 including one or more cache entries. A cache entry is a storage unit in the cache 231. For example, as shown in FIG. 5, the cache 231 indicates the value (value) of data read using the key value (key value used for the data read request of the base table 1311) for each key value. Information. Here, the value for one key value is one cache entry.

処理部220は、キャッシュ処理部221と、キャッシュ更新部222と、キャッシュトラック部223とを備える。   The processing unit 220 includes a cache processing unit 221, a cache update unit 222, and a cache track unit 223.

キャッシュ処理部221は、端末装置300等からのリクエストに応じて、キャッシュ231のキャッシュエントリを読み出し処理等を実行する。そして、その結果をリクエストの送信元へ返す。なお、キャッシュ231上にリクエストの対象データのキャッシュエントリがなかった場合、その旨をリクエストの送信元へ返す。   In response to a request from the terminal device 300 or the like, the cache processing unit 221 reads a cache entry in the cache 231 and executes a process or the like. Then, the result is returned to the request transmission source. If there is no cache entry for the target data of the request on the cache 231, a message to that effect is returned to the request source.

キャッシュ更新部222は、データベース装置100からの破棄メッセージに従い、キャッシュ231上のキャッシュエントリを破棄(エクスパイヤ)する。また、データベース装置100から追加メッセージを受信したときには、これに従い、キャッシュ231上にキャッシュエントリを追加(セット)する。なお、キャッシュ更新部222は、キャッシュ231上のキャッシュエントリの総容量が所定量を超えたときに、一部のキャッシュエントリを破棄するようにしてもよい。このときのアルゴリズムは、例えば、LRU(Least Recently Used)やMRU(Most Recently Used)を用いる。なお、以下の説明において、キャッシュ231上に新たなキャッシュエントリが追加されることをキャッシュインといい、キャッシュ231上のキャッシュエントリが破棄されることをキャッシュアウトという。また、キャッシュインまたはキャッシュアウトが行われることを、まとめてキャッシュイン・アウトと表記する。   The cache update unit 222 discards (expires) the cache entry on the cache 231 in accordance with the discard message from the database device 100. When an addition message is received from the database apparatus 100, a cache entry is added (set) on the cache 231 accordingly. Note that the cache updating unit 222 may discard some cache entries when the total capacity of the cache entries on the cache 231 exceeds a predetermined amount. As an algorithm at this time, for example, LRU (Least Recently Used) or MRU (Most Recently Used) is used. In the following description, adding a new cache entry on the cache 231 is referred to as cache-in, and discarding a cache entry on the cache 231 is referred to as cache-out. In addition, cash-in or cash-out is collectively referred to as cash-in / out.

キャッシュトラック部223は、キャッシュ231を監視し、キャッシュ231上に存在するキャッシュエントリの情報をデータベース装置100へ送信する。例えば、キャッシュ231の更新処理が行われたとき、この更新処理後のキャッシュ231上のキャッシュエントリの情報をデータベース装置100へ送信する。なお、データベース装置100のキャッシュ管理テーブル更新部122は、このキャッシュエントリの情報を受信すると、この情報をキャッシュ管理テーブル1312に記録する。   The cache track unit 223 monitors the cache 231 and transmits information on cache entries existing on the cache 231 to the database device 100. For example, when the cache 231 is updated, the cache entry information on the cache 231 after the update process is transmitted to the database device 100. When the cache management table update unit 122 of the database device 100 receives the information on the cache entry, the cache management table update unit 122 records the information in the cache management table 1312.

<処理手順>
次に、図6を用いて図1のデータベース装置100の処理手順を説明する。まず、データベース装置100は、ベーステーブル1311の更新か、キャッシュ装置200のキャッシュ231のキャッシュ更新(キャッシュイン・アウト)が発生するまで待機し(S310)、ベーステーブル1311の更新発生を検出したとき(S320の“ベーステーブルの更新が発生”)、ベーステーブル1311の更新時の処理を実行する(S330)。つまり、データベース装置100のベーステーブル処理部121が、端末装置300等から、ベーステーブル1311の更新処理要求を受信し、これに基づきベーステーブル1311の更新処理したとき、S330の処理を実行する。そして、S350へ進む。
<Processing procedure>
Next, the processing procedure of the database apparatus 100 of FIG. 1 will be described using FIG. First, the database apparatus 100 waits until an update of the base table 1311 or a cache update (cache in / out) of the cache 231 of the cache apparatus 200 occurs (S310), and detects an update of the base table 1311 (S310). The processing at the time of updating the base table 1311 is executed (“Update of base table occurs” in S320) (S330). That is, when the base table processing unit 121 of the database apparatus 100 receives an update process request for the base table 1311 from the terminal apparatus 300 or the like, and performs an update process for the base table 1311 based on this request, the process of S330 is executed. Then, the process proceeds to S350.

一方、データベース装置100は、キャッシュ装置200のキャッシュ231の更新処理(キャッシュイン・アウト)の発生を検出したとき(S320の“キャッシュ更新が発生”)、データベース装置100のキャッシュ管理テーブル更新部122は、キャッシュ管理テーブル1312を更新する(S340)。つまり、キャッシュ装置200のキャッシュトラック部223は、キャッシュ231のキャッシュイン・アウトを監視し、キャッシュイン・アウトの発生を検出すると、そのキャッシュイン・アウト結果を、データベース装置100へ通知する。データベース装置100のキャッシュ管理テーブル更新部122は、このキャッシュイン・アウト結果に基づき、キャッシュ管理テーブル1312(図4参照)に、キャッシュ231上に存在するキャッシュエントリの情報を記録する。   On the other hand, when the database apparatus 100 detects the occurrence of update processing (cache in / out) of the cache 231 of the cache apparatus 200 (“cache update occurs” in S320), the cache management table update unit 122 of the database apparatus 100 The cache management table 1312 is updated (S340). That is, the cache track unit 223 of the cache device 200 monitors the cache in / out of the cache 231 and, when detecting the occurrence of the cache in / out, notifies the database device 100 of the cache in / out result. The cache management table updating unit 122 of the database device 100 records the information of the cache entry existing on the cache 231 in the cache management table 1312 (see FIG. 4) based on the cache in / out result.

そして、データベース装置100は処理の終了命令等の入力があると(S350のYes)、処理を終了し、終了命令等の入力がなければ(S350のNo)、S310へ戻る。   Then, the database apparatus 100 ends the process when there is an input of a process end command or the like (Yes in S350), and returns to S310 if there is no input of the end command or the like (No in S350).

次に、図7を用いて、図6のベーステーブル更新時の処理(S330)の詳細を説明する。まず、図1のデータベース装置100のベーステーブル処理部121は、ベーステーブル1311の更新を受け付ける(S410)。そして、ベーステーブル処理部121は、これに基づきベーステーブル1311を更新する。ここで、キャッシュエントリ特定部123は、ベーステーブル1311を監視し、ベーステーブル1311の更新処理内容(例えば、更新されたベーステーブル1311の識別情報および更新されたレコード)を、記憶部130の所定領域に記憶する。   Next, details of the process (S330) at the time of updating the base table in FIG. 6 will be described with reference to FIG. First, the base table processing unit 121 of the database apparatus 100 in FIG. 1 receives an update of the base table 1311 (S410). Then, the base table processing unit 121 updates the base table 1311 based on this. Here, the cache entry specifying unit 123 monitors the base table 1311, and updates the processing contents of the base table 1311 (for example, updated identification information and updated records of the base table 1311) in a predetermined area of the storage unit 130. To remember.

続いて、データベース装置100のキャッシュエントリ特定部123は、キャッシュ管理テーブル1312を用いて、ベーステーブル1311中からレコード(データ)を絞り込む(S420)。すなわち、キャッシュ管理テーブル1312を用いて、ベーステーブル1311中から、キャッシュ231上に存在するキャッシュエントリに関するレコードを絞り込む。このレコードの絞り込み処理の詳細は後記する。   Subsequently, the cache entry specifying unit 123 of the database device 100 narrows down records (data) from the base table 1311 using the cache management table 1312 (S420). That is, the cache management table 1312 is used to narrow records relating to cache entries existing on the cache 231 from the base table 1311. Details of the record narrowing process will be described later.

次に、キャッシュエントリ特定部123は、ベーステーブル1311の更新により影響を受けるキャッシュエントリを特定する(S430)。すなわち、キャッシュエントリ特定部123は、記憶部130に記憶されたベーステーブル1311の更新処理内容およびS420におけるベーステーブル1311の絞り込み結果をもとに、ベーステーブル1311の更新処理により影響を受けるキャッシュエントリを特定する。   Next, the cache entry specifying unit 123 specifies a cache entry affected by the update of the base table 1311 (S430). That is, the cache entry specifying unit 123 selects the cache entry affected by the update process of the base table 1311 based on the update process contents of the base table 1311 stored in the storage unit 130 and the narrowing result of the base table 1311 in S420. Identify.

例えば、図8の(a)に示すように、messageテーブルに符号1001に示すレコードが挿入され、図7のS420で、絞り込まれたfollowerテーブルのデータが符号1002に示すデータであった場合、キャッシュエントリ特定部123は、例えば、図8の(b)に示すようなキャッシュ破棄用クエリを発行する。このキャッシュ破棄用クエリは、絞り込まれたfollowerテーブルのto_uid=bをパラメータとし、このto_uid=bを持つレコードのfrom_uidの値からkey値を選択することを指示するプリペアードクエリである。ここで、followerテーブルから、to_uid=bの値を持つレコードのfrom_uidの値は「d,f」であるので、破棄対象のキャッシュエントリの特定結果として「d,f」を得る。   For example, as shown in FIG. 8A, when the record indicated by reference numeral 1001 is inserted into the message table and the narrowed-down follower table data is the data indicated by reference numeral 1002 in S420 of FIG. For example, the entry specifying unit 123 issues a cache discarding query as illustrated in FIG. This cache discarding query is a prepared query that instructs to select a key value from the from_uid value of a record having the to_uid = b with the to_uid = b of the narrowed follower table as a parameter. Here, from the follower table, since the value of from_uid of the record having the value of to_uid = b is “d, f”, “d, f” is obtained as the identification result of the cache entry to be discarded.

図7の説明に戻る。S430で、キャッシュエントリ特定部123が、キャッシュエントリの特定をした後、キャッシュメンテナンス部124は、キャッシュ装置200に対して、S430で特定した破棄メッセージを送信する(S440)。この破棄メッセージを受信したキャッシュ装置200は、この破棄メッセージに示されるキャッシュエントリを破棄する。そして、ベーステーブル1311の更新処理がまだ終了していなければ(S450のNo)、S410へ戻り、ベーステーブル1311の更新処理が終了していれば(S450のYes)、処理を終了する。   Returning to the description of FIG. After the cache entry specifying unit 123 specifies the cache entry in S430, the cache maintenance unit 124 transmits the discard message specified in S430 to the cache device 200 (S440). The cache device 200 that has received the discard message discards the cache entry indicated by the discard message. If the update process of the base table 1311 has not been completed yet (No in S450), the process returns to S410. If the update process of the base table 1311 has been completed (Yes in S450), the process ends.

このようにすることで、データベース装置100は、キャッシュ装置200に対し、キャッシュ装置200のキャッシュ231上に存在するキャッシュエントリのうち、ベーステーブル1311の更新により影響を受けるキャッシュエントリを破棄させることができる。   By doing so, the database apparatus 100 can cause the cache apparatus 200 to discard the cache entries that are affected by the update of the base table 1311 among the cache entries existing on the cache 231 of the cache apparatus 200. .

ここで、図9を用いて、図7のS420の処理の詳細を説明する。まず、図1のデータベース装置100のキャッシュエントリ特定部123は、キャッシュ管理テーブル1312を読み出す(S1010)。つまり、キャッシュ231上に存在するキャッシュエントリのkey値のリストを読み出す。そして、キャッシュエントリ特定部123は、パラメータ属性を含むベーステーブル1311を選択する(S1020)。例えば、図3(b)に示すキャッシュ作成用クエリにおけるパラメータ属性は、followerテーブルのfrom_uidなので、キャッシュ管理テーブル1312は、followerテーブルを選択する。そして、選択したベーステーブル1311のレコードをキャッシュ管理テーブル1312の内容に基づいて選択(SELECT)する(S1030)。例えば、キャッシュエントリ特定部123が、図10に示すキャッシュ管理テーブル1312を用いて、ベーステーブル1311(followerテーブル)のレコードの絞り込みを行う場合、図11(a)に示すようなベーステーブル1311の絞り込みの問い合わせを発行する。つまり、followerテーブルを選択し、このfollowerテーブルのfrom_uidをパラメータ属性として、キャッシュ管理テーブル1312に記録されるkey値と同じ値のレコードを絞り込む問い合わせを発行する。この問い合わせをもとに、followerテーブルから、from_uid=d,e,fのレコードを検索し、図11の(b)に示すような絞り込み結果を得る。   Here, the details of the process of S420 in FIG. 7 will be described with reference to FIG. First, the cache entry specifying unit 123 of the database apparatus 100 in FIG. 1 reads the cache management table 1312 (S1010). That is, a list of key values of cache entries existing on the cache 231 is read. Then, the cache entry specifying unit 123 selects the base table 1311 including the parameter attribute (S1020). For example, since the parameter attribute in the cache creation query shown in FIG. 3B is from_uid of the follower table, the cache management table 1312 selects the follower table. Then, the selected record of the base table 1311 is selected (SELECT) based on the contents of the cache management table 1312 (S1030). For example, when the cache entry specifying unit 123 uses the cache management table 1312 illustrated in FIG. 10 to narrow down records in the base table 1311 (follower table), the base table 1311 as illustrated in FIG. Issue an inquiry. That is, a follower table is selected, and an inquiry for narrowing down records having the same value as the key value recorded in the cache management table 1312 is issued using the from_uid of the follower table as a parameter attribute. Based on this inquiry, a record of from_uid = d, e, f is searched from the follower table, and a narrowing result as shown in FIG. 11B is obtained.

図9の説明に戻る。データベース装置100のキャッシュエントリ特定部123は、すべてのベーステーブル1311の処理を終了すると(S1040のYes)、S420の処理を終了する。一方、まだ処理していないベーステーブル1311があれば(S1040のNo)、S1010へ戻る。   Returning to the description of FIG. When the cache entry specifying unit 123 of the database device 100 finishes processing of all the base tables 1311 (Yes in S1040), the cache entry specifying unit 123 ends the processing of S420. On the other hand, if there is a base table 1311 that has not been processed yet (No in S1040), the process returns to S1010.

このようにすることで、キャッシュエントリ特定部123は、ベーステーブル1311のレコードを、キャッシュ231上に存在するキャッシュエントリに関するレコードに絞り込むことができる。   In this way, the cache entry specifying unit 123 can narrow down records in the base table 1311 to records relating to cache entries existing on the cache 231.

以上説明したデータベース装置100によれば、ベーステーブル1311の更新処理により影響を受けるデータのキャッシュエントリのうち、実際にキャッシュ231に存在するキャッシュエントリの破棄メッセージを、キャッシュ装置200へ送信することができる。つまり、データベース装置100はキャッシュ装置200に対し、必要以上に多くのキャッシュエントリの破棄メッセージを送信する必要がなくなるので、キャッシュ231のキャッシュメンテナンスの負荷を軽減することができる。   According to the database device 100 described above, a cache entry discard message that actually exists in the cache 231 among the cache entries of data affected by the update process of the base table 1311 can be transmitted to the cache device 200. . In other words, the database device 100 does not need to send more cache entry discard messages than necessary to the cache device 200, so that the cache maintenance load on the cache 231 can be reduced.

なお、データベースシステムにおけるキャッシュ装置200は、図12に示すように複数台用あってもよい。この場合、データベース装置100は、各キャッシュ装置200のキャッシュトラック部223から、送信元のキャッシュ装置200の識別情報と、そのキャッシュ装置200のキャッシュ231のキャッシュイン・アウト結果とを受信し、キャッシュ管理テーブル1312を更新する。これにより、キャッシュ管理テーブル1312には、各キャッシュ231上に存在するキャッシュエントリの情報とともに、各キャッシュエントリがどのキャッシュ装置200に存在するかが記録される。このようなキャッシュ管理テーブル1312を参照することで、データベース装置100は、当該キャッシュエントリのあるキャッシュ装置200に対し破棄メッセージを送信することができる。   Note that a plurality of cache devices 200 in the database system may be provided as shown in FIG. In this case, the database device 100 receives the identification information of the transmission source cache device 200 and the cache in / out result of the cache 231 of the cache device 200 from the cache track unit 223 of each cache device 200, and performs cache management. The table 1312 is updated. As a result, in the cache management table 1312, the cache device 200 in which each cache entry exists is recorded along with information on the cache entry existing in each cache 231. By referring to such a cache management table 1312, the database apparatus 100 can transmit a discard message to the cache apparatus 200 having the cache entry.

100 データベース装置
110,210 入出力部
120,220 処理部
121 ベーステーブル処理部
122 キャッシュ管理テーブル更新部
123 キャッシュエントリ特定部
124 キャッシュメンテナンス部
130,230 記憶部
131 データベース部
200 キャッシュ装置
221 キャッシュ処理部
222 キャッシュ更新部
223 キャッシュトラック部
231 キャッシュ
300 端末装置
400 ネットワーク
1311 ベーステーブル
1312 キャッシュ管理テーブル
DESCRIPTION OF SYMBOLS 100 Database apparatus 110,210 Input / output part 120,220 Processing part 121 Base table processing part 122 Cache management table update part 123 Cache entry specification part 124 Cache maintenance part 130,230 Storage part 131 Database part 200 Cache apparatus 221 Cache processing part 222 Cache update unit 223 Cache track unit 231 Cache 300 Terminal device 400 Network 1311 Base table 1312 Cache management table

Claims (5)

データベース装置から読み出されたデータのキャッシュを備えるキャッシュ装置と、前記キャッシュ装置とネットワーク経由で接続された前記データベース装置とを有するデータベースシステムにおいて、自身のデータベース装置のデータの更新処理が行われたとき、前記ネットワーク経由で前記キャッシュ装置におけるキャッシュの破棄メッセージを送信するデータベース装置であって、
前記データを記憶するベーステーブルと、このベーステーブルに記憶されたデータのうち、前記キャッシュにキャッシュエントリのあるデータを示したキャッシュ管理テーブルとを記憶する記憶部と、
前記ネットワーク経由で、前記キャッシュ装置との間で各種情報の送受信を司る入出力部と、
前記ベーステーブルの更新処理が発生したとき、前記キャッシュ管理テーブルと、前記ベーステーブルの更新処理内容とを参照して、前記ベーステーブルの更新処理の影響を受けるデータのうち、前記キャッシュにキャッシュエントリが存在するデータを特定するキャッシュエントリ特定部と、
前記入出力部経由で、前記キャッシュ装置に対し、前記特定したデータのキャッシュエントリの破棄メッセージを送信するキャッシュメンテナンス部と、
前記入出力部経由で、前記キャッシュ装置におけるキャッシュの更新情報を受信したとき、前記更新情報に基づき、前記キャッシュ管理テーブルを更新するキャッシュ管理テーブル更新部とを備えることを特徴とするデータベース装置。
In a database system having a cache device having a cache of data read from the database device, and the database device connected to the cache device via a network, data update processing of its own database device is performed A database device for sending a cache discard message in the cache device via the network,
A storage unit for storing a base table for storing the data, and a cache management table indicating data having a cache entry in the cache among the data stored in the base table;
An input / output unit that manages transmission and reception of various information to and from the cache device via the network;
When the update process of the base table occurs, a cache entry is stored in the cache among the data affected by the update process of the base table with reference to the cache management table and the update process content of the base table. A cache entry specifying unit for specifying existing data;
A cache maintenance unit that sends a cache entry discard message for the specified data to the cache device via the input / output unit;
A database device comprising: a cache management table update unit that updates the cache management table based on the update information when cache update information in the cache device is received via the input / output unit.
請求項1に記載のデータベース装置を備えるデータベースシステムにおけるキャッシュ装置であって、
前記キャッシュの更新処理を監視し、前記ネットワーク経由で、前記キャッシュの更新情報を前記データベース装置へ送信するキャッシュトラック部を備えることを特徴とするキャッシュ装置。
A cache device in a database system comprising the database device according to claim 1,
A cache device, comprising: a cache track unit that monitors the cache update process and transmits the cache update information to the database device via the network.
請求項1に記載のデータベース装置と、請求項2に記載のキャッシュ装置を1以上含んでなることを特徴とするデータベースシステム。   A database system comprising the database device according to claim 1 and one or more cache devices according to claim 2. データベース装置から読み出されたデータのキャッシュを備えるキャッシュ装置と、前記キャッシュ装置とネットワーク経由で接続された前記データベース装置とを有するデータベースシステムにおいて、自身のデータベース装置のデータの更新処理が行われたとき、前記ネットワーク経由で前記キャッシュ装置におけるキャッシュの破棄メッセージを送信し、前記データを記憶するベーステーブルと、このベーステーブルに記憶されたデータのうち、前記キャッシュにキャッシュエントリのあるデータを示したキャッシュ管理テーブルとを記憶する記憶部を備えるデータベース装置が、
前記ベーステーブルの更新処理が発生したとき、前記キャッシュ管理テーブルと、前記ベーステーブルの更新処理内容とを参照して、前記ベーステーブルの更新処理の影響を受けるデータのうち、前記キャッシュにキャッシュエントリが存在するデータを特定するステップと、
前記キャッシュ装置に対し、前記特定したデータのキャッシュエントリの破棄メッセージを送信するステップと、
前記キャッシュ装置におけるキャッシュの更新情報を受信したとき、前記更新情報に基づき、前記キャッシュ管理テーブルを更新するステップとを実行するキャッシュメンテナンス方法。
In a database system having a cache device having a cache of data read from the database device, and the database device connected to the cache device via a network, data update processing of its own database device is performed A cache discard message in the cache device via the network, and a base table for storing the data, and cache management indicating data having a cache entry in the cache among the data stored in the base table A database device including a storage unit for storing a table,
When the update process of the base table occurs, a cache entry is stored in the cache among the data affected by the update process of the base table with reference to the cache management table and the update process content of the base table. Identifying the existing data;
Sending a cache entry discard message for the specified data to the cache device;
A cache maintenance method for executing a step of updating the cache management table based on the update information when cache update information is received in the cache device.
請求項4に記載のキャッシュメンテナンス方法を、コンピュータである前記データベース装置に実行させるためのプログラム。   The program for making the said database apparatus which is a computer perform the cache maintenance method of Claim 4.
JP2009175924A 2009-07-28 2009-07-28 Database apparatus, database system, cache maintenance method and program thereof Expired - Fee Related JP5071990B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009175924A JP5071990B2 (en) 2009-07-28 2009-07-28 Database apparatus, database system, cache maintenance method and program thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009175924A JP5071990B2 (en) 2009-07-28 2009-07-28 Database apparatus, database system, cache maintenance method and program thereof

Publications (2)

Publication Number Publication Date
JP2011028658A true JP2011028658A (en) 2011-02-10
JP5071990B2 JP5071990B2 (en) 2012-11-14

Family

ID=43637299

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009175924A Expired - Fee Related JP5071990B2 (en) 2009-07-28 2009-07-28 Database apparatus, database system, cache maintenance method and program thereof

Country Status (1)

Country Link
JP (1) JP5071990B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9529844B2 (en) 2013-06-05 2016-12-27 International Business Machines Corporation Method, program, and system for processing space-time database

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007264744A (en) * 2006-03-27 2007-10-11 Nippon Telegr & Teleph Corp <Ntt> Network cache system, cache device, relay device, and program
JP2007328716A (en) * 2006-06-09 2007-12-20 Hitachi Ltd Stream signal processing method
JP2008146380A (en) * 2006-12-11 2008-06-26 Sony Computer Entertainment Inc Cache server, control method for it, program, and information storage medium
WO2008139521A1 (en) * 2007-04-27 2008-11-20 Fujitsu Limited Remote file system, terminal device, and server device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007264744A (en) * 2006-03-27 2007-10-11 Nippon Telegr & Teleph Corp <Ntt> Network cache system, cache device, relay device, and program
JP2007328716A (en) * 2006-06-09 2007-12-20 Hitachi Ltd Stream signal processing method
JP2008146380A (en) * 2006-12-11 2008-06-26 Sony Computer Entertainment Inc Cache server, control method for it, program, and information storage medium
WO2008139521A1 (en) * 2007-04-27 2008-11-20 Fujitsu Limited Remote file system, terminal device, and server device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9529844B2 (en) 2013-06-05 2016-12-27 International Business Machines Corporation Method, program, and system for processing space-time database
US10614072B2 (en) 2013-06-05 2020-04-07 International Business Machines Corporation Method, program, and system for processing space-time database

Also Published As

Publication number Publication date
JP5071990B2 (en) 2012-11-14

Similar Documents

Publication Publication Date Title
KR102133951B1 (en) Short link handling methods, devices, and servers
KR101570892B1 (en) Method and system of using a local hosted cache and cryptographic hash functions to reduce network traffic
CN104243425B (en) A kind of method, apparatus and system carrying out Content Management in content distributing network
KR101150146B1 (en) System and method for managing cached objects using notification bonds
WO2017092351A1 (en) Cache data update method and device
US20070050491A1 (en) Cache system
US9286293B2 (en) Populating and using caches in client-side caching
CN104516974B (en) A kind of management method and device of file system directories item
US9407726B1 (en) Caching objects identified by dynamic resource identifiers
WO2016066108A1 (en) Route access method, route access system and user terminal
US8914436B2 (en) Data processing device and data retriever
WO2024124663A1 (en) Method and apparatus for supporting batch cdn cache refresh
US20190243804A1 (en) Method And System For Deleting Obsolete Files From A File System
CN105074688B (en) Use the data deduplication based on stream of peer node figure
US20110282923A1 (en) File management system, method, and recording medium of program
JP4247975B2 (en) Data management method, data management system, program therefor, and recording medium
US11568014B2 (en) Information centric network distributed search with approximate cache
JP5071990B2 (en) Database apparatus, database system, cache maintenance method and program thereof
CN107659626A (en) Towards the separate-storage method of temporary metadata
US11057470B2 (en) Communication device and communication method for processing meta data
CN103685453B (en) The acquisition methods of metadata in a kind of cloud storage system
KR102169930B1 (en) Semantic Information Management Method for a M2M/IoT platform
JP6233846B2 (en) Variable-length nonce generation
JP2012203792A (en) Validity period calculation device, validity period calculation method, and validity period calculation program
CN110581883B (en) Content distribution method, content distribution device, content request device, and routing node

Legal Events

Date Code Title Description
RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20110822

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20111116

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20111122

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20111228

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20120424

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120618

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20120625

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

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120816

R150 Certificate of patent or registration of utility model

Ref document number: 5071990

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20150831

Year of fee payment: 3

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees