# US 2012/0254138 A1 · Database management method

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2012/0254138 A1
- Document ID: US20120254138A1
- Status: Published application
- Kind: A1
- Application number: 13/513,773
- Filed: 2011-08-08
- Published: 2012-10-04
- Earliest claimed: 2010-10-26
- Assignees: Murakumo Corporation
- Inventors: Hiroyuki Yamada
- Web page: https://patentgrep.com/patent/US20120254138A1

## CPC

- G06F 16/21: Design, administration or maintenance of databases
- G06F 16/23: Updating
- G06F 16/2308: {Concurrency control (transaction processing G06F9/466)}
- G06F 16/2336: {Pessimistic concurrency control approaches, e.g. locking or multiple versions without time stamps}
- G06F 16/27: Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The present invention realize a method of managing a database capable of hierarchically building master nodes, and efficiently performing the update of the master nodes. A lower-level master node sends, to a higher-level master node, a write set expanded in its own memory including a shadow copy of its own database and a heaptuple map, and the higher-level master node that received the write set verifies whether the update has already been executed and sends the record of this update to the lower-level master node as a transaction log, whereby the database can be updated efficiently and consistently from the lower-level master node to the higher-level master node, and from the higher-level master node to the lower-level master node under its control.

## Claims

### Claim 1

A method of managing a database which is a recordable database hierarchically including higher-level and lower-level master nodes in which records can be updated, comprising:
a step of a database processing unit of any one of lower-level master nodes generating and sending, to a higher-level master node, a write set expanded in its own memory including a shadow copy of a database and a heaptuple map, when an instruction for updating the database is issued in the lower-level master node;
a step of the higher-level master node comparing the heaptuple map in the write set received from the lower-level master node and its own database, and verifying whether a corresponding line of the database registered as a target has been updated by a different write set;
a step of aborting the write set when the update has been performed, updating its own database using the shadow copy when the update has not been performed, and generating a record of this update as a transaction log;
a step of distributing the transaction log to the lower-level master nodes including the lower-level master node which has sent the write set; and
a step of a transaction log processing unit of the lower-level master node updating its own database based on the received transaction log.

### Claim 2 (depends on 1)

The method of managing a database according to claim 1,
wherein the shadow copy of the write set in the lower-level master node is configured only from newly added lines.

### Claim 3 (depends on 1, 2)

The method of managing a database according to claim 1 or claim 2,
wherein, in a stage where the write set is being generated in the lower-level master node, if search processing is performed on a master database of that lower-level master node, the method executes:
a step of the database processing unit of the lower-level master node referring to the master database; and
a step of referring to the heaptuple map one line at a time to determine whether the corresponding line number has been entered in the search processing, setting the master database as a direct search target when the corresponding line number has not been entered, and, when the corresponding line number has been entered, determining whether the entry is a deletion command or an update command, and removing the corresponding line number from the search target when the entry is the deletion command, and setting the entry of the shadow copy in the heaptuple map as the search target when the entry is the update command.

### Claim 4 (depends on 1, 2)

The method of managing a database according to claim 1 or claim 2,
wherein, in a stage where the write set is being generated in the lower-level master node, if search processing is performed on a master database of that lower-level master node, the method executes:
a step of the database processing unit of the lower-level master node referring to the master database;
a step of referring to the whole heaptuple map, extracting entries of line numbers to be the search target, and removing the all entered line numbers from the search target on the assumption that the line numbers have been deleted; and
a step of referring to the shadow copy, referring to line numbers of entries that have been added in the shadow copy, and setting only those line numbers as the search target.

### Claim 5 (depends on 1, 2)

The method of managing a database according to claim 1 or claim 2,
wherein, when the write set is generated in the lower-level master node, an area of a backend memory (BEM) in the lower-level master node for registering the write set can be referred to at least by the transaction log processing unit which executes an update instruction based on the transaction log distributed from the higher-level master node, and
when the transaction log processing unit refers to the backend memory (BEM) and if a corresponding line to be updated based on the update instruction is contained in the heaptuple map (HTM) of the write set, the transaction log processing unit aborts the transaction that is generating that heaptuple map (HTM).

