JP2016045610A - Database device and operation method thereof - Google Patents

Database device and operation method thereof Download PDF

Info

Publication number
JP2016045610A
JP2016045610A JP2014168170A JP2014168170A JP2016045610A JP 2016045610 A JP2016045610 A JP 2016045610A JP 2014168170 A JP2014168170 A JP 2014168170A JP 2014168170 A JP2014168170 A JP 2014168170A JP 2016045610 A JP2016045610 A JP 2016045610A
Authority
JP
Japan
Prior art keywords
cabinet
actual data
record
data
index
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
JP2014168170A
Other languages
Japanese (ja)
Other versions
JP6280000B2 (en
Inventor
俊輔 鶴見
Shunsuke Tsurumi
俊輔 鶴見
幸紀 南田
Yukinori Minamida
幸紀 南田
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 JP2014168170A priority Critical patent/JP6280000B2/en
Publication of JP2016045610A publication Critical patent/JP2016045610A/en
Application granted granted Critical
Publication of JP6280000B2 publication Critical patent/JP6280000B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PROBLEM TO BE SOLVED: To reduce the consumption of a memory and to move a data group between database devices without requiring eliminating memory fragmentation at the time of scaling out in a distributed database system.SOLUTION: A group of data records managed as a group is represented as a cabinet. The cabinet represents the records showing a storage position of real data records connected in a list manner. When data is added to the data group, the list of the cabinet is extended. When the data is moved between the data base devices, one data group is collectively moved, and the cabinet is moved from a memory for cabinet of the database device of the moving destination using vacant records corresponding to the number of data records included in the moving cabinet. Even when the vacant memory of the memory for cabinet of the moving destination is discontinuous, it is used to be connected as a list.SELECTED DRAWING: Figure 6

Description

本発明は、データベース装置およびその動作方法に関するものである。   The present invention relates to a database apparatus and an operation method thereof.

近年のITの発展に伴い情報システムで取り扱うデータ量が増大しており、1台のデータベース装置では性能や記憶容量が不足するほどデータ量が多くなるケースもみられるようになってきた。そこで、複数のデータベース装置にデータを分散収容して、複数のデータベース装置をひとつのデータベースとみなせるようにする分散データベースが研究・開発されている。データを複数のデータベース装置に分散させることはシャーディングと呼ばれている。   With the development of IT in recent years, the amount of data handled by information systems has increased, and there are cases where the amount of data increases as performance and storage capacity become insufficient in one database device. In view of this, a distributed database has been researched and developed in which data is distributedly accommodated in a plurality of database devices so that the plurality of database devices can be regarded as one database. Distributing data to a plurality of database devices is called sharding.

シャーディングにおいて、データとデータを収容するデータベース装置の対応付け方法は種々あるが、そのひとつとしてデータのキー値の範囲に応じて収容装置を決めるキーレンジ分割がある。キーはデータを一意に識別する属性である。たとえば、電話番号に関するデータベースでは、電話番号をキーとすることが行われる。多くの場合、キーは人がデータを言い表す際によく使われる属性であるので、キーレンジ分割はシステム管理者にとってデータとデータベース装置との対応関係を理解しやすいシャーディング方法であると言える。   In sharding, there are various methods for associating data with a database device that accommodates the data. One of them is key range division that determines the accommodating device according to the range of the key value of the data. The key is an attribute that uniquely identifies data. For example, in a database relating to telephone numbers, the telephone number is used as a key. In many cases, the key is an attribute often used when a person expresses data. Therefore, it can be said that the key range division is a sharding method that makes it easy for a system administrator to understand the correspondence between data and a database device.

キーレンジ分割された分散データベースでデータ操作を行うためには、キーの範囲とデータベース装置との対応関係を管理する必要がある。本稿ではキーからそのキーを収容するデータベース装置を特定することを分散解決と呼ぶ。データの操作を行うためにはキー範囲とデータベース装置との対応関係を知っている必要がある。キー範囲とデータベース装置との対応関係を表すデータを本稿では分散解決データと呼ぶ。本稿では、分散データベースシステムの個々のデータベース装置が分散データベースシステム全体のデータの分散解決データをデータベース内にテーブルとして保持し(共有し)、任意のデータベース装置が外部からデータ操作の要求を受け付け、データ操作要求を受け付けたデータベース装置が分散解決データテーブルを索引することで分散解決を行い操作対象のデータを収容するデータベース装置を特定し、データ操作要求を受け付けたデータベース装置がデータを収容するデータベース装置へ実際のデータ操作を要求するような分散データベースシステムを仮定する。   In order to perform data operations on a distributed database divided into key ranges, it is necessary to manage the correspondence between the key range and the database device. In this paper, identifying a database device that contains a key from a key is called distributed solution. In order to operate data, it is necessary to know the correspondence between the key range and the database device. Data representing the correspondence between key ranges and database devices is called distributed solution data in this paper. In this paper, each database device of a distributed database system holds (shares) the distributed solution data of the data of the entire distributed database system as a table in the database, and any database device accepts data manipulation requests from the outside, and data A database device that accepts an operation request performs a distributed solution by indexing the distributed solution data table, identifies a database device that accommodates data to be manipulated, and a database device that accepts a data operation request moves to a database device that accommodates data Assume a distributed database system that requires actual data manipulation.

通常、分散データベースシステムはデータベース装置を追加し収容データ量の限界を引き上げること(スケールアウトと呼ばれる)を可能とする仕組みを有する。シャーディングにキーレンジ分割を用いている場合には、既存のデータベース装置と新規のデータベース装置との間でキー範囲の割り当てを変更し、新規のデータベース装置に割り当てられたキー範囲に既存のデータがある場合には既存のデータベース装置から新規のデータベース装置にデータを移動する必要がある。   Normally, a distributed database system has a mechanism that allows a database device to be added to raise the limit of the amount of data accommodated (called scale-out). When key range partitioning is used for sharding, the key range assignment is changed between the existing database device and the new database device, and the existing data is transferred to the key range assigned to the new database device. In some cases, it is necessary to move data from an existing database device to a new database device.

データベースの使い方は用途に応じて様々であるが、単にひとつのキー値からキーに対応するひとつのデータレコードを取得する使い方だけでなく、なんらかの関連がある複数のデータレコードのグループを管理することも広く行われる。たとえば、電話回線管理システムにおいて、ひとつの収容装置に収容されている回線をひとつのグループとしてデータベースにて管理することが行われる。   The usage of the database varies depending on the application, but it is not only used to acquire one data record corresponding to the key from one key value, but also to manage a group of multiple related data records. Widely done. For example, in a telephone line management system, lines stored in one storage device are managed as a group in a database.

鶴見俊輔、阿部健二、徳永茂樹、佐々木潤子「大規模分散DBシステムにおけるデータ管理方式の一検討」電子情報通信学会ソサイエティ大会B-6-80, 2013.Shunsuke Tsurumi, Kenji Abe, Shigeki Tokunaga, Junko Sasaki "Study on Data Management Method in Large Scale Distributed Database System" IEICE Society Conference B-6-80, 2013.

非特許文献1にシャーディングにキーレンジ分割を用いて、データベース装置間のキー範囲割り当て変更に伴うデータの移動の際にメモリ空間の断片化が起きないような分散データベースの実現方法が示されている。この方法では、データレコードを格納するメモリ領域である実データレコードテーブルと、実データレコードテーブル中のレコードの位置を示すインデックスと、あるキー範囲に属する実データレコードを指し示すインデックスのグループを格納する「INDEXテーブル」と呼ぶデータ構造を用いる。ひとつのキー範囲に複数の「INDEXテーブル」が対応し、キー範囲割り当て変更に伴うデータベース装置間のデータの移動は「INDEXテーブル」単位で移動される。「INDEXテーブル」のサイズ(「INDEXテーブル」に収容可能なインデックス数)を一定にすることで、「INDEXテーブル」を移動しても「INDEXテーブル」のメモリ領域が断片化することを避けることができると主張されている。   Non-Patent Document 1 shows a method for realizing a distributed database that uses key range partitioning for sharding and does not cause fragmentation of memory space when data is moved due to a key range allocation change between database devices. Yes. In this method, an actual data record table that is a memory area for storing data records, an index that indicates the position of the record in the actual data record table, and a group of indexes that indicate actual data records that belong to a certain key range are stored. A data structure called “INDEX table” is used. A plurality of “INDEX tables” correspond to one key range, and data movement between the database devices in accordance with the key range assignment change is performed in units of “INDEX tables”. By keeping the size of the “INDEX table” (the number of indexes that can be stored in the “INDEX table”) constant, it is possible to avoid fragmentation of the memory area of the “INDEX table” even if the “INDEX table” is moved. It is claimed that it can.

キー範囲が同一である複数のテーブルがある場合には、ひとつのキー範囲に割り当てる「INDEXテーブル」数をそれらのテーブルで同数にしてもよいし、テーブルごとに異なる数の「INDEXテーブル」数を割り当てることもできるであろう。   If there are multiple tables with the same key range, the number of “INDEX tables” assigned to one key range may be the same in those tables, or a different number of “INDEX tables” may be assigned to each table. Could also be assigned.

非特許文献1の方法では、「INDEXテーブル」を同一サイズとするため、「INDEXテーブル」内のインデックス数が「INDEXテーブル」のサイズに満たない場合、「INDEXテーブル」のメモリ領域に無駄が生じるという問題がある。ひとつのキー範囲に割り当てる複数のテーブルに対し同数の「INDEXテーブル」を割り当てる方法を用いる場合には、キー範囲内に収容されるデータレコード数がテーブル間でばらつくと「INDEXテーブル」のメモリ領域の無駄が一層著しい。   In the method of Non-Patent Document 1, since the “INDEX table” has the same size, if the number of indexes in the “INDEX table” is less than the size of the “INDEX table”, the memory area of the “INDEX table” is wasted. There is a problem. When using the method of assigning the same number of “INDEX tables” to multiple tables assigned to one key range, if the number of data records contained in the key range varies between tables, the memory area of the “INDEX table” Waste is even more pronounced.

本発明は、上記の課題に鑑みてなされたものであり、その目的とするところは、データベースにおいてメモリの消費を低減しつつ関連する複数のデータレコードグループを管理する技術を提供することにある。   The present invention has been made in view of the above problems, and an object of the present invention is to provide a technique for managing a plurality of related data record groups while reducing memory consumption in a database.

上記の課題を解決するために、第1の本発明は、データベース装置であって、実データを含むレコードが実データインデクスに対応づけて記憶される1以上の実データテーブルと、実データに対応するキーを複数含む範囲を示すキー範囲情報と前記実データテーブルごとのキャビネットIDを含むレコードが記憶される分散解決データテーブルと、キャビネットIDと該キャビネットに含まれるひとつのレコードの格納位置を示すキャビネットインデクスを含むレコードが記憶されるキャビネット管理テーブルと、実データインデクスと次インデクスを含むレコードが記憶されるキャビネットテーブルと、前記キャビネットテーブルのレコードを連結してリストを構成する手段と、前記キャビネットテーブルのレコードのリストにキャビネットテーブルのレコードを挿入してリストを延長する手段と、キーを含むデータ操作信号を受信する手段と、前記分散解決データテーブルから当該キーを含む範囲を示すキー範囲情報を含むレコードを検索し、当該実データを記憶すべき実データテーブルのキャビネットIDを読み出す手段と、前記キャビネットテーブルから当該キャビネットIDに対応するキャビネットインデクスを読み出し前記キャビネットテーブルから当該キャビネットインデクスに対応するレコードを検索する手段と、該検索されたレコードを含むリストにキャビネットテーブルのレコードを挿入して該リストを延長し、該挿入されたキャビネットテーブルのレコードに実データインデクスを格納する手段と、前記受信された実データを記憶すべき実データテーブルにおける当該実データインデクスに対応する位置に前記受信された実データを含むレコードを追加する手段とを備えることを特徴とする。   In order to solve the above-described problem, the first aspect of the present invention is a database device, and corresponds to one or more actual data tables in which records including actual data are stored in association with actual data indexes, and to actual data. Key range information indicating a range including a plurality of keys to be performed, a distributed solution data table storing a record including a cabinet ID for each actual data table, and a cabinet indicating a storage location of the cabinet ID and one record included in the cabinet A cabinet management table in which records including indexes are stored; a cabinet table in which records including actual data indexes and next indexes are stored; means for concatenating records in the cabinet tables to form a list; and Cabinet on record list Means for inserting a record in the table and extending the list; means for receiving a data operation signal including a key; and searching for a record including key range information indicating a range including the key from the distributed solution data table; Means for reading a cabinet ID of an actual data table to store actual data; means for reading a cabinet index corresponding to the cabinet ID from the cabinet table; and retrieving a record corresponding to the cabinet index from the cabinet table; Means for inserting a cabinet table record into a list including the inserted record, extending the list, and storing an actual data index in the inserted cabinet table record, and storing the received actual data. In the data table Kicking characterized in that it comprises a means for adding a record containing the actual data to which the received at positions corresponding to the actual data index.

第2の本発明は、データベース装置の動作方法であって、前記データベース装置は、実データを含むレコードが実データインデクスに対応づけて記憶される1以上の実データテーブルと、実データに対応するキーを複数含む範囲を示すキー範囲情報と前記実データテーブルごとのキャビネットIDを含むレコードが記憶される分散解決データテーブルと、キャビネットIDと該キャビネットに含まれるひとつのレコードの格納位置を示すキャビネットインデクスを含むレコードが記憶されるキャビネット管理テーブルと、実データインデクスと次インデクスを含むレコードが記憶されるキャビネットテーブルと、前記キャビネットテーブルのレコードを連結してリストを構成する手段と、前記キャビネットテーブルのレコードのリストにキャビネットテーブルのレコードを挿入してリストを延長する手段とを備え、前記動作方法は、前記データベース装置が、キーを含むデータ操作信号を受信し、前記データベース装置が、前記分散解決データテーブルから当該キーを含む範囲を示すキー範囲情報を含むレコードを検索し、当該実データを記憶すべき実データテーブルのキャビネットIDを読み出し、前記データベース装置が、前記キャビネットテーブルから当該キャビネットIDに対応するキャビネットインデクスを読み出し前記キャビネットテーブルから当該キャビネットインデクスに対応するレコードを検索し、前記データベース装置が、該検索されたレコードを含むリストにキャビネットテーブルのレコードを挿入して該リストを延長し、該挿入されたキャビネットテーブルのレコードに実データインデクスを格納し、前記データベース装置が、前記受信された実データを記憶すべき実データテーブルにおける当該実データインデクスに対応する位置に前記受信された実データを含むレコードを追加することを特徴とする   The second aspect of the present invention is an operation method of a database device, wherein the database device corresponds to one or more actual data tables in which records including actual data are stored in association with actual data indexes, and to actual data. Key range information indicating a range including a plurality of keys, a distributed solution data table storing a record including a cabinet ID for each actual data table, and a cabinet index indicating a storage location of the cabinet ID and one record included in the cabinet A cabinet management table in which records including a record are stored; a cabinet table in which records including an actual data index and a next index are stored; means for concatenating records in the cabinet table to form a list; and records in the cabinet table In the list of Means for inserting a record of the net table and extending the list, wherein the database device receives a data operation signal including a key, and the database device receives the key from the distributed solution data table. The record including the key range information indicating the range including the data is retrieved, the cabinet ID of the actual data table in which the actual data is to be stored is read, and the database device reads the cabinet index corresponding to the cabinet ID from the cabinet table. The record corresponding to the cabinet index is searched from the cabinet table, and the database device extends the list by inserting the record of the cabinet table into the list including the searched record, and the inserted cabinet table. The actual data index is stored in the record, and the database device adds a record including the received actual data at a position corresponding to the actual data index in the actual data table in which the received actual data is to be stored. It is characterized by

本発明のデータベース装置およびその動作方法によれば、キーレンジ分割を用いる分散データベースシステムにおいてデータベース装置間でキー範囲の割り当ての変更を行う際に、メモリの断片化解消を行う必要が無く、かつ、メモリ消費が少ないようなデータベースを実現することができる。   According to the database device and the operation method thereof of the present invention, when changing the allocation of the key range between the database devices in the distributed database system using the key range division, it is not necessary to perform the defragmentation of the memory, and A database with low memory consumption can be realized.

本実施の形態に係るデータベース装置における記憶部の構成を示す図である。It is a figure which shows the structure of the memory | storage part in the database apparatus which concerns on this Embodiment. メモリ空間(キャビネットテーブル4)におけるキャビネット6の配置例を示す図である。It is a figure which shows the example of arrangement | positioning of the cabinet 6 in memory space (cabinet table 4). 比較例のデータベース装置における記憶部の構成を示す図である。It is a figure which shows the structure of the memory | storage part in the database apparatus of a comparative example. 比較例のデータベース装置のメモリ消費に関する問題点を示す図である。It is a figure which shows the problem regarding the memory consumption of the database apparatus of a comparative example. 本実施の形態に係るデータベース装置の動作を示す図である。It is a figure which shows operation | movement of the database apparatus concerning this Embodiment. 本実施の形態のキャビネット6よるメモリ消費の低減効果を模式的に示す図である。It is a figure which shows typically the reduction effect of the memory consumption by the cabinet 6 of this Embodiment.

以下、本発明の実施の形態について図面を参照して説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

図1は、本実施の形態に係るデータベース装置における記憶部の構成を示す図である。   FIG. 1 is a diagram showing a configuration of a storage unit in the database apparatus according to the present embodiment.

図は、複数のデータベース装置を含む分散データベースシステムの1データベース装置を示す。他のデータベース装置も同様の構成である。   The figure shows one database device of a distributed database system including a plurality of database devices. Other database devices have the same configuration.

データベース装置は、実データを含むレコードが実データインデクスに対応づけて記憶される1以上の実データテーブル1と、実データに対応するキーを複数含む範囲を示すキー範囲情報と配置先情報と実データテーブルごとのキャビネットIDを含むレコードが記憶される分散解決データテーブル2と、キャビネットIDと該キャビネットIDに対応するキャビネットのサイズであるキャビネットサイズと該キャビネットに含まれるひとつのレコードの格納位置を示すキャビネットインデクスとを含むレコードが記憶されるキャビネット管理テーブル3と、キャビネットインデクスと実データインデクスと次インデクスを含むレコードが記憶されるキャビネットテーブル4とを備える。   The database device includes one or more actual data tables 1 in which records including actual data are stored in association with actual data indexes, key range information indicating a range including a plurality of keys corresponding to actual data, arrangement destination information, and actual data. The distributed solution data table 2 in which records including cabinet IDs for each data table are stored, the cabinet ID, the cabinet size corresponding to the cabinet ID, and the storage location of one record included in the cabinet A cabinet management table 3 in which records including cabinet indexes are stored, and a cabinet table 4 in which records including cabinet indexes, actual data indexes, and next indexes are stored.

キャビネットテーブル4のレコードはリストを構成することができる。リストを構成するためには、キャビネットテーブル4のレコード(L1)の次インデクスに別のレコード(L2)を指し示す値を格納し、そのレコード(L2)の次インデクスにまた別のレコード(L3)を指し示す値を格納するということを繰り返すことにより、レコードL1、L2、L3を連結し、あるいはそれ以上のレコードを連結したリストを構成することができる。次インデクスにNULLを格納することでリストの終端を表すことができる。   Records of the cabinet table 4 can form a list. To configure the list, a value indicating another record (L2) is stored in the next index of the record (L1) of the cabinet table 4, and another record (L3) is stored in the next index of the record (L2). By repeatedly storing the indicated value, it is possible to form a list in which records L1, L2, and L3 are linked or more records are linked. The end of the list can be expressed by storing NULL in the next index.

キャビネットテーブル4のレコードをリストとして連結したものをキャビネット6と呼ぶ。キャビネット6は非特許文献1に記載の「INDEXテーブル」に相当するデータ構造であり、複数のデータレコードをグルーピングする。キーレンジ分割でデータをシャーディングする際には分散解決データテーブル2によってデータの配置先をキャビネット6ごとに指定する。   A combination of the records of the cabinet table 4 as a list is called a cabinet 6. The cabinet 6 has a data structure corresponding to the “INDEX table” described in Non-Patent Document 1, and groups a plurality of data records. When data is sharded by key range division, the data arrangement destination is designated for each cabinet 6 by the distributed solution data table 2.

実データテーブル1は、他の実データテーブル1に記憶されるデータとは異なる種類のデータを記憶するものである。つまり、分散データベースシステム全体でも、1つのデータベース装置でも、同じ実データテーブル1は存在しない。   The actual data table 1 stores different types of data from the data stored in other actual data tables 1. That is, the same actual data table 1 does not exist in the entire distributed database system or one database device.

分散解決データテーブル2は、他のデータベース装置に記憶される分散解決データテーブル2と同じものである。   The distributed solution data table 2 is the same as the distributed solution data table 2 stored in another database device.

キャビネット管理テーブル3、キャビネットテーブル4は、他のデータベース装置に記憶されるものとは異なるものである。   The cabinet management table 3 and the cabinet table 4 are different from those stored in other database devices.

データベース装置のメモリが有限であることからキャビネットテーブル4のサイズは固定でありそのレコード数「N」を増減できないようになっている。   Since the memory of the database device is finite, the size of the cabinet table 4 is fixed and the number of records “N” cannot be increased or decreased.

本実施例では、分散解決のキーに電話番号を用いることを例に記述する。すなわち、分散解決データテーブル2のキー範囲情報が”050-1111”であるとは、キー値としては”050-1111-0000”から”050-1111-9999”までの電話番号を表している。   In the present embodiment, the use of a telephone number as a distributed solution key will be described as an example. That is, the key range information of the distributed solution data table 2 being “050-1111” represents a telephone number from “050-1111-0000” to “050-1111-9999” as a key value.

図2は、メモリ空間(キャビネットテーブル4)におけるキャビネット6の配置例を示す図である。   FIG. 2 is a diagram illustrating an arrangement example of the cabinets 6 in the memory space (cabinet table 4).

キャビネットテーブル4のレコードに含まれる次インデクスは、当該レコードの次に生成されたレコード内のキャビネットインデクスを示すものである。   The next index included in the record of the cabinet table 4 indicates the cabinet index in the record generated next to the record.

キャビネットID「1」のキャビネット6で最初に生成されたレコードは、メモリ空間(キャビネットテーブル4)の例えば1番目の領域に格納される。2番目のレコードは、例えば3番目の領域に格納される。最初のレコードの次インデクスは、3番目の領域を示していることになる。3番目のレコードは、例えば6番目の領域に格納される。2番目のレコードの次インデクスは、6番目の領域を示していることになる。   The record generated first in the cabinet 6 with the cabinet ID “1” is stored in, for example, the first area of the memory space (cabinet table 4). The second record is stored in the third area, for example. The next index of the first record indicates the third area. The third record is stored in, for example, the sixth area. The next index of the second record indicates the sixth area.

キャビネットID「2」のキャビネット6で最初に生成されたレコードは、メモリ空間の例えば2番目の領域に格納される。2番目のレコードは、4番目の領域に格納される。最初のレコードの次インデクスは、4番目の領域を示していることになる。3番目のレコードは、5番目の領域に格納される。2番目のレコードの次インデクスは、5番目の領域を示していることになる。4番目のレコードは、7番目の領域に格納される。3番目のレコードの次インデクスは、7番目の領域を示していることになる。   The record generated first in the cabinet 6 with the cabinet ID “2” is stored in, for example, the second area of the memory space. The second record is stored in the fourth area. The next index of the first record indicates the fourth area. The third record is stored in the fifth area. The next index of the second record indicates the fifth area. The fourth record is stored in the seventh area. The next index of the third record indicates the seventh area.

このように、本実施の形態では、キャビネットテーブル4内のメモリ空間を隙間なく利用することができる。   As described above, in this embodiment, the memory space in the cabinet table 4 can be used without a gap.

図3は、比較例のデータベース装置における記憶部の構成を示す図である。   FIG. 3 is a diagram illustrating a configuration of a storage unit in the database device of the comparative example.

1以上の実データテーブル1と、アドレスとキー範囲情報と配置先情報と次アドレスとキャビネットIDを含むレコードが記憶される分散解決データテーブル2Aと、キャビネットIDと空塞状況を含むレコードが記憶されるキャビネット空塞管理テーブル3Aと、キャビネットIDごとのキャビネット6Aとキャビネット6Aが配置されるキャビネットテーブル4Aとを備える。   One or more actual data tables 1, a distributed solution data table 2A in which records including addresses, key range information, placement destination information, next addresses, and cabinet IDs are stored, and records including cabinet IDs and empty statuses are stored. And a cabinet table 4A on which the cabinet 6A and the cabinet 6A are arranged for each cabinet ID.

実データテーブル1は、他の実データテーブル1に記憶されるデータとは異なる種類のデータを記憶するものである。   The actual data table 1 stores different types of data from the data stored in other actual data tables 1.

分散解決データテーブル2Aは、他のデータベース装置に記憶される分散解決データテーブル2Aと同じものである。分散解決データテーブル2Aは実データテーブル1の種類ごとに作成される。   The distributed solution data table 2A is the same as the distributed solution data table 2A stored in another database device. The distributed solution data table 2A is created for each type of the actual data table 1.

キャビネット空塞管理テーブル3A、キャビネットテーブル4Aは、他のデータベース装置に記憶されるものとは異なるものである。   The cabinet vacancy management table 3A and the cabinet table 4A are different from those stored in other database devices.

キャビネットテーブル4Aは、そのレコード数「N」を増減できないようになっている。   The cabinet table 4A cannot increase or decrease the number of records “N”.

キャビネット6Aのレコード数は一定長で固定されており増減できないようになっている。   The number of records in the cabinet 6A is fixed at a fixed length so that it cannot be increased or decreased.

図4は、比較例のデータベース装置のメモリ消費に関する問題点を示す図である。   FIG. 4 is a diagram illustrating a problem related to memory consumption of the database device of the comparative example.

例えば、ある実データテーブル1(TB#1の実データテーブル1)について使用するためのキャビネット6A(キャビネットID「1」)の全レコードに実データインデクスがある状態(満状態)で、新たな実データインデクスを記憶させる必要性が生じたなら、同じ実データテーブル1について使用するためのキャビネット6A(キャビネットID「2」)が新設され、レコードに新たな実データインデクスが記憶される。   For example, in a state where all records of the cabinet 6A (cabinet ID “1”) for use with respect to a certain real data table 1 (TB # 1 real data table 1) have a real data index (full state), a new real data table 1 is used. If it becomes necessary to store the data index, a cabinet 6A (cabinet ID “2”) for use with the same actual data table 1 is newly established, and a new actual data index is stored in the record.

この場合、TB#1の実データテーブル1用の分散解決データテーブル2において、キャビネットID「1」を含むレコード(既存レコードという)に次アドレスとして含まれていたNULL値が例えば次アドレス「0002」に変更され、次アドレス「0002」と同じアドレスと既存レコードのキー範囲情報「050−1111」と配置先情報「DB#1」と次アドレスとしてのNULL値とキャビネットID「2」を含むレコードが分散解決データテーブル2Aに追加される。   In this case, in the distributed solution data table 2 for the actual data table 1 of TB # 1, the NULL value included as the next address in the record including the cabinet ID “1” (referred to as an existing record) is, for example, the next address “0002”. The record including the same address as the next address “0002”, the key range information “050-1111” of the existing record, the placement destination information “DB # 1”, the NULL value as the next address, and the cabinet ID “2” It is added to the distributed solution data table 2A.

キャビネット6A(キャビネットID「2」)では、新設当初、ほとんどのレコードに実データインデクスが記憶されず、よって、新設当初のキャビネット6Aが過剰にメモリを消費してしまうという問題点がある。   In the cabinet 6A (cabinet ID “2”), the actual data index is not stored in most records at the beginning of the establishment, and thus the cabinet 6A at the beginning of the establishment consumes excessive memory.

図5は、本実施の形態に係るデータベース装置の動作を示す図である。   FIG. 5 is a diagram showing the operation of the database apparatus according to the present embodiment.

ここでは、データベース装置が、外部から送信されるデータ操作信号内のキー「050−1111−dddd」とデータの種類が「n」である実データ「xxx」を記憶部に格納する際の動作について説明する。   Here, the operation when the database device stores the key “050-1111-dddd” in the data operation signal transmitted from the outside and the actual data “xxx” having the data type “n” in the storage unit. explain.

データベース装置は、まず、キーとデータの種類と実データを含むデータ操作信号を受信する(S1)。   First, the database device receives a data operation signal including a key, a type of data, and actual data (S1).

次に、データベース装置は、分散解決データテーブル2から当該キーを含む範囲を示すキー範囲情報を含むレコードを検索し(S2)、レコードの配置先情報が他のデータベース装置を示すものなら、データを収容するデータベース装置へ実際のデータ操作を要求して処理を終了する一方、配置先情報が自身(データベース装置)を示すものなら、受信したデータ操作信号内の実データを記憶すべき実データテーブル(TB#1)用のキャビネット管理テーブル3から当該キャビネットIDを含むレコードを検索し(S3)、キャビネットサイズを更新する(S4)。ここで、データベース装置は、例えばキャビネットサイズを3から4にインクリメント(更新)する(S4)。   Next, the database device searches the distributed solution data table 2 for a record including key range information indicating the range including the key (S2). If the record location information indicates another database device, the data is stored. While the actual data operation is requested to the database device to be accommodated and the process is terminated, if the placement destination information indicates itself (database device), the actual data table (in which the actual data in the received data operation signal is to be stored) A record including the cabinet ID is retrieved from the cabinet management table 3 for TB # 1) (S3), and the cabinet size is updated (S4). Here, the database apparatus increments (updates) the cabinet size from 3 to 4, for example (S4).

次に、データベース装置は、当該更新したレコードからキャビネットインデクス(「1」)を読み出し、キャビネットテーブル4から当該インデクスに対応するレコードを検索し(S5)、当該レコードを含むキャビネット6において最後に追加されたレコードに次インデクスとして含まれていたNULL値をNULL値でない次インデクス(例えば「6」)に変更し、当該次インデクスと同じキャビネットインデクスを含むレコードをキャビネット6から検索し、実データインデクス(例えば「105」)を格納する(S6)。   Next, the database device reads the cabinet index (“1”) from the updated record, searches for the record corresponding to the index from the cabinet table 4 (S5), and is finally added in the cabinet 6 including the record. The NULL value included in the next record as the next index is changed to a next index that is not a NULL value (for example, “6”), a record including the same cabinet index as the next index is retrieved from the cabinet 6, and an actual data index (for example, "105") is stored (S6).

次に、データベース装置は、実データテーブル(TB#1)における当該実データインデクス(「105」)に対応する位置に、受信された実データ「xxx」を含むレコードを追加する(S7)。   Next, the database device adds a record including the received actual data “xxx” to the position corresponding to the actual data index (“105”) in the actual data table (TB # 1) (S7).

図6は、本実施の形態のキャビネット6よるメモリ消費の低減効果を模式的に示す図である。   FIG. 6 is a diagram schematically showing a memory consumption reduction effect by the cabinet 6 of the present embodiment.

本実施の形態では、キャビネット6はキャビネットテーブル4のレコードを連結して構成されるものであるため、キャビネットテーブル4内に空きレコードがある限りにおいて、キャビネット6が満状態になることはなく、キャビネット6が含むレコード数を増加させることができる。データベースに実データを追加する際にキャビネット6が含むレコード数を増加させる際には、追加する実レコード数だけのキャビネットテーブル4のレコードを消費するため、キャビネット6が過剰にメモリを消費してしまうという問題点を解決できる。   In the present embodiment, since the cabinet 6 is configured by connecting the records of the cabinet table 4, as long as there are empty records in the cabinet table 4, the cabinet 6 does not become full. The number of records included in 6 can be increased. When increasing the number of records included in the cabinet 6 when adding actual data to the database, the cabinet 6 consumes excessive memory because it consumes as many records in the cabinet table 4 as the number of actual records to be added. Can solve the problem.

[背景技術]で述べたように、他のデータベース装置にキャビネット6を移し替える場合、これに伴い、キャビネット6をそのデータベース装置のキャビネットテーブル4に移し替える必要がある。   As described in [Background Art], when the cabinet 6 is transferred to another database device, the cabinet 6 needs to be transferred to the cabinet table 4 of the database device.

比較例の場合、移し替える先のデータベース装置のキャビネットテーブル4の中の個々のレコードの領域が未使用であっても、キャビネット6の固定サイズ分の連続した空き領域が無いとキャビネット6を移動できないが、本実施形態では、キャビネットテーブル4のレコードは実際に格納する実データレコード数しか消費せず、また、キャビネットテーブル4内の空きレコードが必ずしも連続している必要がない。空きレコードが必ずしも連続している必要がないということは、キャビネット6の移し替えを行う際にメモリの断片化の解消を行う必要がないことを意味する。以上のように、不連続であっても未使用のキャビネットテーブル4のメモリを使用できることから、本実施形態はメモリの再利用性が高いといえる。   In the case of the comparative example, even if the area of each record in the cabinet table 4 of the database apparatus to which the data is to be transferred is unused, the cabinet 6 cannot be moved if there is no continuous free area for the fixed size of the cabinet 6. However, in this embodiment, the records in the cabinet table 4 consume only the number of actual data records to be actually stored, and the empty records in the cabinet table 4 do not necessarily have to be continuous. The fact that the empty records do not necessarily have to be continuous means that it is not necessary to eliminate the fragmentation of the memory when the cabinet 6 is transferred. As described above, since the unused memory of the cabinet table 4 can be used even if it is discontinuous, it can be said that this embodiment has high memory reusability.

なお、本実施の形態のデータベース装置としてコンピュータを機能させるためのコンピュータプログラムは、半導体メモリ、磁気ディスク、光ディスク、光磁気ディスク、磁気テープなどのコンピュータ読み取り可能な記録媒体に記録でき、また、インターネットなどの通信網を介して伝送させて、広く流通させることができる。   A computer program for causing a computer to function as the database device of the present embodiment can be recorded on a computer-readable recording medium such as a semiconductor memory, a magnetic disk, an optical disk, a magneto-optical disk, a magnetic tape, and the Internet. It is possible to distribute widely through the communication network.

1 実データテーブル
2、2A 分散解決データテーブル
3 キャビネット管理テーブル
3A キャビネット空塞管理テーブル
4、4A キャビネットテーブル
6、6A キャビネット
1 real data table 2, 2A distributed solution data table 3 cabinet management table 3A cabinet empty / busy management table 4, 4A cabinet table 6, 6A cabinet

Claims (2)

データベース装置であって、
実データを含むレコードが実データインデクスに対応づけて記憶される1以上の実データテーブルと、
実データに対応するキーを複数含む範囲を示すキー範囲情報と前記実データテーブルごとのキャビネットIDを含むレコードが記憶される分散解決データテーブルと、
キャビネットIDと該キャビネットに含まれるひとつのレコードの格納位置を示すキャビネットインデクスを含むレコードが記憶されるキャビネット管理テーブルと、
実データインデクスと次インデクスを含むレコードが記憶されるキャビネットテーブルと、
前記キャビネットテーブルのレコードを連結してリストを構成する手段と、
前記キャビネットテーブルのレコードのリストにキャビネットテーブルのレコードを挿入してリストを延長する手段と、
キーを含むデータ操作信号を受信する手段と、
前記分散解決データテーブルから当該キーを含む範囲を示すキー範囲情報を含むレコードを検索し、当該実データを記憶すべき実データテーブルのキャビネットIDを読み出す手段と、
前記キャビネットテーブルから当該キャビネットIDに対応するキャビネットインデクスを読み出し前記キャビネットテーブルから当該キャビネットインデクスに対応するレコードを検索する手段と、
該検索されたレコードを含むリストにキャビネットテーブルのレコードを挿入して該リストを延長し、該挿入されたキャビネットテーブルのレコードに実データインデクスを格納する手段と、
前記受信された実データを記憶すべき実データテーブルにおける当該実データインデクスに対応する位置に前記受信された実データを含むレコードを追加する手段と
を備えることを特徴とするデータベース装置。
A database device,
One or more actual data tables in which records including actual data are stored in association with actual data indexes;
A distributed solution data table in which a key range information indicating a range including a plurality of keys corresponding to actual data and a record including a cabinet ID for each actual data table is stored;
A cabinet management table in which a record including a cabinet ID and a cabinet index indicating a storage position of one record included in the cabinet is stored;
A cabinet table in which records including the actual data index and the next index are stored;
Means for connecting the records of the cabinet table to form a list;
Means for inserting a cabinet table record into the cabinet table record list and extending the list;
Means for receiving a data manipulation signal including a key;
Means for retrieving a record including key range information indicating a range including the key from the distributed solution data table, and reading a cabinet ID of the actual data table in which the actual data is to be stored;
Means for reading a cabinet index corresponding to the cabinet ID from the cabinet table and searching for a record corresponding to the cabinet index from the cabinet table;
Means for inserting a cabinet table record into the list including the retrieved record to extend the list, and storing an actual data index in the inserted cabinet table record;
And a means for adding a record including the received actual data to a position corresponding to the actual data index in an actual data table in which the received actual data is to be stored.
データベース装置の動作方法であって、
前記データベース装置は、
実データを含むレコードが実データインデクスに対応づけて記憶される1以上の実データテーブルと、
実データに対応するキーを複数含む範囲を示すキー範囲情報と前記実データテーブルごとのキャビネットIDを含むレコードが記憶される分散解決データテーブルと、
キャビネットIDと該キャビネットに含まれるひとつのレコードの格納位置を示すキャビネットインデクスを含むレコードが記憶されるキャビネット管理テーブルと、
実データインデクスと次インデクスを含むレコードが記憶されるキャビネットテーブルと、
前記キャビネットテーブルのレコードを連結してリストを構成する手段と、
前記キャビネットテーブルのレコードのリストにキャビネットテーブルのレコードを挿入してリストを延長する手段とを備え、
前記動作方法は、
前記データベース装置が、キーを含むデータ操作信号を受信し、
前記データベース装置が、前記分散解決データテーブルから当該キーを含む範囲を示すキー範囲情報を含むレコードを検索し、当該実データを記憶すべき実データテーブルのキャビネットIDを読み出し、
前記データベース装置が、前記キャビネットテーブルから当該キャビネットIDに対応するキャビネットインデクスを読み出し前記キャビネットテーブルから当該キャビネットインデクスに対応するレコードを検索し、
前記データベース装置が、該検索されたレコードを含むリストにキャビネットテーブルのレコードを挿入して該リストを延長し、該挿入されたキャビネットテーブルのレコードに実データインデクスを格納し、
前記データベース装置が、前記受信された実データを記憶すべき実データテーブルにおける当該実データインデクスに対応する位置に前記受信された実データを含むレコードを追加する
ことを特徴とするデータベース装置の動作方法。
A method of operating a database device, comprising:
The database device includes:
One or more actual data tables in which records including actual data are stored in association with actual data indexes;
A distributed solution data table in which a key range information indicating a range including a plurality of keys corresponding to actual data and a record including a cabinet ID for each actual data table is stored;
A cabinet management table in which a record including a cabinet ID and a cabinet index indicating a storage position of one record included in the cabinet is stored;
A cabinet table in which records including the actual data index and the next index are stored;
Means for connecting the records of the cabinet table to form a list;
Means for inserting the cabinet table record into the cabinet table record list and extending the list;
The operation method is as follows:
The database device receives a data operation signal including a key;
The database device retrieves a record including key range information indicating a range including the key from the distributed solution data table, reads a cabinet ID of an actual data table in which the actual data is to be stored,
The database device reads a cabinet index corresponding to the cabinet ID from the cabinet table, searches the cabinet table for a record corresponding to the cabinet index,
The database device extends the list by inserting a cabinet table record into the list including the retrieved record, stores an actual data index in the inserted cabinet table record,
The database apparatus adds a record including the received actual data to a position corresponding to the actual data index in an actual data table in which the received actual data is to be stored. .
JP2014168170A 2014-08-21 2014-08-21 Database apparatus and operation method thereof Active JP6280000B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014168170A JP6280000B2 (en) 2014-08-21 2014-08-21 Database apparatus and operation method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014168170A JP6280000B2 (en) 2014-08-21 2014-08-21 Database apparatus and operation method thereof

Publications (2)

Publication Number Publication Date
JP2016045610A true JP2016045610A (en) 2016-04-04
JP6280000B2 JP6280000B2 (en) 2018-02-14

Family

ID=55636147

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014168170A Active JP6280000B2 (en) 2014-08-21 2014-08-21 Database apparatus and operation method thereof

Country Status (1)

Country Link
JP (1) JP6280000B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112162991A (en) * 2020-09-30 2021-01-01 广州羊城通有限公司 Intelligent management method and device for data

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005215869A (en) * 2004-01-28 2005-08-11 Anetsukusu Syst Kk Data storage and retrieval system
JP2012168781A (en) * 2011-02-15 2012-09-06 Nippon Telegr & Teleph Corp <Ntt> Distributed data-store system, and record management method in distributed data-store system
US20130304770A1 (en) * 2012-05-10 2013-11-14 Siemens Aktiengesellschaft Method and system for storing data in a database

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005215869A (en) * 2004-01-28 2005-08-11 Anetsukusu Syst Kk Data storage and retrieval system
JP2012168781A (en) * 2011-02-15 2012-09-06 Nippon Telegr & Teleph Corp <Ntt> Distributed data-store system, and record management method in distributed data-store system
US20130304770A1 (en) * 2012-05-10 2013-11-14 Siemens Aktiengesellschaft Method and system for storing data in a database

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
鶴見俊輔: "大規模分散DBシステムにおけるデータ管理方式の一検討", 2013年電子情報通信学会通信ソサイエティ大会, JPN7017002195, 3 September 2013 (2013-09-03), JP, pages P80 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112162991A (en) * 2020-09-30 2021-01-01 广州羊城通有限公司 Intelligent management method and device for data
CN112162991B (en) * 2020-09-30 2023-12-08 广州羊城通有限公司 Intelligent management method and device for data

Also Published As

Publication number Publication date
JP6280000B2 (en) 2018-02-14

Similar Documents

Publication Publication Date Title
KR101994021B1 (en) File manipulation method and apparatus
JP2007042034A (en) Computer system, management computer, and method for managing logic storage domain
US20060212495A1 (en) Method and system for storing data into a database
KR20170068564A (en) Data processing method, apparatus and system
JP2008015984A (en) Data migration device, method and program
CN102541990A (en) Database redistribution method and system utilizing virtual partitions
JP2008059353A (en) Virtual system and method for controlling domain allocation
CN103678523A (en) Distributed cache data access method and device
CN102739622A (en) Expandable data storage system
CN103631924A (en) Application method and system for distributive database platform
CN110147203B (en) File management method and device, electronic equipment and storage medium
CN107766343A (en) A kind of date storage method, device and storage server
WO2024078429A1 (en) Memory management method and apparatus, computer device, and storage medium
US20100161585A1 (en) Asymmetric cluster filesystem
US20230281118A1 (en) Memory system and non-transitory computer readable recording medium
JPWO2015097774A1 (en) Computer system and data management method
JP5470974B2 (en) Distributed file system and distributed file storage method
CN106354724B (en) Document-archiving method, file reading and device
JP6280000B2 (en) Database apparatus and operation method thereof
US10311026B2 (en) Compressed data layout for optimizing data transactions
CN113853778A (en) Cloning method and device of file system
US20060031634A1 (en) Management method for cache memory, storage apparatus, and computer system
CN108804571B (en) Data storage method, device and equipment
CN111857556A (en) Method, apparatus and computer program product for managing metadata of storage objects
CN113032414B (en) Data management method, device, system, computing equipment and storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160916

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170621

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170711

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170808

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180118

R150 Certificate of patent or registration of utility model

Ref document number: 6280000

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150