### Claim 6

A database management method of a higher-level master node in a recordable database hierarchically including master nodes, comprising:
a step of a higher-level master node receiving a write set generated by a database processing unit of any one of lower-level master nodes from a shadow copy of a database and a heaptuple map expanded in its own memory, when an instruction for updating the database is issued in the lower-level master node;
a step of the higher-level master node comparing the heaptuple map in the received write set and its own database, and verifying whether a corresponding line of the database registered as a target has been updated by a different write set; and
a step of aborting the write set when the update has been performed, and updating its own database using the shadow copy when the update has not been performed.

### Claim 7 (depends on 6)

The database management method of a higher-level master node according to claim 6,
wherein the higher-level master node receives, as the write set, the shadow copy which is configured only from newly added lines in the lower-level master node.

### Claim 8

A database management method of a lower-level master node in a recordable database hierarchically including higher-level and lower-level master nodes in which records can be updated, comprising:
a step of a database processing unit of any one of lower-level master nodes generating, for a higher-level master node, a write set expanded in its own memory including a shadow copy of a database and a heaptuple map, when an instruction for updating the database is issued in the lower-level master node,
a step of sending the write set to the higher-level master node for causing the higher-level master node to compare the heaptuple map in the write set received from the lower-level master node and its own database, to verify whether a corresponding line of the database registered as a target has been updated by a different write set, to abort the write set when the update has been performed, to update the database of the higher-level master node using the shadow copy when the update has not been performed, to generate a record of this update as a transaction log, and to distribute the transaction log to the lower-level master nodes including the lower-level master node which has sent the write set; and
a step of a transaction log processing unit of the lower-level master node updating, upon receiving the transaction log, its own database based on the received transaction log.

### Claim 9 (depends on 8)

The database management method of a lower-level master node according to claim 8,
wherein the shadow copy of the write set in the lower-level master node is configured only from newly added lines.

### Claim 10 (depends on 8, 9)

The method of managing a database according to claim 8 or claim 9,
wherein, in a stage where the write set is being generated in the lower-level master node, if search processing is performed on a master database of that lower-level master node, the method executes:
a step of the database processing unit of the lower-level master node referring to the master database; and
a step of referring to the heaptuple map one line at a time to determine whether the corresponding line number has been entered in the search processing, setting the master database as a direct search target when the corresponding line number has not been entered, and, when the corresponding line number has been entered, determining whether the entry is a deletion command or an update command, and removing the corresponding line number from the search target when the entry is the deletion command, and setting the entry of the shadow copy in the heaptuple map as the search target when the entry is the update command.

### Claim 11 (depends on 8, 9)

The method of managing a database according to claim 8 or claim 9,
wherein, in a stage where the write set is being generated in the lower-level master node, if search processing is performed on a master database of that lower-level master node, the method executes:
a step of the database processing unit of the lower-level master node referring to the master database;
a step of referring to the whole heaptuple map, extracting entries of line numbers to be the search target, and removing the all entered line numbers from the search target on the assumption that the line numbers have been deleted; and
a step of referring to the shadow copy, referring to line numbers of entries that have been added in the shadow copy, and setting only those line numbers as the search target.

### Claim 12 (depends on 8, 9)

The method of managing a database according to claim 8 or claim 9,
wherein, when the write set is generated in the lower-level master node, an area of a backend memory (BEM) in the lower-level master node for registering the write set can be referred to at least by the transaction log processing unit which executes an update instruction based on the transaction log distributed from the higher-level master node, and
when the transaction log processing unit refers to the backend memory (BEM) and if a corresponding line to be updated based on the update instruction is contained in the heaptuple map (HTM) of the write set, the transaction log processing unit aborts the transaction that is generating that heaptuple map (HTM).
