WO2015145587A1 - データベースシステム、情報処理装置、方法およびプログラム - Google Patents

データベースシステム、情報処理装置、方法およびプログラム Download PDF

Info

Publication number
WO2015145587A1
WO2015145587A1 PCT/JP2014/058382 JP2014058382W WO2015145587A1 WO 2015145587 A1 WO2015145587 A1 WO 2015145587A1 JP 2014058382 W JP2014058382 W JP 2014058382W WO 2015145587 A1 WO2015145587 A1 WO 2015145587A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
data
identification information
request
transaction log
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.)
Ceased
Application number
PCT/JP2014/058382
Other languages
English (en)
French (fr)
Inventor
山田 浩之
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Murakumo Corp
Original Assignee
Murakumo 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 Murakumo Corp filed Critical Murakumo Corp
Priority to EP14886733.6A priority Critical patent/EP3125123A4/en
Priority to JP2016509682A priority patent/JP6461101B2/ja
Priority to PCT/JP2014/058382 priority patent/WO2015145587A1/ja
Publication of WO2015145587A1 publication Critical patent/WO2015145587A1/ja
Priority to US15/274,446 priority patent/US10579604B2/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/273Asynchronous replication or reconciliation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2358Change logging, detection, and notification
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results

Definitions

  • the present invention relates to a technique for managing a database.
  • Patent Document 1 a database management system that receives a transaction log transmitted from another server node in preparation for its own failure and reflects the received transaction log in a database has been proposed (see Patent Document 1).
  • the master creates a plurality of transaction logs in parallel, sends the plurality of transaction logs created in parallel to other masters or slaves, and the other masters or slaves in parallel with the plurality of transaction logs in the database.
  • a technique to be applied has been proposed (see Patent Document 2).
  • an object of the present invention is to accept queries from user terminals at a plurality of nodes while saving storage and memory in a database system.
  • the present invention employs the following means in order to solve the above-described problems. That is, the present invention is a database system having a plurality of nodes, and among the plurality of nodes, the first node uses the transaction log of the database managed by the first node as the transaction log.
  • Log holding means for holding the order of such instructions together with identification information that can be grasped, and a second node that is different from the first node among the plurality of nodes, of data managed by the first node Specific identification information indicating a transaction log at a predetermined point in time for the requested data, among the identification information held by the log holding means in response to the transmission request, a request receiving means for receiving a transmission request Specific identification information transmitting means for transmitting to the second node, and at least the token after the predetermined time point.
  • Log transmission means for transmitting the transaction log and the identification information to the second node in association with each other, and in response to the transmission request, requested data among the data managed by the database
  • Data transmission means for transmitting to the second node after the time point, the second node accepting a search request from a user terminal, and in response to the search request, the second node Request transmission means for transmitting the transmission request for data related to at least the search request in the database to one node; from the first node, the transaction log, identification information of the transaction log, and the specification Receiving means for receiving the identification information and the data; and the received data is stored in the memory of the second node.
  • an instruction related to the transaction log that is newer than the transaction log indicated by the specific identification information among the received transaction logs is stored in the memory.
  • a search response means to be returned to the user terminal, and data obtained from the first node as a result of the search request and executed by the command based on the transaction is used for a response by the search response means, And a deletion unit that automatically deletes from the second node according to a condition. It is.
  • the first node in response to a request from the second node that has received the search request, specific identification information indicating a transaction log at a predetermined time point, a transaction log after the predetermined time point, And data after a predetermined time is transmitted to the second node. Then, the second node expands the received data into a memory and puts it into a state for search or the like (for example, a page including the data is a so-called cache), and issues a command related to a transaction log after a predetermined time point. Executed on the data (cache) expanded in the memory.
  • data is acquired in response to a search request, and a command related to a transaction log is executed (reflecting the transaction log) at the time when it is expanded in a memory to be used for search or the like. Queries from user terminals are accepted while saving storage and memory used for replication.
  • the deletion unit may delete the data when a predetermined time has elapsed from a time point related to the processing related to the data.
  • the second node determines whether or not the data obtained from the first node as a result of the search request and for which the instruction based on the transaction is executed is to be retained in the second node. And a deletion unit that automatically deletes data that has not been determined to be retained by the determination unit in accordance with the predetermined condition.
  • the second node may further include recording means for recording the data determined as the retention target by the determination means in a nonvolatile storage device.
  • the data transmission means may transmit the data for each predetermined management unit that is divided so that records in which the order of instructions related to the transaction log are dependent on each other are included in the same management unit. .
  • the database system includes the predetermined management unit in which data to be commanded is accommodated based on at least the transaction log indicated by the specific identification information among the received transaction logs.
  • Map generating means for generating a map showing the relationship between the command contents and the instruction content, wherein the execution means refers to the map and executes the command related to the transaction log for each predetermined management unit. Also good.
  • the database system indicates a relationship between the data to be commanded and the content of the command based on at least the transaction log that is newer than the transaction log indicated by the specific identification information among the received transaction logs.
  • Map generation means for generating a map may be further provided, and the execution means may execute an instruction related to the transaction log with respect to data to be an instruction target with reference to the map.
  • the data transmission means may transmit data in a state of being developed in the memory of the first node and used for data search or processing to the second node.
  • the data transmission unit transmits the management information of the database to the second node, and the request transmission unit refers to the management information to the first node in the database.
  • the transmission request may be transmitted by designating the data.
  • the second node further includes expansion means for directly expanding the data received from the first node into a memory for use in data search or processing, and the execution means includes the received data as the expansion.
  • an instruction relating to the transaction log may be executed on the data.
  • the specific identification information transmitting unit may transmit, as the specific identification information, identification information indicating the latest transaction log among the identification information held by the log holding unit.
  • data may be transmitted and received in units of tables or pages.
  • the execution means may execute the command related to the transaction log with respect to the received data according to the order of the commands grasped by the identification information.
  • the present invention can be understood as a computer system, an information processing apparatus, a method executed by a computer, or a program executed by a computer.
  • the present invention can also be understood as a program recorded on a recording medium readable by a computer, other devices, machines, or the like.
  • a computer-readable recording medium refers to a recording medium that accumulates information such as data and programs by electrical, magnetic, optical, mechanical, or chemical action and can be read from a computer or the like.
  • FIG. 5 is a flowchart illustrating a flow of management information transmission / reception processing executed by a first node and a second node in the embodiment. In an embodiment, it is a flow chart which shows a flow of database transmission and reception processing performed by the 1st node and the 2nd node. In an embodiment, it is a flow chart which shows a flow of map generation processing performed by the 2nd node. 6 is a flowchart illustrating a flow of update execution processing executed by a second node in the embodiment.
  • it is a flowchart (1) which shows the flow of the search request response process performed by the 2nd node.
  • It is a figure which shows the outline of a function structure of the 1st node which concerns on embodiment, and a 2nd node.
  • 6 is a flowchart illustrating a flow of transaction log transmission / reception start processing executed by the first node and the second node in the embodiment.
  • it is a flow chart which shows a flow of on-demand processing performed by the 2nd node.
  • the write-once type database system is a type of database system that updates data by adding new data without overwriting old data with new data when updating data.
  • the system, the information processing apparatus, the method, and the program according to the present disclosure can be widely used for a technique for using data managed by a certain node in another node in a system having a plurality of nodes.
  • the application target of the disclosure is not limited to the example shown in the present embodiment.
  • FIG. 1 is a diagram illustrating an outline of a hardware configuration of a system according to the present embodiment.
  • the system according to the present embodiment includes a plurality of nodes (information processing devices) 1 for responding to a search request (query) from the user terminal 9.
  • the plurality of nodes 1 are communicably connected to each other via a network.
  • any one of the nodes 1 for which a database has already been constructed can be used as the first node 1A having the original database in the present embodiment.
  • the second node 1B that receives data from the first node 1A is a node in which database software is installed, but the contents of the database are not constructed.
  • node 1 when describing a node in general without distinguishing between nodes, it is described as “node 1”, and when distinguishing between nodes, “first node 1A” and “second node 1B” are described. As shown, add a subscript.
  • any of the master node and the slave node in the database system may be It can be the node 1A or the second node 1B.
  • the first node 1A and the second node 1B include control units 10A and 10B including CPUs (Central Processing Units) 11A and 11B, RAMs (Random Access Memory) 12A and 12B, ROMs (Read Only Memory) 13A and 13B, and the like. And auxiliary storage devices 14A and 14B and communication interfaces 15A and 15B.
  • control units 10A and 10B including CPUs (Central Processing Units) 11A and 11B, RAMs (Random Access Memory) 12A and 12B, ROMs (Read Only Memory) 13A and 13B, and the like.
  • auxiliary storage devices 14A and 14B and communication interfaces 15A and 15B auxiliary storage devices 14A and 14B and communication interfaces 15A and 15B.
  • the specific hardware configuration of the node 1 can be appropriately omitted, replaced, or added according to the embodiment.
  • the node 1 is not limited to a single device.
  • the node 1 may be realized by a plurality of devices using a so-called cloud or distributed computing technology
  • each record in the database is managed in units of pages, and data exchange between the storage (for example, auxiliary storage devices 14A and 14B) and the memory (for example, RAM 12A and 12B) is performed. This is done in units of pages.
  • data that has been expanded in a memory or the like and is used for data search or processing is referred to as a cache.
  • the data on the storage is not being used for data retrieval or processing. That is, when the contents of the database are targeted for processing such as search and update, each node reads a page including the target record from the storage and uses it as a cache, and performs processing related to the target record.
  • each node stores the update of the database by writing a cache page including the record to the storage. Note that the timing at which a page is written to the storage is appropriately determined according to the embodiment.
  • One or more records are stored in the page.
  • the page may be referred to as a block, and corresponds to a “predetermined management unit” of the present invention.
  • data is requested in units of pages and data is transmitted and received in units of pages even in a transmission / reception process between nodes described later.
  • performing reading / writing and transmission / reception of data in units of pages is an example of a specific configuration that can be employed when implementing the present disclosure, and the technical scope of the present disclosure includes reading / writing in units of pages. It is not limited to writing and transmission / reception. Data read / write and transmission / reception may be performed in units of tables, for example, or may be performed in other management units.
  • FIG. 2 is a diagram showing an outline of a functional configuration of the first node 1A and the second node 1B according to the present embodiment.
  • the CPU 11A interprets and executes various programs expanded in the RAM 12A, and controls various hardware provided in the node 1A, whereby the log holding unit 21, the request It functions as a computer including the receiving unit 22, the specific identification information transmitting unit 23, the log transmitting unit 24, and the data transmitting unit 25.
  • the functions of the first node 1A are executed by the general-purpose CPU 11A. However, some or all of these functions are realized by one or a plurality of dedicated processors. May be.
  • the log holding unit 21 is identification information that can grasp a transaction log (hereinafter referred to as “transaction log”) in a database managed by the first node 1A in a time-series order of instructions included in the transaction. Hold with LSN (Log Sequence Number).
  • the command includes an update command related to database update and a management command related to transaction management.
  • a transaction log is generated every time a transaction occurs in a node, and an LSN is added and held by the log holding unit 21.
  • the request reception unit 22 receives a transmission request for data managed by the first node 1A and transmitted by the second node 1B.
  • the specific identification information transmission unit 23 transmits the specific identification information (specific LSN) indicating the transaction log at a predetermined time among the LSNs held by the log holding unit 21 to the data transmission request received by the request reception unit 22. In response, the data is transmitted to the second node 1B.
  • the specific LSN transmitted here may be determined for each requested page.
  • the specific identification information transmission unit 23 transmits an LSN indicating the latest transaction log as the specific LSN.
  • the specific LSN to be transmitted is not limited to the LSN indicating the latest transaction log as long as it indicates the transaction log at a predetermined time point for determining the transaction log to be reflected in the second node 1B. .
  • the log transmission unit 24 transmits at least a transaction log and an LSN after a predetermined time indicated by the specific LSN to the second node 1B in association with each other. After starting the transmission of the transaction log, the log transmission unit 24 sequentially transmits the newly generated transaction log to the second node 1B.
  • the data transmission unit 25 is a page related to the request among the pages managed by the database in response to the data transmission request received by the request reception unit 22, and at least contents up to a predetermined time point related to the specific LSN Is transmitted to the second node 1B.
  • the data transmission unit 25 divides data into a predetermined management unit (in this embodiment, divided in such a way that records in which the order of update commands based on the transaction log are mutually dependent are included in the same management unit. , Page).
  • the data transmission unit 25 transmits data that is expanded in the memory of the first node 1A and is used for data search or processing, that is, cache, to the second node 1B. To do.
  • the first node 1A reads the target page from the storage and sets it as a cache. This is because, in the database system according to the present embodiment, the update of data generated in each node 1 is immediately reflected in the cache, and the cache represents the latest state of the data.
  • the data to be transmitted can be a page that reflects the contents up to a predetermined time related to a specific LSN that is an LSN indicating the latest transaction log. .
  • the data to be transmitted is not limited to the cache employed in the present embodiment, as long as it reflects at least the contents up to a predetermined time relating to the specific LSN.
  • the database system to which the present disclosure is applied can guarantee that the data in the storage reflects at least the contents up to a predetermined time related to the specific LSN, the data read from the storage May be transmitted as is.
  • the CPU 11B interprets and executes various programs expanded in the RAM 12B, and controls various hardware provided in the node 1B, whereby the request transmission unit 31.
  • Functioning as a computer including a data reception unit 32, an execution unit 33, a map generation unit 34, a search request reception unit 35, a search response unit 36, and a development unit 37.
  • a data reception unit 32 an execution unit 33, a map generation unit 34, a search request reception unit 35, a search response unit 36, and a development unit 37.
  • the functions of the second node 1B are executed by the general-purpose CPU 11B.
  • some or all of these functions are realized by one or a plurality of dedicated processors. May be.
  • the request transmission unit 31 transmits a data transmission request to the first node 1A by designating data in the database.
  • the designation of data is performed on a page basis.
  • the data receiving unit 32 receives the transaction log, the LSN of the transaction log, the specific LSN for each page, and data from the first node 1A. As described above, in the present embodiment, data transmission / reception is performed in units of pages.
  • the execution unit 33 is transmitted from the first node 1A in response to the data transmission request, and the data received by the data reception unit 32 is expanded in the memory of the second node 1B for data search or processing. Executes update instructions included in the transaction log that is newer than the transaction log related to the specific LSN among the received transaction logs to the data expanded in the memory when the state becomes available (cache) To do.
  • the update command included in the transaction log is executed according to the order grasped by the LSN.
  • the map generation unit 34 Based on a transaction log that is at least newer than the transaction log indicated by the specific LSN among the received transaction logs, the map generation unit 34 includes a page containing data that is a target of an update instruction included in the transaction log, and the page A map showing the relationship with the update command is generated.
  • the map generation unit 34 since data is managed with pages, the map generation unit 34 generates a map indicating the relationship between the update instruction and the page containing the data to be updated.
  • the map generation means may generate a map indicating the relationship between other management units (for example, a table or the like) and the update command. Further, the map generation means may generate a map indicating the relationship between the record to be the update command and the update command without using such a management unit.
  • the search request receiving unit 35 receives a search request (query) from the user terminal 9.
  • the search response unit 36 returns a response to the search request (query) to the user terminal 9 based on the data obtained from the first node 1A and reflecting the update command based on the transaction log.
  • the expansion unit 37 expands the data received from the first node 1A in the memory, and provides the data for search or processing.
  • the expansion unit 37 uses the data received from the first node 1A as a cache in response to a query or a request in an update execution process, which will be described later.
  • FIG. 3 is a flowchart showing the flow of management information transmission / reception processing executed by the first node 1A and the second node 1B in the present embodiment. The processing shown in this flowchart is started when the second node 1B receives an instruction to start database construction.
  • a management information request is transmitted / received.
  • the request transmission unit 31 specifies database management information (system catalog or the like) and transmits a data transmission request to the first node 1A (step S101).
  • the management information includes information that can specify the position of the table or record in the database. Since the database according to the present embodiment is managed in units of pages, the management information includes information that can specify the relationship between the database table and the page. In the present embodiment, management information is read / written and transmitted / received in units of pages as in other tables. However, the management information may be requested according to other units such as a table unit, similar to the above-described data read / write and transmission / reception.
  • the request receiving unit 22 receives the request transmitted by the second node 1B (step S102). Thereafter, the process proceeds to step S103.
  • a response to the data transmission request (acknowledgment, hereinafter referred to as “ACK”) is transmitted and received.
  • This ACK includes the specific LSN of the management information.
  • the LSN is identification information capable of grasping the order of instructions (update instructions) included in the transaction log
  • the specific LSN is a predetermined point in time among LSNs held by the log holding unit 21. Is an LSN indicating the transaction log (the latest transaction log in this embodiment). That is, the specific identification information transmission unit 23 transmits an ACK including the specific LSN related to the requested management information among the LSNs held by the log holding unit 21 to the second node 1B (step S103). ).
  • the data receiving unit 32 receives an ACK including the specific LSN from the first node 1A (step S104). Thereafter, the process proceeds to step S105.
  • step S105 and step S106 transmission / reception of a transaction log is started.
  • the log transmission unit 24 transmits a transaction log and an LSN after a predetermined time point to the second node 1B in association with each other (step S105). Thereafter, the transaction log generated in the first node 1A is sequentially and continuously transmitted to the second node 1B.
  • the “predetermined time point” is a time point when the transaction log indicated by the specific LSN transmitted in step S103 is generated.
  • the data receiving unit 32 starts receiving the transaction log and the LSN related to the transaction log transmitted by the first node 1A (step S106).
  • a transaction log newly generated in the first node 1A is transmitted to the second node 1B and received by the second node 1B as soon as it occurs. That is, the second node 1B receives all transaction logs after a predetermined time after the log transmission is started. Thereafter, the process proceeds to step S107.
  • the processing order is not limited to the example shown in this flowchart.
  • all the transaction logs after the time indicated by the specific LSN among the transaction logs related to the target page may be received by the second node 1B. For this reason, for example, the processing order of the transmission / reception processing in steps S103 and S104 and the transmission / reception processing in steps S105 and S106 may be switched.
  • step S107 a map generation process is started for management information.
  • the map generation unit 34 sets a page related to management information as a target of map generation processing. That is, after this step, generation of a map in which a combination of an update command executed on the management information and an execution target (target page, target table, target record, etc.) of the update command is started is started.
  • the map generation process is executed in parallel with the process shown in this flowchart. Details of the map generation processing will be described with reference to FIG. Thereafter, the process proceeds to step S108.
  • step S108 and step S109 database management information is transmitted and received.
  • the data transmission unit 25 transmits database management information (system catalog or the like) to the second node 1B (step S108).
  • the data transmission unit 25 transmits a cache of data to be transmitted to the second node 1B.
  • the first node 1A reads the target data from the storage as a cache, and at least the data reflecting the contents up to a predetermined time related to the specific LSN To the second node 1B.
  • the data receiving unit 32 of the second node 1B receives management information from the first node 1A (step S109). Thereafter, the process proceeds to step S110.
  • step S108 the transmission of management information (step S108) is described after the start of map generation (step S107), but the management information is transmitted after a predetermined time related to the specific LSN.
  • the transmission timing is not limited to the example shown in this flowchart.
  • step S110 update execution processing is started.
  • the execution unit 33 sets a page related to management information as a target of update execution processing. That is, after this step, an update command not reflected in the management information recorded in the map in the map generation process is executed.
  • the update execution process is executed in parallel with the process shown in this flowchart. Details of the update execution process will be described with reference to FIG. Thereafter, the process proceeds to step S111.
  • step S111 acceptance of a search request (query) is started.
  • the second node 1B starts accepting a query transmitted from the user terminal 9 by starting the search request handling process.
  • the search request receiving unit 35 receives a query from the user terminal 9, and when the query is received, a page necessary for responding to the query is acquired by referring to the management information.
  • the search request handling process is executed in parallel with the process shown in this flowchart. Details of the search request handling process will be described with reference to FIGS. Thereafter, the processing shown in this flowchart ends.
  • management information is duplicated using the map generation process, the update execution process, and the search request handling process, as with other tables in the database.
  • Other methods may be employed.
  • duplicating the management information for example, a conventional method of creating a checkpoint and duplicating a snapshot of the checkpoint can be employed.
  • FIG. 4 is a flowchart showing the flow of database transmission / reception processing executed by the first node 1A and the second node 1B in the present embodiment.
  • the processing shown in this flowchart allows the second node 1B to grasp the database page configuration managed by the first node 1A by receiving the database management information from the first node 1A. It starts when it becomes.
  • a data transmission request is transmitted and received.
  • the request transmission unit 31 refers to the management information cache, and transmits a data transmission request to the first node 1A by designating a page in the database (step S201). For example, a page number may be used for designating a page.
  • the data transmission request may be a page specifying a page or a specific record in the database. In this embodiment, data is requested in units of pages, but it may be requested in accordance with other units such as a table as described above.
  • the request receiving unit 22 receives a data transmission request managed by the first node 1A from the second node 1B (step S202). Thereafter, the process proceeds to step S203.
  • step S203 and step S204 an ACK for the data transmission request is transmitted / received.
  • This ACK includes the page number and the specific LSN of the page. That is, the specific identification information transmission unit 23 transmits an ACK including the specific LSN related to the requested page among the LSNs held by the log holding unit 21 to the second node 1B (step S203). .
  • the data receiving unit 32 receives an ACK including the specific LSN from the first node 1A (step S204). Thereafter, the process proceeds to step S205.
  • step S205 the map generation process is started for the page related to the request.
  • the map generation unit 34 sets the page requested in step S201 as a target of map generation processing. That is, after this step, generation of a map in which a combination of an update instruction executed on the requested page and a target of execution of the update instruction (target page, target table, target record, etc.) is started is started.
  • the content of the map generation process started here is substantially the same as that started for the management information in step S107 (see FIG. 5), and is processed in parallel with the process shown in this flowchart. . Thereafter, the process proceeds to step S206.
  • map generation start timing is different for each management information and page (see step S107 and step S205), but the map generation start timing is the same for the entire database. May be.
  • step S206 and step S207 the requested page is transmitted and received.
  • the data transmission unit 25 transmits the requested page among the pages managed by the database to the second node 1B (step S206). At this time, the data transmission unit 25 transmits a cache of data to be transmitted to the second node 1B.
  • the first node 1A reads the target page from the storage as a cache, and at least as a page reflecting the contents up to a predetermined time related to the specific LSN To the second node 1B.
  • the data receiving unit 32 of the second node 1B receives data from the first node 1A (step S207).
  • the data transmission / reception unit may be any unit according to the request, and may be any of a page unit, a table unit, and a record unit. Thereafter, the process proceeds to step S208.
  • step S206 the transmission of data (step S206) is described after the start of map generation (step S205).
  • step S205 the transmission of data
  • the transmission timing is not limited to the example shown in this flowchart.
  • step S208 update execution processing is started.
  • the execution unit 33 sets the data received in step S207 as a target for the update execution process. That is, after this step, an unexecuted update command recorded in the map by the map generation process is executed. Thereafter, the processing shown in this flowchart ends.
  • the database transmission / reception process shown in FIG. The process is repeatedly executed while sequentially changing the requested page until acquisition of the page is completed. That is, the request transmission unit 31 transmits a data transmission request for all pages or tables grasped by referring to the management information by repeating the processing from step S201 to step S208. However, if it is not necessary for the second node 1B to acquire all the data in the database of the first node 1A, the request transmission unit 31 can store the data only for some necessary pages and tables. A transmission request may be made.
  • step S201 an example in which the processing from step S201 to step S208 is repeated when a plurality of pages is acquired has been described. However, when a plurality of pages are acquired, a plurality of pages are collectively requested in step S201. It is good as well.
  • the data received from the first node 1A is temporarily stored in the storage.
  • the expansion unit 37 expands the data received from the first node 1A directly into the memory without passing through the storage (the auxiliary storage device 14B in this embodiment), and the data You may use for search or processing.
  • the update command related to the received data is immediately reflected according to the map generation process described later.
  • the database of the second node 1B is managed by map generation processing, update execution processing, and search request response processing.
  • the second node 1B launches a plurality of instances for executing these processes as appropriate and executes them in parallel, thereby generating a map, reflecting a mapped update instruction, and processing a search request (query). Can be processed in parallel.
  • FIG. 5 is a flowchart showing the flow of map generation processing executed by the second node 1B in this embodiment. The process shown in this flowchart is repeatedly executed on the data (see Step S107 and Step S205) that is the target of the map generation process.
  • step S301 instructions included in the transaction log are referred to in chronological order with reference to the LSN.
  • the second node 1B refers to the instructions included in the unreflected transaction log in order from the oldest point in time (the one with the smallest LSN).
  • the transaction log referred to here is one received and received by the second node 1B after transmission / reception is started in the processing of step S105 and step S106. Thereafter, the process proceeds to step S302.
  • step S302 and step S303 it is determined whether or not the instruction is an update instruction, and an instruction other than the update instruction is executed.
  • the second node 1B determines whether or not the instruction referred to in step S301 is an update instruction (step S302). If the referenced instruction is an instruction other than the update instruction (for example, a management instruction such as commit), the instruction is executed as it is (step S303). On the other hand, if the referenced instruction is an update instruction, the process proceeds to step S304.
  • step S304 it is determined whether or not the page indicated by the referenced instruction is the target of map generation processing.
  • the second node 1B determines whether the target data is set as a target for map generation processing in step S107, step S205, or the like.
  • the process shown in the flowchart ends.
  • the process proceeds to step S305.
  • step S305 it is determined whether or not the target data (page) cache exists. If the referenced instruction is an update instruction, the second node 1B determines that the update instruction (for example, a DELETE instruction) whose target exists in the database when the instruction is referenced is the target of the update instruction. It is determined whether or not the cache exists. On the other hand, for an update instruction (for example, an INSERT instruction) whose target does not exist in the database when the instruction is referenced, whether or not there is a cache of data in the area where the target of the update instruction is inserted It is determined whether or not the cache subject to the update instruction exists. When records are managed in units of pages, the second node 1B determines whether there is a cache of a page including the update command target. If there is a cache for the target page, the process proceeds to step S306. On the other hand, if there is no cache for the target page, the process proceeds to step S307.
  • the update instruction for example, a DELETE instruction
  • step S306 an update command related to the transaction log is executed.
  • the execution unit 33 executes an update command related to the transaction log on the received data that is expanded in the memory by the expansion unit 37 and becomes a cache. Thereafter, the process proceeds to step S308.
  • step S307 a map is generated.
  • the map generation unit 34 is the target of the update command included in the transaction log. Information indicating the relationship between the page in which the data is stored and the update command is recorded in the map, thereby waiting for execution of the update command.
  • the map generation unit 34 maps the update instruction as a target of mapping (map generation) and records the content of the standby update instruction in association with the record. Generate.
  • all update instructions may be targets for map generation.
  • At least one of the content of the update command that has been waited and the LSN is recorded in the map in association with the page (specifically, the page number) that includes the record that is the target of the update command. . Thereafter, the process proceeds to step S308.
  • step S308 it is determined whether or not to end the map generation process. If the map generation process is not completed, the process returns to step S301, the next command is referred to in the time series order (LSN order) in the transaction log, and is the target of the process shown in steps S304 to S307.
  • the map generation process is repeatedly executed while the second node 1B is operated. That is, in the present embodiment, the second node 1B inspects the received transaction logs in order from the oldest one, and the page that is the target of the update command included in the transaction log is on-memory (cache). In this case, an update command corresponding to the transaction log is executed for the cache.
  • the map generation process is terminated because the second node 1B is stopped, the process illustrated in this flowchart is terminated.
  • the map generated by the map generation process is referred to in the update execution process or the search request handling process when the target page becomes a cache, and the update is made to wait in the map in the update execution process or the search request handling process
  • the instruction is executed. That is, according to the system according to the present embodiment, the reflection of the transaction log with respect to the data received from the first node is delayed until the time when the target data is actually used (in other words, the time when the data becomes a cache). I can do it.
  • the transaction log recording the contents of the update command is held in the RAM 12B or the auxiliary storage device 14B of the node 1B.
  • the update execution process or the search request handling process the transaction log held in the RAM 12 or the storage device 14 is accessed based on the LSN recorded in the map, and the contents of the update command to be executed are specified.
  • the content of the update command or the LSN is recorded in the map according to the referred order.
  • the execution order of the waited update instructions can be recognized.
  • the update command is updated by the LSN of the waited update command. Can recognize the execution order.
  • FIG. 6 is a flowchart showing the flow of update execution processing executed by the second node 1B in this embodiment. The processing shown in this flowchart is repeatedly executed while there is an update command waiting in the map.
  • step S401 it is determined whether there is a waiting update command.
  • the second node 1B refers to the map and determines whether or not there is a waiting update command. If the waiting update command is not recorded in the map, the processing shown in this flowchart is terminated. On the other hand, when the waiting update command is recorded in the map, the second node 1B selects the management unit including the data to be the target of the update command as the processing target, and performs the processing in step S402. Proceed to
  • step S402 it is determined whether there is an update target.
  • the second node 1B determines whether or not the processing target selected in step S401 exists in the second node 1B. In other words, the page to be processed has already been received from the first node 1A. It is determined whether or not it is done. If there is no page to be updated, the process returns to step S401. That is, the second node 1B refers to the map and waits for an update command waiting for a page existing in the second node 1B. If there is a page to be updated, the process proceeds to step S404.
  • step S403 an update command related to the update target page is extracted from the map.
  • the second node 1B extracts all update instructions for the update target page determined to exist in step S402 from the map. In this way, all the update instructions on the map relating to the update target page are executed, and the page on which the update instruction is executed can be directly used as a cache for data search or processing. Thereafter, the process proceeds to step S404.
  • step S404 the expansion unit 37 reads the target to be processed from the auxiliary storage device 14B into the RAM 12B, thereby forming a cache. Thereafter, the process proceeds to step S405.
  • step S405 and step S406 the update command waiting in the map and the extracted update command are executed, and the executed update command is deleted from the map.
  • the execution unit 33 refers to the map and executes an update command associated with the processing target selected by the execution unit 33 (step S405). That is, the execution unit 33 executes the update command found in step S401 and the update command extracted in step S403 for each page that is a predetermined management unit in the order recorded in the map. For example, when the update command is a delete command, the execution unit 33 gives a delete pointer to the target record. Then, the second node 1B deletes the record relating to the executed update command from the map after executing the update command waiting for the processing target selected by itself (step S406). Thereafter, the process proceeds to step S407.
  • step S407 it is determined whether or not to end the update execution process. If the update execution process is not terminated, the process returns to step S401. That is, in the update execution process, when a plurality of update commands are waiting on the page selected as the processing target, the standby update commands are executed in the order recorded in the map (LSN order). Thereby, with respect to the page, the consistency of the database can be maintained while replication is being executed between the node 1 and the replication source computer. On the other hand, when the update execution process is terminated, for example, because the second node 1B is stopped, the process illustrated in this flowchart is terminated.
  • the second node 1B may launch a plurality of instances for executing the update execution process. By generating, deleting, starting, or stopping such instances, the second node 1B The number may be increased or decreased.
  • the second node 1B may increase or decrease the number of instances to be activated in accordance with the number of management units (in the present embodiment, the number of pages) of update instructions that are recorded in a waiting state that are recorded in the map. Good.
  • the processing capability of the update execution process can be changed according to the request, and it is possible to avoid the useless instance, so that resources can be efficiently used.
  • a predetermined number of instances for executing the update execution process may be activated in advance. In this case, it is not necessary to start an instance again when a request for processing occurs, so that it is possible to quickly respond to the generated request.
  • FIGS. 7 and 8 are flowcharts showing the flow of the search request handling process executed by the second node 1B in the present embodiment. The process shown in this flowchart is started when the second node 1B receives a query from the user terminal 9 or the like.
  • step S501 a query is accepted.
  • the search request receiving unit 35 receives a query from the user terminal 9. Thereafter, the process proceeds to step S502.
  • step S502 it is determined whether or not a management information cache exists.
  • the search response unit 36 determines whether or not a management information cache exists in the memory. In this embodiment, since records are managed in units of pages, the search response unit 36 determines whether there is a page cache including management information as a search target.
  • the search response unit 36 does not read from the storage area, refers to the management information that already has a cache, and the process proceeds to step S508. On the other hand, if there is no management information cache, the process advances to step S503.
  • step S503 management information is read from the storage.
  • management information transmission / reception processing is performed at the time of starting construction of the database (see FIG. 3)
  • the second node 1B Management information is stored in the storage.
  • the expansion unit 37 reads the management information from the storage (auxiliary storage device 14B) to the RAM 12B. Thereafter, the process proceeds to step S504.
  • step S504 it is determined whether there is a waiting update command.
  • the second node 1B refers to the map and determines whether or not there is an update command waiting for the management information page read into the RAM 12B. If the update instruction waiting for the page read into the RAM 12B is not recorded in the map, the process proceeds to step S508. On the other hand, if an update command waiting for the page read into the RAM 12B is recorded in the map, the process proceeds to step S505.
  • step S505 an update command related to the update target page is extracted from the map.
  • the second node 1B extracts all update instructions for the update target page (in this case, the page including the management information) determined to exist in step S503 from the map. In this way, all the update instructions on the map relating to the update target page are executed, and the page on which the update instruction is executed can be directly used as a cache for data search or processing. Thereafter, the process proceeds to step S506.
  • step S506 and step S507 the update instruction waiting in the map and the extracted update instruction are executed, and the executed update instruction is deleted from the map.
  • the execution unit 33 refers to the map and executes an update command associated with the management information read to the RAM 12B (step S506). That is, in the present embodiment, the second node 1B expands the management information (step S207) received by the data receiving unit 32 in the memory (step S503) according to the query (step S501), and based on the map. The update command is executed on the management information.
  • the execution unit 33 executes the standby update commands in the order recorded in the map.
  • the second node 1B executes all the update instructions waiting for the management information read to the RAM 12B, and then deletes the record related to the executed update instruction from the map (step S507). Thereafter, the process proceeds to step S508.
  • step S508 the management information is referred to identify the page.
  • the search response unit 36 refers to the management information in order to specify the storage area specified as the search range by the received query.
  • a page including data necessary for processing a query is specified by referring to management information. Thereafter, the process proceeds to step S511.
  • step S511 it is determined whether or not there is a cache of the search target data (page).
  • the search response unit 36 accesses the storage area specified in the search range by the query in order to extract a record that matches the content of the received query. Then, the search response unit 36 determines whether or not a record cache relating to the query exists in the memory. In the present embodiment, since records are managed in units of pages, the search response unit 36 determines whether or not there is a cache of a page including a record to be searched.
  • an update command that is put on standby is executed for the page (the processing shown in steps S515 to S518 in FIG. 6 and FIG. 8 to be described later). reference).
  • an update instruction for a page in which a cache exists is immediately executed (see the map generation process described with reference to FIG. 5). For this reason, in this embodiment, when the cache of the page included in the search range already exists (when the determination result in step S511 is “YES”), the execution of the update instruction for the page is not awaited. .
  • the search response unit 36 does not read from the storage area, sets the page that already has the cache as the target of the search process, and the process proceeds to step S519. On the other hand, if there is no cache for the target page, the process proceeds to step S512.
  • step S512 it is determined whether the search target page exists in the storage (database) of the second node 1B. As described above, in this embodiment, since the page transmission request is sequentially performed (see step S201), when the second node 1B does not have a page related to the query at the time of receiving the query. There is. If it is determined that the page does not exist in the storage, the process proceeds to step S514 in order to acquire the corresponding page from the first node 1A. On the other hand, if it is determined that the page exists in the storage, the process proceeds to step S513.
  • step S514 the database transmission / reception process shown in FIG. 4 is executed. If it is determined in step S512 that the page does not exist in the storage, the request transmission unit 31 transmits at least data related to the query in the database to the first node 1A and transmits a data transmission request.
  • the pages shown in the management information are obtained in order by repeating the database transmission / reception process shown in FIG. 4, but the page that is the search target in response to the search request in step S501 is as follows. Ignoring this order, data transmission is requested with priority. That is, according to the present embodiment, a page that is a search target in response to a search request can be preferentially a target of a request (data transmission request). Thereafter, the process returns to step S511.
  • step S501 the response to the query accepted in step S501 is that the target page is the first node 1A. Wait until it is acquired.
  • step S513 the search target page is read from the storage.
  • the expansion unit 37 reads the page from the storage (auxiliary storage device 14B) to the RAM 12B when there is no cache of the search target data (page), but exists in the storage of the second node 1B, and performs the search processing target. And Thereafter, the process proceeds to step S515.
  • the expansion unit 37 when the expansion unit 37 reads out pages included in the search range from the auxiliary storage device 14B to the RAM 12B, for example, the expansion unit 37 may read out the target pages one by one, or may read out a plurality of pages at once. Good. In this case, every time one or more pages are read, the execution unit 33 executes the processing from step S515 described later on the read one or more pages.
  • step S515 it is determined whether there is a waiting update command.
  • the second node 1B refers to the map and determines whether there is an update instruction waiting for the page read to the RAM 12B. If the update instruction waiting for the page read into the RAM 12B is not recorded in the map, the process proceeds to step S519. On the other hand, when the update command waiting for the page read into the RAM 12B is recorded in the map, the process proceeds to step S516.
  • step S516 an update command related to the update target page is extracted from the map.
  • the second node 1B extracts all update instructions for the update target page determined to exist in step S515 from the map. In this way, all the update instructions on the map relating to the update target page are executed, and the page on which the update instruction is executed can be directly used as a cache for data search or processing. Thereafter, the process proceeds to step S517.
  • step S517 and step S518, the update command waiting in the map and the extracted update command are executed, and the executed update command is deleted from the map.
  • the execution unit 33 refers to the map and executes an update command related to the page read to the RAM 12B (step S517). That is, in the present embodiment, the second node 1B expands the data (step S207) received by the data receiving unit 32 in the memory (step S513) according to the query (step S501), and based on the map. An update instruction is executed on the data.
  • the execution unit 33 executes the standby update commands in the order recorded in the map (LSN order). Then, the second node 1B deletes the record relating to the executed update command from the map after executing all the update commands waiting for the page read to the RAM 12B (step S518). Thereafter, the process proceeds to step S519.
  • the search request handling process similarly to the update execution process, when a plurality of update commands are waiting on the page selected as the processing target, the standby is performed in the order recorded in the map (LSN order). Update instructions are executed. Thereby, the consistency of the database can be maintained between the first node 1A and the second node 1B for the page.
  • step S519 the search response unit 36 performs a search process corresponding to the received query on the page obtained from the first node 1A and reflecting the update command. Thereafter, the process proceeds to step S520.
  • step S520 a response to the search request (query) is transmitted.
  • the search response unit 36 transmits the result of the search process to the user terminal 9 as a response to the query. Thereafter, the processing shown in this flowchart ends.
  • the second node 1B may launch a plurality of instances for executing the search request handling process, and execute the search request handling process by generating, deleting, starting or stopping such instances. You may increase or decrease the number of instances. For example, the second node 1B may increase or decrease the number of instances to be activated according to the number of queries received from the user terminal 9. In this case, the processing capability of the search request handling process can be made variable according to the request, and it is possible to avoid the useless instances, so that resources can be efficiently used.
  • the search request handling process may be executed in a plurality of instances.
  • the process from step S515 to step S518 may be executed in an instance different from other processes.
  • the processing is performed from step S515 to step S518 for page updating. Takes over to the second instance to execute. Then, when the process of step S518 in the second instance is completed, the process returns to the first instance, and the search process of step S519 is executed.
  • data is transferred to the first node 1A for each database portion (predetermined management unit such as a page) without batch copying the entire database and without creating a checkpoint.
  • the second node 1B can reflect the transaction log in parallel for each part of the database without worrying about the dependency relationship between the update commands based on the transaction log.
  • the execution of the update command based on the transaction log can be delayed, and when the received data is expanded in the memory, the update command based on the transaction log based on the map, It can be executed in parallel for each predetermined management unit.
  • the received data can be used for a query in the second node 1B without waiting for the completion of replication of the entire database.
  • data transmission from the first node 1A to the second node 1B is performed in response to a data transmission request, so that data acquisition is performed sequentially.
  • the timing of acquisition can be adjusted.
  • the data to be searched can be preferentially acquired or prioritized. It is possible to reflect the transaction log. That is, according to the system according to the present embodiment, it is possible to accept a search request from the user terminal in a state where the second node 1B has not received all the data.
  • the system according to the second embodiment adds a configuration to the system according to the first embodiment so that the second node can respond to the query without holding the entire database in the second node. Is.
  • the entire database is held in the second node.
  • the data in the database is held. It is not permanently held in the second node except for those that are determined to be targets.
  • the same reference numerals are given to the same components as those of the system according to the first embodiment described above, and the description thereof is omitted.
  • FIG. 9 is a diagram schematically showing the functional configuration of the first node 1A and the second node 1B ′ according to the present embodiment. Since the functional configuration of the first node 1A according to the present embodiment is substantially the same as that of the first embodiment, description thereof is omitted.
  • the CPU 11B interprets and executes various programs expanded in the RAM 12B, and controls various hardware provided in the node 1B ′, whereby the request transmission unit 31. , Functioning as a computer including a data reception unit 32, an execution unit 33, a map generation unit 34, a search request reception unit 35, a search response unit 36, a development unit 37, a determination unit 38, a recording unit 39, and a deletion unit 40.
  • the functions of the second node 1B ′ are executed by the general-purpose CPU 11B, but some or all of these functions are realized by one or more dedicated processors. May be.
  • the request transmission unit 31, the data reception unit 32, the execution unit 33, the map generation unit 34, the search request reception unit 35, the search response unit 36, and the expansion unit 37 are substantially the same as those in the first embodiment, a description will be given. Omitted.
  • the determination unit 38 determines whether or not the data obtained from the first node 1A in response to the search request and for which the instruction based on the transaction is executed is to be held in the second node 1B ′.
  • the recording unit 39 records the data determined to be retained by the determination unit 38 in the auxiliary storage device 14B that is a nonvolatile storage device.
  • the deletion unit 40 uses the data obtained from the first node 1A in response to the search request and for which the command based on the transaction is executed for the response by the search response unit 36, and then automatically performs the second operation according to a predetermined condition. Delete from the node.
  • the database transmission / reception processing (see FIG. 4), map generation processing (see FIG. 5), and update execution processing (see FIG. 6) described in the first embodiment are also executed in the second embodiment. . Details of these processes are the same as those described in the first embodiment, and thus description thereof is omitted.
  • FIG. 10 is a flowchart showing the flow of transaction log transmission / reception start processing executed by the first node 1A and the second node 1B ′ in the present embodiment.
  • the process shown in this flowchart is a process that is executed in place of the management information transmission / reception process (see FIG. 3) described in the first embodiment, and is triggered when an instruction to start construction of a database is received. Started as.
  • step S801 and step S802 a transaction log request is transmitted / received.
  • the request transmission unit 31 transmits a transaction log transmission request to the first node 1A (step S801).
  • the request receiving unit 22 receives the request transmitted by the second node 1B ′ (step S802). Thereafter, the process proceeds to step S803.
  • step S803 and step S804 transmission / reception of a transaction log is started. Thereafter, the log transmission unit 24 sequentially transmits the transaction log and the LSN newly generated in the first node 1A to the second node 1B ′ in association with each other as soon as they are generated (step S803).
  • the data receiving unit 32 of the second node 1B ′ starts to receive the transaction log and the LSN related to the transaction log transmitted by the first node 1A (step S804). That is, the second node 1B 'receives all the transaction logs after a predetermined time after the log transmission is started. Thereafter, the process proceeds to step S805.
  • step S805 acceptance of a search request (query) is started.
  • the second node 1B ′ starts accepting a query transmitted from the user terminal 9 by starting an on-demand process described later. Thereafter, the search request accepting unit 35 accepts a query from the user terminal 9, and when the query is accepted, a page (including management information) necessary for responding to the query is acquired. Thereafter, the processing shown in this flowchart ends.
  • the management information transmission / reception process is not performed at the start of database construction.
  • the database transmission / reception processing shown in FIG. 4 has been described as “started when it becomes possible to grasp the page configuration of the database managed by the first node 1A” in the first embodiment.
  • the second embodiment is executed at a timing that is called in an on-demand process described later (see steps S605 and S514 described later).
  • FIG. 11 is a flowchart showing the flow of on-demand processing executed by the second node 1B ′ in this embodiment.
  • the processing shown in this flowchart is started when the second node 1B 'receives a query from the user terminal 9 or the like. That is, in the present embodiment, on-demand processing is executed instead of the search request response processing (see FIGS. 7 and 8) described in the first embodiment.
  • the management information transmission / reception process is not performed at the start of the database construction. For this reason, there is a possibility that the second node 1B 'does not have management information when the search request is accepted. If the second node 1B 'does not have management information, the page related to the query cannot be specified in the data transmission request. For this reason, in the on-demand processing according to the present embodiment, when a search request is accepted, it is first confirmed whether or not the second node 1B 'has management information. If the second node 1B 'does not have management information, the database transmission / reception process is executed after obtaining the management information from the first node 1A. Details of the on-demand processing according to the present embodiment will be described below with reference to FIG.
  • step S601 a query is accepted.
  • the search request receiving unit 35 receives a query from the user terminal 9. Thereafter, the process proceeds to step S602.
  • step S602 it is determined whether or not a management information cache exists.
  • the search response unit 36 determines whether or not a management information cache exists in the memory. In this embodiment, since records are managed in units of pages, the search response unit 36 determines whether there is a page cache including management information as a search target.
  • step S6 when a page including management information is read to the RAM 12B, an update command that has been put on standby is executed for the page (the process shown in FIG. 6 and steps S606 to S609 described later). See).
  • an update instruction for a page in which a cache exists is immediately executed (see the map generation process described with reference to FIG. 5).
  • the cache of the page including the management information already exists when the determination result in step S602 is “YES”), the execution of the update command for the page is not awaited. Therefore, when there is a cache of the page including the management information, the search response unit 36 does not read from the storage area, refers to the management information that already has a cache, and the process proceeds to step S610. On the other hand, if there is no management information cache, the process advances to step S603.
  • step S603 it is determined whether or not a page including management information exists in the storage (database) of the second node 1B '.
  • the management information transmission / reception process is not performed at the time of starting construction of the database. Therefore, at the time of receiving the query, the second node 1B ′ There is a case where management information for specifying is not provided. If it is determined that the management information does not exist in the storage, the process proceeds to step S605 in order to acquire the management information from the first node 1A. On the other hand, if it is determined that the page exists in the storage, the process proceeds to step S604.
  • step S605 the database transmission / reception process shown in FIG. 4 is executed. If it is determined in step S603 that the management information does not exist in the storage, the request transmission unit 31 specifies the data related to the management information to the first node 1A in response to the query and sends a data transmission request. Send. As described above, in this embodiment, management information is transmitted and received in units of pages as in the other tables. Therefore, management information can be acquired by the database transmission / reception processing shown in FIG. Thereafter, the process returns to step S602. Then, the processes shown in steps S602 to S605 are repeated until management information is acquired from the first node 1A.
  • step S604 management information is read from the storage.
  • the expansion unit 37 reads the management information from the storage (auxiliary storage device 14B) to the RAM 12B when the management information cache does not exist but exists in the storage of the second node 1B '. Thereafter, the process proceeds to step S606.
  • step S606 it is determined whether there is a waiting update command.
  • the second node 1B ' refers to the map and determines whether there is an update command waiting for the management information page read into the RAM 12B. If the update instruction waiting for the page read into the RAM 12B is not recorded in the map, the process proceeds to step S610. On the other hand, if an update command waiting for the page read into the RAM 12B is recorded in the map, the process proceeds to step S607.
  • step S607 an update command related to the update target page is extracted from the map.
  • the second node 1B ′ extracts all update instructions for the update target page (in this case, the page including the management information) determined to exist in step S603 from the map. In this way, all the update instructions on the map relating to the update target page are executed, and the page on which the update instruction is executed can be directly used as a cache for data search or processing. Thereafter, the process proceeds to step S608.
  • step S608 and step S609 the update command waiting in the map and the extracted update command are executed, and the executed update command is deleted from the map.
  • the execution unit 33 refers to the map and executes an update command related to the management information read to the RAM 12B (step S608). That is, in the present embodiment, the second node 1B ′ expands the management information (step S207) received by the data receiving unit 32 in the memory (step S604) according to the query (step S601), and displays it in the map. Based on this, an update command is executed on the management information.
  • the execution unit 33 executes the standby update commands in the order recorded in the map. Then, the second node 1B ′ executes all the update instructions waiting for the management information read to the RAM 12B, and then deletes the record relating to the executed update instruction from the map (step S609). Thereafter, the process proceeds to step S610.
  • step S610 the management information is referred to identify the page.
  • the search response unit 36 refers to the management information in order to specify the storage area specified as the search range by the received query.
  • a page including data necessary for processing a query is specified by referring to management information.
  • a request (data transmission request) is first received by receiving a search request and becoming a search target. Thereafter, the processing shown in steps S519 and S520 is executed, and when the response to the query is completed, the processing shown in this flowchart ends.
  • FIG. 12 is a flowchart showing the flow of deletion processing executed by the second node 1B ′ in the present embodiment.
  • the processing shown in this flowchart is periodically executed for each data unit (in this embodiment, page unit) that is expanded in the memory and becomes a cache in the second node 1B '.
  • step S701 it is determined whether or not the data satisfies the deletion condition.
  • the deletion unit 40 determines whether or not a predetermined deletion condition is satisfied for the cache related to the determination target page among the caches on the second node 1B '.
  • the deletion condition used here is, for example, that a predetermined time has elapsed since a time point related to data processing (a time point obtained from the first node 1A, a time point last referenced for a query response, an update, or the like). And so on.
  • the deletion condition is not limited to the illustration in the present embodiment.
  • step S702 it is determined whether or not the data is a retention target.
  • the determination unit 38 determines whether or not the determination target page of the data held by the second node 1B ′ is to be held by the second node 1B ′.
  • the condition for determination may be determined based on, for example, the frequency with which the data is referred to in the query.
  • the storage and memory of the second node 1B ′ can be stored without sacrificing the response speed to the query by setting the frequently referenced data to be held and not the less frequently data to be held. Can be saved.
  • a table or page designated in advance by an administrator or the like can be set as a holding target.
  • the determination condition as to whether or not to hold is not limited to the example in the present embodiment.
  • the determination condition can be appropriately adopted according to the embodiment. If the determination target page does not satisfy the condition for being held, the process advances to step S704. On the other hand, if the page to be determined satisfies the conditions for becoming a holding target, the process proceeds to step S703.
  • step S703 data is recorded in the storage.
  • the recording unit 39 records data (determined in units of pages in the present embodiment) determined to be retained by the determination unit 38 in a storage (in the present embodiment, the auxiliary storage device 14B). Thereafter, the process proceeds to step S705.
  • step S704 data that satisfies the deletion condition is deleted from the storage.
  • the deletion unit 40 determines that data determined by the determination unit 38 as not being held (determined in units of pages in this embodiment) is recorded in the storage of the second node 1B ′. Are deleted from the storage (in this embodiment, the auxiliary storage device 14B). In this way, data that has been received and temporarily recorded in the storage before it becomes a cache can also be deleted from the storage. Thereafter, the process proceeds to step S705.
  • step S705 the data cache that satisfies the deletion condition is deleted.
  • the deletion unit 40 deletes the cache of the page that satisfies the deletion condition from the memory of the second node 1B ′. Thereafter, the processing shown in this flowchart ends.
  • step S702 it is determined whether or not the cached data is to be deleted. However, when data that is stored in the storage but is not cached is periodically determined whether or not it is a storage target, the condition for the storage target (see step S702) is no longer satisfied. May be deleted from the storage. In this way, even data that is held only in the storage can be deleted from the storage over time, and the storage capacity can be saved.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

データベースシステムにおいて、第一のノードは、第二のノードからのデータの送信要求に応じて、所定の時点におけるトランザクションログを示す特定識別情報、所定の時点より後のトランザクションログおよび識別情報を第二のノードに送信し、要求されたデータを所定の時点以降に第二のノードに送信し、第二のノードは、検索要求に応じて第一のノードにデータの送信要求を送信し、第一のノードから受信されたデータがメモリに展開された場合に、特定識別情報が示すトランザクションログよりも新しいトランザクションログに係る命令を展開されたデータに対して実行し、命令が実行されたデータに基づいて検索要求へ応答し、命令が実行されたデータを所定の条件に従って削除することとした。

Description

データベースシステム、情報処理装置、方法およびプログラム
 本発明は、データベースを管理するための技術に関する。
 従来、自己の障害に備えて他のサーバノードから送信されるトランザクションログを受信し、受信されたトランザクションログをデータベースに反映するデータベース管理システムが提案されている(特許文献1を参照)。
 また、マスタが、複数のトランザクションログを並列に作成し、並列に作成した複数のトランザクションログを他のマスタ又はスレーブに送信し、他のマスタまたはスレーブが、当該複数のトランザクションログをデータベースに並列に適用する技術が提案されている(特許文献2を参照)。
特表2012-532376号公報 特開2012-133417号公報
 従来、複数のノードを有するデータベースシステムにおいて、ユーザー端末からのクエリを処理するための負荷を複数のノードで分担するための方法が種々提案されている。例えば、(1)ログベースのレプリケーションを全てのノードに対して行うことによって全ノード間でデータを同期し、何れのノードでもクエリへの応答を可能とする方法や、(2)各ノードがデータの一部分のみを複製し、複製した部分に対するリクエストを処理する方法、方法、等が提案されている。
 しかし、(1)全ノード間でデータを同期する方法では、全てのノードが大きなストレージまたはメモリを有する必要があり、また、同期のために用いるネットワークリソースも大きくなる。また、(2)各ノードがデータの一部分のみを複製し、複製した部分に対するリクエストを処理する方法では、クエリの処理に必要なデータが複数のノードに分かれて保持されている場合に、データを統合するためのリソースが必要となるという問題があった。
 本発明は、上記した問題に鑑み、データベースシステムにおいて、ストレージやメモリを節約しながら、複数のノードにおいてユーザー端末からのクエリを受け付けることを課題とする。
 本発明は、上記した課題を解決するために、以下の手段を採用した。即ち、本発明は、複数のノードを有するデータベースシステムであって、前記複数のノードのうち、第一のノードは、該第一のノードによって管理されているデータベースのトランザクションログを、該トランザクションログに係る命令の順序を把握可能な識別情報とともに保持するログ保持手段と、前記複数のノードのうち、前記第一のノードと異なる第二のノードから、該第一のノードによって管理されているデータの送信要求を受信する要求受信手段と、前記送信要求に応じて、前記ログ保持手段によって保持されている前記識別情報のうち、要求されたデータに係る、所定の時点におけるトランザクションログを示す特定識別情報を、前記第二のノードに送信する特定識別情報送信手段と、少なくとも前記所定の時点より後の前記トランザクションログおよび前記識別情報を、互いに関連づけて前記第二のノードに送信するログ送信手段と、前記送信要求に応じて、前記データベースによって管理されているデータのうち要求されたデータを、前記所定の時点以降に、前記第二のノードに送信するデータ送信手段と、を備え、前記第二のノードは、ユーザー端末からの検索要求を受け付ける検索要求受付手段と、前記検索要求に応じて、前記第一のノードに対して、前記データベース中の少なくとも前記検索要求に係るデータの前記送信要求を送信する要求送信手段と、前記第一のノードから、前記トランザクションログ、該トランザクションログの識別情報、前記特定識別情報および前記データを受信する受信手段と、受信された前記データが該第二のノードのメモリに展開されてデータの検索または処理に供される状態となった場合に、受信された前記トランザクションログのうち、少なくとも前記特定識別情報が示すトランザクションログよりも新しい前記トランザクションログに係る命令を、メモリに展開された前記データに対して実行する実行手段と、前記検索要求の結果前記第一のノードから得られ、前記トランザクションに基づく命令が実行されたデータに基づいて、前記検索要求への応答を前記ユーザー端末に対して返す検索応答手段と、前記検索要求の結果前記第一のノードから得られ、前記トランザクションに基づく命令が実行されたデータを、前記検索応答手段による応答に用いた後、所定の条件に従って自動的に該第二のノードから削除する削除手段と、を備える、データベースシステムである。
 本発明に係るデータベースシステムでは、第一のノードは、検索要求を受けた第二のノードからの要求に応じて、所定の時点におけるトランザクションログを示す特定識別情報、所定の時点以降のトランザクションログ、および所定の時点以降のデータを第二のノードに送信する。そして、第二のノードは、受信されたデータをメモリに展開して検索等に供される状態とし(例えば、データを含むページを所謂キャッシュとし)、所定の時点以降のトランザクションログに係る命令を、メモリに展開されたデータ(キャッシュ)に対して実行する。即ち、本発明では、検索要求に応じてデータを取得し、検索等の用に供されるためにメモリに展開された時点でトランザクションログに係る命令を実行(トランザクションログを反映)することで、レプリケーションに用いるストレージやメモリを節約しながら、ユーザー端末からのクエリを受け付けることとしている。
 また、前記削除手段は、前記データに関する処理に関する時点から所定時間経過した場合に、前記データを削除してもよい。
 また、前記第二のノードは、前記検索要求の結果前記第一のノードから得られ、前記トランザクションに基づく命令が実行されたデータを、該第二のノードにおける保持対象とするか否かを判定する判定手段を更に備え、前記削除手段は、前記判定手段によって前記保持対象と判定されなかったデータを、前記所定の条件に従って自動的に削除してもよい。
 また、前記第二のノードは、前記判定手段によって前記保持対象と判定されたデータを、不揮発性の記憶装置に記録する記録手段を更に備えてもよい。
 また、前記データ送信手段は、前記データを、前記トランザクションログに係る命令の順序が互いに依存関係にあるレコードが同一の管理単位に入るように区切られた所定の管理単位毎に送信してもよい。
 また、前記データベースシステムは、受信された前記トランザクションログのうち、少なくとも前記特定識別情報が示すトランザクションログよりも新しい前記トランザクションログに基づいて、命令の対象となるデータが収容された前記所定の管理単位と命令の内容との関係を示すマップを生成するマップ生成手段を更に備え、前記実行手段は、前記マップを参照して、前記トランザクションログに係る命令を、前記所定の管理単位毎に実行してもよい。また、前記データベースシステムは、受信された前記トランザクションログのうち、少なくとも前記特定識別情報が示すトランザクションログよりも新しい前記トランザクションログに基づいて、命令の対象となるデータと命令の内容との関係を示すマップを生成するマップ生成手段を更に備え、前記実行手段は、前記マップを参照して、前記トランザクションログに係る命令を、命令の対象となるデータに対して実行してもよい。
 また、前記データ送信手段は、前記第一のノードのメモリに展開されてデータの検索または処理に供されている状態のデータを、前記第二のノードに送信してもよい。
 また、前記データ送信手段は、前記データベースの管理情報を、前記第二のノードに送信し、前記要求送信手段は、前記管理情報を参照して、前記第一のノードに対して、前記データベース中のデータを指定して送信要求を送信してもよい。
 また、前記第二のノードは、前記第一のノードから受信したデータを直接メモリに展開して、データの検索または処理に供する展開手段を更に備え、前記実行手段は、受信したデータが前記展開手段によってメモリに展開されたことを受けて、前記トランザクションログに係る命令を前記データに対して実行してもよい。
 また、前記特定識別情報送信手段は、前記特定識別情報として、ログ保持手段によって保持されている前記識別情報のうち、最新のトランザクションログを示す識別情報を送信してもよい。
 また、前記データは、テーブル単位またはページ単位で送受信されてもよい。
 また、前記実行手段は、前記トランザクションログに係る命令を、前記識別情報によって把握される命令の順序に応じて、受信された前記データに対して実行してもよい。
 なお、本発明は、コンピューターシステム、情報処理装置、コンピューターによって実行される方法、またはコンピューターに実行させるプログラムとして把握することが可能である。また、本発明は、そのようなプログラムをコンピューターその他の装置、機械等が読み取り可能な記録媒体に記録したものとしても把握できる。ここで、コンピューター等が読み取り可能な記録媒体とは、データやプログラム等の情報を電気的、磁気的、光学的、機械的、または化学的作用によって蓄積し、コンピューター等から読み取ることができる記録媒体をいう。
 本発明によれば、データベースシステムにおいて、ストレージやメモリを節約しながら、複数のノードにおいてユーザー端末からのクエリを受け付けることが可能となる。
実施形態に係るシステムのハードウェア構成の概略を示す図である。 実施形態に係るシステムの機能構成の概略を示す図である。 実施形態において、第一のノードおよび第二のノードによって実行される管理情報送受信処理の流れを示すフローチャートである。 実施形態において、第一のノードおよび第二のノードによって実行されるデータベース送受信処理の流れを示すフローチャートである。 実施形態において、第二のノードによって実行されるマップ生成処理の流れを示すフローチャートである。 実施形態において、第二のノードによって実行される更新実行処理の流れを示すフローチャートである。 実施形態において、第二のノードによって実行される検索要求対応処理の流れを示すフローチャート(1)である。 実施形態において、第二のノードによって実行される検索要求対応処理の流れを示すフローチャート(2)である。 実施形態に係る第一のノードおよび第二のノードの機能構成の概略を示す図である。 実施形態において、第一のノードおよび第二のノードによって実行されるトランザクションログ送受信開始処理の流れを示すフローチャートである。 実施形態において、第二のノードによって実行されるオンデマンド処理の流れを示すフローチャートである。 実施形態において、第二のノードによって実行される削除処理の流れを示すフローチャートである。
 以下、本開示に係るシステム、情報処理装置、方法およびプログラムの実施の形態を、図面に基づいて説明する。但し、以下に説明する実施の形態は、実施形態を例示するものであって、本開示に係るシステム、情報処理装置、方法およびプログラムを以下に説明する具体的構成に限定するものではない。実施にあたっては、実施形態に応じた具体的構成が適宜採用され、また、種々の改良や変形が行われてよい。
 本実施形態では、本開示に係るシステム、情報処理装置、方法およびプログラムを、追記型のデータベースシステムにおいて実施した場合の実施の形態について説明する。追記型のデータベースシステムとは、データの更新の際に、古いデータを新しいデータで上書きすることなく、新しいデータを追記することでデータの更新を行うタイプのデータベースシステムである。但し、本開示に係るシステム、情報処理装置、方法およびプログラムは、複数のノードを有するシステムにおいて、あるノードが管理するデータを他のノードにおいて用いるための技術について広く用いることが可能であり、本開示の適用対象は、本実施形態において示した例に限定されない。
 <第一の実施形態>
 はじめに、第一の実施形態について説明する。
 <<システムの構成>>
 図1は、本実施形態に係るシステムのハードウェア構成の概略を示す図である。本実施形態に係るシステムは、ユーザー端末9からの検索要求(クエリ)に応答するための複数のノード(情報処理装置)1を備える。複数のノード1は、ネットワークを介して互いに通信可能に接続される。複数のノード1のうち、データベースが既に構築されているノード1の何れかを、本実施形態におけるオリジナルのデータベースを有する第一のノード1Aとすることが出来る。また、本実施形態において第一のノード1Aからデータを受信する第二のノード1Bは、データベース用のソフトウェアがインストールされているが、データベースのコンテンツが未構築のノードである。本実施形態では、このようなシステムにおいて、第一のノード1Aが管理するデータベースのコンテンツ(データ)を、第二のノード1Bにおける検索の用に供するための技術を説明する。本実施形態では、ノードを区別することなくノード一般について述べる場合には「ノード1」と記載し、ノードを区別して述べる場合には「第一のノード1A」、「第二のノード1B」のように添字を付して記載する。
 なお、本開示に係るシステムは、階層構造を有するデータベースシステムや、マルチマスターのデータベースシステムに適用可能であるが、この際、データベースシステムにおけるマスターノードおよびスレーブノードの何れであっても、第一のノード1Aまたは第二のノード1Bとすることが出来る。
 第一のノード1Aおよび第二のノード1Bは、CPU(Central Processing Unit)11A、11B、RAM(Random Access Memory)12A、12BおよびROM(Read Only Memory)13A、13B等からなる制御部10A、10Bと、補助記憶装置14A、14Bと、通信インターフェース15A、15Bと、を備えるコンピューターである。但し、ノード1の具体的なハードウェア構成に関しては、実施の形態に応じて適宜省略や置換、追加が可能である。また、ノード1は、単一の装置に限定されない。ノード1は、所謂クラウドや分散コンピューティングの技術等を用いた、複数の装置によって実現されてよい。
 なお、本実施形態では、データベースの各レコードは、ページ単位で管理されており、ストレージ(例えば、補助記憶装置14A、14B)とメモリ等(例えば、RAM12A、12B)との間のデータのやり取りは、ページ単位で行われる。ここで、メモリ等に展開されてデータの検索または処理に供されている状態のデータは、キャッシュと称される。一方、ストレージ上のデータは、データの検索または処理に供されていない状態にある。即ち、データベースの内容を検索や更新等の処理の対象とする場合、各ノードは、対象のレコードを含むページをストレージから読み出してキャッシュとし、対象のレコードに係る処理を行う。また、各ノードは、対象のレコードの更新を行った後に、当該レコードを含むキャッシュのページをストレージに書き込むことで、データベースの更新を保存する。なお、ページがストレージに書き込まれるタイミングは、実施の形態に応じて適宜決定される。ページには、1または複数のレコードが格納される。また、ページは、ブロックと称されてもよく、本発明の「所定の管理単位」に相当する。
 本実施形態では、後述するノード間の送受信処理においても、ページ単位でデータが要求され、ページ単位でデータが送受信される。但し、データの読出/書込および送受信をページ単位で行うのは、本開示を実施する際に採用可能な具体的構成の一例であり、本開示の技術的範囲は、ページ単位での読出/書込および送受信に限定されない。データの読出/書込および送受信は、例えばテーブル単位で行われてもよいし、その他の管理単位で行われてもよい。
 図2は、本実施形態に係る第一のノード1Aおよび第二のノード1Bの機能構成の概略を示す図である。本実施形態に係る第一のノード1Aは、CPU11Aが、RAM12Aに展開された各種プログラムを解釈および実行して、ノード1Aに備えられた各種ハードウェアを制御することで、ログ保持部21、要求受信部22、特定識別情報送信部23、ログ送信部24およびデータ送信部25を備えるコンピューターとして機能する。本実施形態では、第一のノード1Aの機能が汎用のCPU11Aによって実行される例について説明しているが、これらの機能は、その一部または全部が、1または複数の専用のプロセッサによって実現されてもよい。
 ログ保持部21は、第一のノード1Aによって管理されているデータベースにおけるトランザクションのログ(以下、「トランザクションログ」)を、トランザクションに含まれる命令の時系列上の順序を把握可能な識別情報であるLSN(Log Sequence Number)とともに保持する。命令には、データベースの更新に係る更新命令と、トランザクションの管理に係る管理命令とが含まれる。また、トランザクションログは、ノードにおいてトランザクションが発生する毎に生成され、LSNが付されてログ保持部21によって保持される。
 要求受信部22は、第二のノード1Bによって送信された、第一のノード1Aによって管理されているデータの送信要求を受信する。
 特定識別情報送信部23は、ログ保持部21によって保持されているLSNのうち、所定の時点におけるトランザクションログを示す特定識別情報(特定LSN)を、要求受信部22によって受信されたデータ送信要求に応じて第二のノード1Bに送信する。ここで送信される特定LSNは、要求されたページ毎に決定されてよい。なお、本実施形態において、特定識別情報送信部23は、特定LSNとして、最新のトランザクションログを示すLSNを送信する。特定LSNを最新のトランザクションログを示すLSNとすることで、ログ送信部24によって送信すべきトランザクションログの量を低減させ、また、第二のノード1Bにおいて反映すべきトランザクションログの量を低減出来る。但し、送信される特定LSNは、第二のノード1Bにおいて反映すべきトランザクションログを判別するための、所定の時点におけるトランザクションログを示すものであればよく、最新のトランザクションログを示すLSNに限定されない。
 ログ送信部24は、少なくとも、特定LSNが示す所定の時点より後のトランザクションログおよびLSNを、互いに関連づけて第二のノード1Bに送信する。トランザクションログの送信開始後、ログ送信部24は、新たに発生したトランザクションログについても、順次第二のノード1Bに対して送信する。
 データ送信部25は、要求受信部22によって受信されたデータ送信要求に応じて、データベースによって管理されているページのうち、要求に係るページであって、少なくとも特定LSNに係る所定の時点までの内容が反映されたページを、第二のノード1B宛に送信する。本実施形態では、データ送信部25は、データを、トランザクションログに基づく更新命令の順序が互いに依存関係にあるレコードが同一の管理単位に入るように区切られた所定の管理単位(本実施形態では、ページ)毎に送信する。
 なお、本実施形態では、データ送信部25は、第一のノード1Aのメモリに展開されてデータの検索または処理に供されている状態のデータ、即ちキャッシュを、第二のノード1B宛に送信する。送信の際、送信対象のページのキャッシュが無い場合には、第一のノード1Aは、対象ページをストレージから読み出してキャッシュとする。これは、本実施形態に係るデータベースシステムでは、各ノード1において発生したデータの更新は即座にキャッシュに反映され、キャッシュがデータの最新の状態を表しているために、第二のノード1B宛に送信されるデータとしてキャッシュを採用することで、送信されるデータを、最新のトランザクションログを示すLSNである特定LSNに係る所定の時点までの内容が反映されたページとすることが出来るからである。
 但し、送信されるデータは、少なくとも特定LSNに係る所定の時点までの内容が反映されたものであればよく、本実施形態において採用されたキャッシュに限定されない。本開示が適用されるデータベースシステムが、ストレージにあるデータに、少なくとも特定LSNに係る所定の時点までの内容が反映されていることが保証できるものである場合には、ストレージから読み出されたデータがそのまま送信されてもよい。
 また、本実施形態に係る第二のノード1Bは、CPU11Bが、RAM12Bに展開された各種プログラムを解釈および実行して、ノード1Bに備えられた各種ハードウェアを制御することで、要求送信部31、データ受信部32、実行部33、マップ生成部34、検索要求受付部35、検索応答部36および展開部37を備えるコンピューターとして機能する。本実施形態では、第二のノード1Bの機能が汎用のCPU11Bによって実行される例について説明しているが、これらの機能は、その一部または全部が、1または複数の専用のプロセッサによって実現されてもよい。
 要求送信部31は、第一のノード1Aに対して、データベース中のデータを指定してデータの送信要求を送信する。本実施形態では、データの指定は、ページ単位で行われる。
 データ受信部32は、第一のノード1Aから、トランザクションログ、該トランザクションログのLSN、ページ毎の特定LSNおよびデータを受信する。なお、先述の通り、本実施形態では、データの送受信は、ページ単位で行われる。
 実行部33は、データの送信要求に応じて第一のノード1Aから送信され、データ受信部32によって受信されたデータが、該第二のノード1Bのメモリに展開されてデータの検索または処理に供される状態(キャッシュ)となった場合に、受信されたトランザクションログのうち、少なくとも特定LSNに係るトランザクションログよりも新しいトランザクションログに含まれる更新命令を、メモリに展開されたデータに対して実行する。ここで、トランザクションログに含まれる更新命令は、LSNによって把握される順序に従って実行される。
 マップ生成部34は、受信されたトランザクションログのうち、少なくとも特定LSNが示すトランザクションログよりも新しいトランザクションログに基づいて、トランザクションログに含まれる更新命令の対象となるデータが収容されているページと当該更新命令との関係を示すマップを生成する。
 なお、上述の通り本実施形態では、データはページをもって管理されるため、マップ生成部34は、更新命令の対象となるデータが収容されたページと更新命令との関係を示すマップを生成するが、マップ生成手段は、その他の管理単位(例えば、テーブル等)と更新命令との関係を示すマップを生成してもよい。また、マップ生成手段は、このような管理単位を用いること無く、更新命令の対象となるレコードと更新命令との関係を示すマップを生成してもよい。
 検索要求受付部35は、ユーザー端末9からの検索要求(クエリ)を受け付ける。
 検索応答部36は、第一のノード1Aから得られ、トランザクションログに基づく更新命令が反映されたデータに基づいて、検索要求(クエリ)への応答をユーザー端末9に対して返す。
 展開部37は、第一のノード1Aから受信したデータをメモリに展開して、データの検索または処理に供する。本実施形態において、展開部37は、クエリや、後述する更新実行処理における求めに応じて、第一のノード1Aから受信されたデータをメモリに読み出すことでキャッシュとする。
 <<処理の流れ>>
 次に、本実施形態に係る処理の詳細を説明する。なお、本実施形態において説明される処理の具体的な内容および順序等は、実施する上での一例である。具体的な処理内容および順序等は、実施の形態に応じて適宜選択されてよい。
 図3は、本実施形態において、第一のノード1Aおよび第二のノード1Bによって実行される管理情報送受信処理の流れを示すフローチャートである。本フローチャートに示された処理は、第二のノード1Bにおいて、データベースの構築開始の指示が受け付けられたことを契機として開始される。
 ステップS101およびステップS102では、管理情報要求が送受信される。要求送信部31は、第一のノード1Aに対して、データベースの管理情報(システムカタログ等)を指定してデータの送信要求を送信する(ステップS101)。ここで、管理情報は、データベース中のテーブルやレコードの位置を特定可能な情報を含んでいる。本実施形態に係るデータベースはページ単位で管理されているため、管理情報は、データベースのテーブルとページとの関係を特定可能な情報を含む。また、本実施形態では、管理情報の読出/書込および送受信についても、他のテーブルと同様ページ単位で行われる。但し、管理情報がテーブル単位等その他の単位に従って要求されてもよいことは、先述したデータの読出/書込および送受信と同様である。要求受信部22は、第二のノード1Bによって送信された要求を受信する(ステップS102)。その後、処理はステップS103へ進む。
 ステップS103およびステップS104では、データの送信要求に対する応答(Acknowledgement。以下、「ACK」と称する)が送受信される。このACKは、管理情報の特定LSNを含む。先述の通り、LSNとは、トランザクションログに含まれる命令(更新命令)の順序を把握可能な識別情報であり、特定LSNとは、ログ保持部21によって保持されているLSNのうち、所定の時点におけるトランザクションログ(本実施形態では、最新のトランザクションログ)を示すLSNである。即ち、特定識別情報送信部23は、ログ保持部21によって保持されているLSNのうち、要求された管理情報に係る特定LSNを含むACKを、第二のノード1Bに対して送信する(ステップS103)。データ受信部32は、第一のノード1Aから、特定LSNを含むACKを受信する(ステップS104)。その後、処理はステップS105へ進む。
 ステップS105およびステップS106では、トランザクションログの送受信が開始される。ログ送信部24は、所定の時点より後のトランザクションログおよびLSNを、互いに関連づけて第二のノード1Bに送信する(ステップS105)。以降、第一のノード1Aにおいて生成されたトランザクションログは、順次、継続的に第二のノード1Bに対して送信される。ここで、「所定の時点」とは、ステップS103で送信された特定LSNが示すトランザクションログが生成された時点である。データ受信部32は、第一のノード1Aによって送信された、トランザクションログおよび該トランザクションログに係るLSNの受信を開始する(ステップS106)。
 ログの送受信開始後、第一のノード1Aにおいて新たに発生したトランザクションログは、発生次第、第二のノード1Bに対して送信され、第二のノード1Bによって受信される。即ち、第二のノード1Bは、ログの送信開始後、所定の時点以降のトランザクションログを全て受信することとなる。その後、処理はステップS107へ進む。
 なお、先述の通り、処理順序は本フローチャートに示した例に限定されない。管理情報送受信処理では、対象のページに関係するトランザクションログのうち、特定LSNが示す時点以降のトランザクションログが全て第二のノード1Bによって受信されればよい。このため、例えば、ステップS103およびステップS104の送受信処理と、ステップS105およびステップS106の送受信処理との処理順序は、入れ替わってもよい。
 ステップS107では、管理情報について、マップ生成処理が開始される。マップ生成部34は、管理情報に関するページを、マップ生成処理の対象とする。即ち、本ステップ以降、管理情報に対して実行される更新命令と、当該更新命令の実行対象(対象ページ、対象テーブルまたは対象レコード等)との組合せがマッピングされたマップの生成が開始される。マップ生成処理は、本フローチャートに示された処理と並行して実行される。マップ生成処理の詳細は、図5を用いて説明する。その後、処理はステップS108へ進む。
 ステップS108およびステップS109では、データベースの管理情報が送受信される。データ送信部25は、ステップS102で受信された要求を受けて、データベースの管理情報(システムカタログ等)を、第二のノード1Bに対して送信する(ステップS108)。この際、データ送信部25は、送信対象のデータのキャッシュを、第二のノード1B宛に送信する。送信の際、送信対象のデータのキャッシュが無い場合には、第一のノード1Aは、対象データをストレージから読み出してキャッシュとし、少なくとも特定LSNに係る所定の時点までの内容が反映されたデータとしてから、第二のノード1B宛に送信する。第二のノード1Bのデータ受信部32は、第一のノード1Aから、管理情報を受信する(ステップS109)。その後、処理はステップS110へ進む。
 なお、本フローチャートでは、管理情報の送信(ステップS108)が、マップの生成開始(ステップS107)よりも後に記載されているが、管理情報は、特定LSNに係る所定の時点以降のものが送信されればよく、送信のタイミングは本フローチャートに示された例に限定されない。
 ステップS110では、更新実行処理が開始される。実行部33は、管理情報に関するページを、更新実行処理の対象とする。即ち、本ステップ以降、マップ生成処理においてマップに記録された、管理情報に未反映の更新命令が実行される。更新実行処理は、本フローチャートに示された処理と並行して実行される。更新実行処理の詳細は、図6を用いて説明する。その後、処理はステップS111へ進む。
 ステップS111では、検索要求(クエリ)の受付が開始される。第二のノード1Bは、検索要求対応処理を開始させることで、ユーザー端末9から送信されるクエリの受付を開始する。以降、検索要求受付部35は、ユーザー端末9からのクエリを受け付け、クエリが受け付けられると、クエリに応じるために必要なページが、管理情報を参照することで取得される。検索要求対応処理は、本フローチャートに示された処理と並行して実行される。検索要求対応処理の詳細は、図7および図8を用いて説明する。その後、本フローチャートに示された処理は終了する。
 なお、本実施形態では、管理情報の複製についても、データベースの他のテーブル同様、マップ生成処理、更新実行処理および検索要求対応処理を用いて複製する例について説明したが、管理情報の複製には、その他の方法が採用されてもよい。管理情報の複製には、例えば、チェックポイントを作成してチェックポイントのスナップショットを複製する従来の方法等を採用することが出来る。
 図4は、本実施形態において、第一のノード1Aおよび第二のノード1Bによって実行されるデータベース送受信処理の流れを示すフローチャートである。本フローチャートに示された処理は、第二のノード1Bが、第一のノード1Aからデータベースの管理情報を受信することで、第一のノード1Aによって管理されているデータベースのページ構成を把握可能となったことを契機として開始される。
 ステップS201およびステップS202では、データの送信要求が送受信される。要求送信部31は、管理情報のキャッシュを参照して、第一のノード1Aに対して、データベース中のページを指定してデータの送信要求を送信する(ステップS201)。ページの指定には、例えば、ページ番号が用いられてよい。データの送信要求は、管理情報から目的のデータを含むページが分かる場合には、ページを指定したものであってもよいし、データベース中の具体的なレコードを指定したものであってもよい。本実施形態において、データはページ単位で要求されるが、テーブル単位等その他の単位に従って要求されてもよいことは先述した通りである。要求受信部22は、第二のノード1Bから、第一のノード1Aによって管理されているデータの送信要求を受信する(ステップS202)。その後、処理はステップS203へ進む。
 ステップS203およびステップS204では、データの送信要求に対するACKが送受信される。このACKは、ページ番号および当該ページの特定LSNを含む。即ち、特定識別情報送信部23は、ログ保持部21によって保持されているLSNのうち、要求されたページに係る特定LSNを含むACKを、第二のノード1Bに対して送信する(ステップS203)。データ受信部32は、第一のノード1Aから、特定LSNを含むACKを受信する(ステップS204)。その後、処理はステップS205へ進む。
 ステップS205では、要求に係るページ等について、マップ生成処理が開始される。マップ生成部34は、ステップS201において要求したページを、マップ生成処理の対象とする。即ち、本ステップ以降、要求されたページに対して実行される更新命令と、当該更新命令の実行対象(対象ページ、対象テーブルまたは対象レコード等)との組合せがマッピングされたマップの生成が開始される。ここで開始されるマップ生成処理の内容は、ステップS107において管理情報に対して開始されたものと概略同様であり(図5を参照)、本フローチャートに示された処理と並行して処理される。その後、処理はステップS206へ進む。
 なお、本実施形態では、管理情報やページ毎にマップの生成開始タイミングが異なる例について説明しているが(ステップS107やステップS205を参照)、マップの生成開始タイミングは、データベース全体において同時であってもよい。
 ステップS206およびステップS207では、要求に係るページが送受信される。データ送信部25は、ステップS201で受信された要求に応じて、データベースによって管理されているページのうち要求されたものを、第二のノード1Bに送信する(ステップS206)。この際、データ送信部25は、送信対象のデータのキャッシュを、第二のノード1B宛に送信する。送信の際、送信対象のページのキャッシュが無い場合には、第一のノード1Aは、対象ページをストレージから読み出してキャッシュとし、少なくとも特定LSNに係る所定の時点までの内容が反映されたページとしてから、第二のノード1B宛に送信する。第二のノード1Bのデータ受信部32は、第一のノード1Aから、データを受信する(ステップS207)。データの送受信単位は、要求に応じたものであればよく、ページ単位、テーブル単位およびレコード単位の何れでもよい。その後、処理はステップS208へ進む。
 なお、本フローチャートでは、データの送信(ステップS206)が、マップの生成開始(ステップS205)よりも後に記載されているが、データは、特定LSNに係る所定の時点以降のものが送信されればよく、送信のタイミングは本フローチャートに示された例に限定されない。
 ステップS208では、更新実行処理が開始される。実行部33は、ステップS207で受信されたデータを、更新実行処理の対象とする。即ち、本ステップ以降、マップ生成処理でマップに記録された、未実行の更新命令が実行される。その後、本フローチャートに示された処理は終了する。
 なお、本実施形態において、第二のノード1Bは、第一のノード1Aのデータベースにある全てのデータを取得するため、図4に示されたデータベース送受信処理は、管理情報に示された全てのページについて取得が完了するまで、要求するページを順次変更しながら繰り返し実行される。即ち、要求送信部31は、ステップS201からステップS208の処理を繰り返すことで、管理情報を参照して把握される全てのページまたはテーブルについて、データの送信要求を送信する。但し、第二のノード1Bが、第一のノード1Aのデータベースにある全てのデータを取得する必要がない場合には、要求送信部31は、必要な一部のページやテーブルについてのみ、データの送信要求を行ってもよい。また、本実施形態では、複数のページを取得する場合に、ステップS201からステップS208の処理を繰り返す例について説明したが、複数のページを取得する場合に、ステップS201において複数ページ分まとめて要求することとしてもよい。
 本フローチャートに示された処理において第一のノード1Aから受信されたページには、未反映のトランザクションログが存在する可能性がある。このため、マップ生成処理、更新実行処理および検索要求対応処理(詳細については後述する)が本フローチャートに示された処理と並行して行われることで、未反映のトランザクションログが反映される。これらの処理が開始されるタイミングは、上記説明した通りである。なお、要求に係るページやテーブルに関するトランザクションログは、ステップS105以降順次受信されているトランザクションログに含まれている。
 なお、本実施形態では、第一のノード1Aから受信されたデータは、一旦ストレージに保存される。但し、このような処理に代えて、展開部37は、第一のノード1Aから受信したデータを、ストレージ(本実施形態では、補助記憶装置14B)を介さずに直接メモリに展開して、データの検索または処理に供してもよい。受信データが直接メモリに展開された場合、当該受信データに係る更新命令は、後述するマップ生成処理に従って、即座に反映される。
 次に、第二のノード1Bにおいて実行されるデータベースの管理処理の流れを説明する。本実施形態において、第二のノード1Bのデータベースは、マップ生成処理、更新実行処理および検索要求対応処理によって管理される。第二のノード1Bは、これらの処理を実行するためのインスタンスを適宜複数立ち上げて並列実行することによって、マップの生成、マッピングされた更新命令の反映、および検索要求(クエリ)の処理の夫々について、並列処理することを可能としている。
 図5は、本実施形態において、第二のノード1Bによって実行されるマップ生成処理の流れを示すフローチャートである。本フローチャートに示された処理は、マップ生成処理の対象となったデータ(ステップS107およびステップS205を参照)に対して、繰り返し実行される。
 ステップS301では、トランザクションログに含まれる命令が、LSNを参照して時系列順に参照される。第二のノード1Bは、未反映のトランザクションログに含まれる命令を、時系列において最も古い時点のもの(LSNが最も小さいもの)から順に参照する。ここで参照されるトランザクションログは、ステップS105およびステップS106の処理において送受信が開始され、第二のノード1Bによって受信されたものである。その後、処理はステップS302へ進む。
 ステップS302およびステップS303では、命令が更新命令であるか否かが判定され、更新命令以外の命令が実行される。第二のノード1Bは、ステップS301で参照された命令が、更新命令であるか否かを判定する(ステップS302)。参照された命令が更新命令以外の命令(例えば、コミット等の管理命令)であった場合、命令はそのまま実行される(ステップS303)。一方、参照された命令が更新命令であった場合、処理はステップS304へ進む。
 ステップS304では、参照された命令が示すページが、マップ生成処理の対象であるか否かが判定される。第二のノード1Bは、対象となっているデータが、ステップS107やステップS205等において、マップ生成処理の対象に設定されているか否かを判定する。ここで、対象データが、マップ生成処理の対象に設定されていないと判定された場合、本フローチャートに示された処理は終了する。一方、対象データが、マップ生成処理の対象に設定されていると判定された場合、処理はステップS305へ進む。
 ステップS305では、対象データ(ページ)のキャッシュが存在するか否かが判定される。第二のノード1Bは、参照した命令が更新命令である場合、当該命令を参照した時点でその対象がデータベース内に存在するような更新命令(例えば、DELETE命令)については、当該更新命令の対象のキャッシュが存在するか否かを判定する。一方、当該命令を参照した時点でその対象がデータベース内に存在しないような更新命令(例えば、INSERT命令)については、当該更新命令の対象が挿入される領域のデータのキャッシュが存在するか否かを判定することで、当該更新命令の対象のキャッシュが存在するか否かを判定する。なお、レコードがページ単位で管理されている場合、第二のノード1Bは、更新命令の対象を含むページのキャッシュが存在するか否かを判定する。対象のページのキャッシュが存在する場合、処理はステップS306へ進む。一方、対象のページのキャッシュが存在しない場合、処理はステップS307へ進む。
 ステップS306では、トランザクションログに係る更新命令が実行される。実行部33は、受信されたデータのうち、展開部37によってメモリに展開されてキャッシュとなったデータに対して、トランザクションログに係る更新命令を実行する。その後、処理はステップS308へ進む。
 ステップS307では、マップが生成される。トランザクションログに含まれる更新命令の対象となっているページのキャッシュが存在しない場合(ステップS305で「NO」に進んだ場合)、マップ生成部34は、トランザクションログに含まれる更新命令の対象となるデータが収容されたページと更新命令との関係を示す情報を、マップに記録することで、更新命令の実行を待機させる。換言すれば、マップ生成部34は、更新命令の実行を待機させる際に、当該更新命令をマッピング(マップ生成)の対象とし、待機させた更新命令の内容を当該レコードに関連付けて記録するマップを生成する。但し、全ての更新命令をマップ生成の対象としてもよい。本実施形態では、マップには、待機させた更新命令の内容およびLSNのうちの少なくとも一方が、更新命令の対象であるレコードを含むページ(具体的にはページ番号)に関連付けられて記録される。その後、処理はステップS308へ進む。
 ステップS308では、マップ生成処理を終了するか否かが判定される。マップ生成処理が終了されない場合、処理はステップS301へ戻り、トランザクションログにおける時系列順(LSNの順)で次の命令が参照され、ステップS304からステップS307に示された処理の対象となる。通常、第一のノード1Aにおいて新たに発生したトランザクションログを第二のノード1Bに反映するために、マップ生成処理は、第二のノード1Bが運用されている間、繰り返し実行される。即ち、本実施形態において、第二のノード1Bは、受信されたトランザクションログを、古いものから順に検査し、トランザクションログに含まれる更新命令の対象となっているページがオンメモリ(キャッシュ)である場合に、キャッシュに対してトランザクションログに応じた更新命令を実行する。一方、第二のノード1Bが停止される等の理由でマップ生成処理が終了される場合、本フローチャートに示された処理は終了する。
 マップ生成処理で生成されたマップは、対象ページがキャッシュとなった場合に、更新実行処理または検索要求対応処理において参照され、更新実行処理または検索要求対応処理において、当該マップに待機させられた更新命令が実行される。即ち、本実施形態に係るシステムによれば、第一のノードから受信されたデータに対するトランザクションログの反映を、対象データが実際に用いられる時点(換言すれば、キャッシュとなる時点)まで遅延させることが出来る。
 ここで、更新命令の内容を記録したトランザクションログは、ノード1BのRAM12Bまたは補助記憶装置14Bに保持されている。更新実行処理または検索要求対応処理では、当該マップに記録されるLSNに基づいてRAM12または記憶装置14に保持されているトランザクションログへのアクセスが行われ、実行する更新命令の内容が特定される。
 なお、マップ生成処理では、参照した順番に応じて、更新命令の内容またはLSNがマップに記録される。これにより、後述する更新実行処理または検索要求対応処理では、待機させられた更新命令の実行順序を認識することができる。但し、仮に、更新命令の内容またはLSNが参照された順番に応じてマップに記録されなかったとしても、更新実行処理または検索要求対応処理では、待機させられた更新命令のLSNにより、当該更新命令の実行順序を認識することができる。
 図6は、本実施形態において、第二のノード1Bによって実行される更新実行処理の流れを示すフローチャートである。本フローチャートに示された処理は、マップに待機している更新命令が存在する間、繰り返し実行される。
 ステップS401では、待機している更新命令の有無が判定される。第二のノード1Bは、マップを参照し、待機している更新命令があるか否かを判定する。待機している更新命令がマップに記録されていない場合、本フローチャートに示された処理は終了する。一方、待機している更新命令がマップに記録されている場合、第二のノード1Bは、更新命令の対象となるデータが含まれる管理単位を、処理の対象として選択して、処理をステップS402へ進める。
 ステップS402では、更新対象が存在するか否かが判定される。第二のノード1Bは、ステップS401において選択された処理の対象が、第二のノード1Bに存在するか否か、換言すれば、処理の対象となるページが、既に第一のノード1Aから受信されているか否か、を判定する。更新対象のページが存在しない場合、処理はステップS401へ戻る。即ち、第二のノード1Bは、マップを参照して、第二のノード1Bに存在するページについて待機している更新命令を待ち受ける。更新対象のページが存在する場合、処理はステップS404へ進む。
 ステップS403では、更新対象ページに関する更新命令がマップから抽出される。第二のノード1Bは、ステップS402において存在すると判定された更新対象のページに対する更新命令を、マップから全て抽出する。このようにすることで、更新対象ページに関するマップ上の更新命令を全て実行し、更新命令が実行されたページをそのままキャッシュとして、データの検索または処理に供することが出来る。その後、処理はステップS404へ進む。
 ステップS404では、展開部37は、自身が処理する対象を、補助記憶装置14BからRAM12Bに読み出すことで、キャッシュとする。その後、処理はステップS405へ進む。
 ステップS405およびステップS406では、マップに待機している更新命令および抽出された更新命令が実行され、実行済みの更新命令がマップから削除される。実行部33は、マップを参照して、自身が選択した処理対象に関連付けられている更新命令を実行する(ステップS405)。即ち、実行部33は、ステップS401で発見された更新命令、およびステップS403で抽出された更新命令を、所定の管理単位であるページ毎に、マップに記録されている順に実行する。例えば、更新命令が削除命令である場合、実行部33は、対象のレコードに削除ポインタを付与する。そして、第二のノード1Bは、自身が選択した処理対象について待機している更新命令を実行した後に、実行した更新命令に関する記録をマップから削除する(ステップS406)。その後、処理はステップS407へ進む。
 ステップS407では、更新実行処理を終了するか否かが判定される。更新実行処理が終了されない場合、処理はステップS401へ戻る。即ち、更新実行処理では、処理対象として選択したページに複数の更新命令が待機している場合、マップに記録されている順(LSN順)に、当該待機している更新命令が実行される。これにより、そのページに関して、ノード1とレプリケーション元のコンピューターとの間で、レプリケーションが実行されている最中におけるデータベースの整合性を保つことができる。一方、第二のノード1Bが停止される等の理由で更新実行処理が終了される場合、本フローチャートに示された処理は終了する。
 なお、第二のノード1Bは、更新実行処理を実行するためのインスタンスを複数立ち上げてもよく、このようなインスタンスを生成若しくは削除または起動若しくは停止することで、更新実行処理を実行するインスタンスの数を増減させてもよい。例えば、第二のノード1Bは、マップで記録されている待機させられている更新命令の管理単位の数(本実施形態では、ページ数)に応じて、起動するインスタンスの数を増減させてもよい。この場合は、更新実行処理の処理能力を要求に応じて可変にでき、無駄なインスタンスが存在することを避けることができるため、リソースを効率よく活用することが可能になる。
 また、例えば、更新実行処理を実行するためのインスタンスを、予め一定数起動させておいてもよい。この場合、処理の要求が生じた場合に改めてインスタンスを起動しなくてもよいため、生じた要求に迅速に対応することが可能になる。
 図7および図8は、本実施形態において、第二のノード1Bによって実行される検索要求対応処理の流れを示すフローチャートである。本フローチャートに示された処理は、第二のノード1Bが、ユーザー端末9等からクエリを受信したことを契機として開始される。
 ステップS501では、クエリが受け付けられる。検索要求受付部35は、ユーザー端末9からのクエリを受け付ける。その後、処理はステップS502へ進む。
 ステップS502では、管理情報のキャッシュが存在するか否かが判定される。検索応答部36は、メモリ上に、管理情報のキャッシュが存在するか否かを判定する。なお、本実施形態では、レコードはページ単位で管理されているため、検索応答部36は、検索対象での管理情報を含むページのキャッシュが存在するか否かを判定する。
 本実施形態では、管理情報を含むページがRAM12Bに読み出された段階で、当該ページに対して、待機させられた更新命令が実行される(図6および後述するステップS504からステップS507に示す処理を参照)。また、キャッシュが存在するページに対する更新命令は即座に実行される(図5を用いて説明したマップ生成処理を参照)。このため、本実施形態において、管理情報を含むページのキャッシュが既に存在する場合(ステップS502における判定結果が「YES」の場合)、当該ページに対する更新命令の実行が待機されていることはない。従って、管理情報を含むページのキャッシュが存在する場合、検索応答部36は、記憶領域からの読み出しを行わず、既にキャッシュが存在する管理情報を参照の対象とし、処理はステップS508へ進む。一方、管理情報のキャッシュが存在しない場合、処理はステップS503へ進む。
 ステップS503では、管理情報がストレージから読み出される。本実施形態では、データベースの構築開始の時点で管理情報送受信処理が行われるため(図3を参照)、クエリを受けた時点で管理情報がキャッシュに存在しない場合にも、第二のノード1Bは、ストレージに管理情報を有している。展開部37は、管理情報のキャッシュが存在しない場合、管理情報をストレージ(補助記憶装置14B)からRAM12Bに読み出す。その後、処理はステップS504へ進む。
 ステップS504では、待機している更新命令の有無が判定される。第二のノード1Bは、マップを参照し、RAM12Bに読み出された管理情報のページについて待機している更新命令があるか否かを判定する。RAM12Bに読み出されたページについて待機している更新命令がマップに記録されていない場合、処理はステップS508へ進む。一方、RAM12Bに読み出したページについて待機している更新命令がマップに記録されている場合、処理はステップS505に進む。
 ステップS505では、更新対象ページに関する更新命令がマップから抽出される。第二のノード1Bは、ステップS503において存在すると判定された更新対象のページ(ここでは、管理情報を含むページ)に対する更新命令を、マップから全て抽出する。このようにすることで、更新対象ページに関するマップ上の更新命令を全て実行し、更新命令が実行されたページをそのままキャッシュとして、データの検索または処理に供することが出来る。その後、処理はステップS506へ進む。
 ステップS506およびステップS507では、マップに待機している更新命令および抽出された更新命令が実行され、実行済みの更新命令がマップから削除される。実行部33は、マップを参照して、RAM12Bに読み出した管理情報に関連づけられている更新命令を実行する(ステップS506)。即ち、本実施形態において、第二のノード1Bは、クエリに応じて(ステップS501)、データ受信部32によって受信された管理情報(ステップS207)をメモリに展開し(ステップS503)、マップに基づいて更新命令を管理情報に対して実行する。
 ここで、実行部33は、マップに記録されている順に、待機している更新命令を実行する。そして、第二のノード1Bは、RAM12Bに読み出した管理情報について待機している更新命令を全て実行した後に、実行した更新命令に関する記録をマップから削除する(ステップS507)。その後、処理はステップS508へ進む。
 ステップS508では、管理情報が参照されてページが特定される。検索応答部36は、受信されたクエリにより検索範囲に指定された記憶領域を特定するために、管理情報を参照する。本実施形態では、管理情報を参照することで、クエリを処理するために必要なデータを含むページが特定される。その後、処理はステップS511へ進む。
 ステップS511では、検索対象のデータ(ページ)のキャッシュが存在するか否かが判定される。検索応答部36は、受信したクエリの内容に適合するレコードを抽出するために、当該クエリにより検索範囲に指定された記憶領域にアクセスする。そして、検索応答部36は、メモリ上に、クエリに係るレコードのキャッシュが存在するか否かを判定する。なお、本実施形態では、レコードはページ単位で管理されているため、検索応答部36は、検索対象でのレコードを含むページのキャッシュが存在するか否かを判定する。
 本実施形態では、ページがRAM12Bに読み出された段階で、当該ページに対して、待機させられた更新命令が実行される(図6および後述する図8のステップS515からステップS518に示す処理を参照)。また、キャッシュが存在するページに対する更新命令は即座に実行される(図5を用いて説明したマップ生成処理を参照)。このため、本実施形態において、検索範囲に含まれるページのキャッシュが既に存在する場合(ステップS511における判定結果が「YES」の場合)、当該ページに対する更新命令の実行が待機されていることはない。従って、対象のページのキャッシュが存在する場合、検索応答部36は、記憶領域からの読み出しを行わず、既にキャッシュが存在するページを検索処理の対象とし、処理はステップS519へ進む。一方、対象のページのキャッシュが存在しない場合、処理はステップS512へ進む。
 ステップS512では、検索対象のページが第二のノード1Bのストレージ(データベース)に存在するか否かが判定される。上述の通り、本実施形態では、ページの送信要求は逐次的に行われるため(ステップS201を参照)、クエリを受けた時点で、第二のノード1Bがクエリに係るページを有していない場合がある。ページがストレージに存在しないと判定された場合、該当するページを第一のノード1Aから取得するために、処理はステップS514へ進む。一方、ページがストレージに存在すると判定された場合、処理はステップS513へ進む。
 ステップS514では、図4に示されたデータベース送受信処理が実行される。ステップS512においてページがストレージに存在しないと判定された場合、要求送信部31は、第一のノード1Aに対して、データベース中の少なくともクエリに係るデータを指定してデータの送信要求を送信する。本実施形態では、図4に示されたデータベース送受信処理が繰り返されることで管理情報に示されたページが順番に取得されるが、ステップS501で検索要求を受けて検索対象となったページについては、この順番を無視して、優先的にデータ送信要求される。即ち、本実施形態によれば、検索要求を受けて検索対象となったページを、優先的にリクエスト(データ送信要求)の対象とすることが出来る。その後、処理はステップS511へ戻る。
 そして、第一のノード1Aから対象ページが取得されるまで、ステップS511からステップS514に示された処理が繰り返され、ステップS501で受け付けられたクエリへの対応は、対象ページが第一のノード1Aから取得されるまで待機される。
 ステップS513では、検索対象のページがストレージから読み出される。展開部37は、検索対象のデータ(ページ)のキャッシュが存在しないが、第二のノード1Bのストレージに存在する場合、そのページをストレージ(補助記憶装置14B)からRAM12Bに読み出し、検索処理の対象とする。その後、処理はステップS515へ進む。
 なお、展開部37は、検索範囲に含まれるページを補助記憶装置14BからRAM12Bに読み出す場合に、例えば、1つ1つ対象のページを読み出してもよいし、複数のページを一度に読み出してもよい。この場合に、実行部33は、1または複数のページを読み出す毎に、読み出した1または複数のページに対して、後述するステップS515以降の処理を実行する。
 ステップS515では、待機している更新命令の有無が判定される。第二のノード1Bは、マップを参照し、RAM12Bに読み出されたページについて待機している更新命令があるか否かを判定する。RAM12Bに読み出されたページについて待機している更新命令がマップに記録されていない場合、処理はステップS519へ進む。一方、RAM12Bに読み出したページについて待機している更新命令がマップに記録されている場合、処理はステップS516に進む。
 ステップS516では、更新対象ページに関する更新命令がマップから抽出される。第二のノード1Bは、ステップS515において存在すると判定された更新対象のページに対する更新命令を、マップから全て抽出する。このようにすることで、更新対象ページに関するマップ上の更新命令を全て実行し、更新命令が実行されたページをそのままキャッシュとして、データの検索または処理に供することが出来る。その後、処理はステップS517へ進む。
 ステップS517およびステップS518では、マップに待機している更新命令および抽出された更新命令が実行され、実行済みの更新命令がマップから削除される。実行部33は、マップを参照して、RAM12Bに読み出したページに係る更新命令を実行する(ステップS517)。即ち、本実施形態において、第二のノード1Bは、クエリに応じて(ステップS501)、データ受信部32によって受信されたデータ(ステップS207)をメモリに展開し(ステップS513)、マップに基づいて更新命令を該データに対して実行する。
 ここで、実行部33は、マップに記録されている順(LSN順)に、待機している更新命令を実行する。そして、第二のノード1Bは、RAM12Bに読み出したページについて待機している更新命令を全て実行した後に、実行した更新命令に関する記録をマップから削除する(ステップS518)。その後、処理はステップS519へ進む。
 このように、検索要求対応処理では、更新実行処理と同様、処理対象として選択したページに複数の更新命令が待機している場合、マップに記録されている順(LSN順)に、当該待機している更新命令が実行される。これにより、そのページに関して、第一のノード1Aと第二のノード1Bとの間で、データベースの整合性を保つことができる。
 ステップS519では、検索応答部36は、第一のノード1Aから得られ、更新命令が反映されたページに対して、受信したクエリに応じた検索処理を実行する。その後、処理はステップS520へ進む。
 ステップS520では、検索要求(クエリ)に対する応答が送信される。検索応答部36は、クエリに対する応答として、検索処理の結果をユーザー端末9に送信する。その後、本フローチャートに示された処理は終了する。
 なお、第二のノード1Bは、検索要求対応処理を実行するためのインスタンスを複数立ち上げてもよく、このようなインスタンスを生成若しくは削除または起動若しくは停止することで、検索要求対応処理を実行するインスタンスの数を増減させてもよい。例えば、第二のノード1Bは、ユーザー端末9から受け付けたクエリの数に応じて起動するインスタンスの数を増減させてもよい。この場合、検索要求対応処理の処理能力を要求に応じて可変にでき、無駄なインスタンスが存在することを避けることができるため、リソースを効率よく活用することが可能になる。
 また、検索要求対応処理は、複数のインスタンスに分けて実行されてもよい。例えば、検索要求対応処理のうち、ステップS515からステップS518の処理を、他の処理とは異なるインスタンスで実行することとしてもよい。この場合、例えば、ステップS515からステップS518以外の処理を実行するための第一のインスタンスにおいてページ読み出し(ステップS513)が行われた後に、ページ更新のため、処理がステップS515からステップS518の処理を実行するための第二のインスタンスに引き継がれる。そして、第二のインスタンスにおけるステップS518の処理が完了すると、処理は第一のインスタンスに戻り、ステップS519の検索処理が実行される。
 <<第一の実施形態に係るシステムの効果>>
 本実施形態に係るシステムによれば、データベース全体を一括コピーすること無く、また、チェックポイントを作成すること無く、データベースの部分(ページ等の所定の管理単位)毎にデータを第一のノード1Aから第二のノード1Bに送信出来る。また、第二のノード1Bは、トランザクションログに基づく更新命令同士の依存関係を気にすること無く、データベースの部分毎に並列にトランザクションログを反映することが出来る。また、マップを生成することで、トランザクションログに基づく更新命令の実行を遅延させることが出来、受信されたデータがメモリに展開された場合に、マップに基づいて、トランザクションログに基づく更新命令を、所定の管理単位毎に並列に実行することが出来る。
 結果として、本実施形態に係るシステムによれば、データベース全体の複製完了を待つこと無く、受信したデータを第二のノード1Bにおけるクエリに供することが出来る。
 また、本実施形態に係るシステムでは、第一のノード1Aから第二のノード1Bへのデータ送信を、データの送信要求に応じたものとすることで、データ取得を逐次的にする等、データ取得のタイミングを調整することが出来る。更に、第二のノード1Bにおいて受け付けられた検索要求に応じてデータの送信要求を行ったり、トランザクションログの反映を行ったりすることで、検索対象となったデータを優先的に取得したり、優先的にトランザクションログを反映したりすることが可能となる。即ち、本実施形態に係るシステムによれば、第二のノード1Bが全てのデータを受信していない状態で、ユーザー端末からの検索要求を受け付けることが可能となる。
 <第二の実施形態>
 次に、第二の実施形態について説明する。第二の実施形態に係るシステムは、第二のノードにデータベース全体を保持することなく、第二のノードがクエリに応答可能とするために、第一の実施形態に係るシステムに構成を追加したものである。第一の実施形態では、全てのページについてのデータベース送受信処理が完了した場合、第二のノードにデータベース全体が保持されることとなるが、第二の実施形態では、データベース中のデータは、保持対象と判定されたものを除いて、第二のノードに恒久的には保持されない。第二の実施形態に係るシステムのうち、上述した第一の実施形態のシステムと共通する構成には、同一の符号を付し、説明を省略する。
 <<システムの構成>>
 第二の実施形態に係るシステムのハードウェア構成は、第一の実施形態に係るシステムのハードウェア構成と概略同様であるため、説明を省略する(図1を参照)。但し、第二の実施形態では、第二のノードの機能構成が第一の実施形態とは異なるため、第二のノードに符号「1B’」を付して説明する。
 図9は、本実施形態に係る第一のノード1Aおよび第二のノード1B’の機能構成の概略を示す図である。本実施形態に係る第一のノード1Aの機能構成は、第一の実施形態と概略同様であるため説明を省略する。本実施形態に係る第二のノード1B’は、CPU11Bが、RAM12Bに展開された各種プログラムを解釈および実行して、ノード1B’に備えられた各種ハードウェアを制御することで、要求送信部31、データ受信部32、実行部33、マップ生成部34、検索要求受付部35、検索応答部36、展開部37、判定部38、記録部39および削除部40を備えるコンピューターとして機能する。本実施形態では、第二のノード1B’の機能が汎用のCPU11Bによって実行される例について説明しているが、これらの機能は、その一部または全部が、1または複数の専用のプロセッサによって実現されてもよい。
 要求送信部31、データ受信部32、実行部33、マップ生成部34、検索要求受付部35、検索応答部36および展開部37については、第一の実施形態と概略同様であるため、説明を省略する。
 判定部38は、検索要求に応じて第一のノード1Aから得られ、トランザクションに基づく命令が実行されたデータを、第二のノード1B’における保持対象とするか否かを判定する。
 記録部39は、判定部38によって保持対象と判定されたデータを、不揮発性の記憶装置である補助記憶装置14Bに記録する。
 削除部40は、検索要求に応じて第一のノード1Aから得られ、トランザクションに基づく命令が実行されたデータを、検索応答部36による応答に用いた後、所定の条件に従って自動的に第二のノードから削除する。
 <<処理の流れ>>
 次に、本実施形態に係る処理の詳細を説明する。なお、本実施形態において説明される処理の具体的な内容および順序等は、実施する上での一例である。具体的な処理内容および順序等は、実施の形態に応じて適宜選択されてよい。
 なお、第一の実施形態において説明したデータベース送受信処理(図4を参照)、マップ生成処理(図5を参照)および更新実行処理(図6を参照)は、第二の実施形態でも実行される。これらの処理の詳細は、第一の実施形態において説明した通りであるため、説明を省略する。
 図10は、本実施形態において、第一のノード1Aおよび第二のノード1B’によって実行されるトランザクションログ送受信開始処理の流れを示すフローチャートである。本フローチャートに示された処理は、第一の実施形態において説明した管理情報送受信処理(図3を参照)に代えて実行される処理であり、データベースの構築開始の指示が受け付けられたことを契機として開始される。
 ステップS801およびステップS802では、トランザクションログ要求が送受信される。要求送信部31は、第一のノード1Aに対して、トランザクションログの送信要求を送信する(ステップS801)。要求受信部22は、第二のノード1B’によって送信された要求を受信する(ステップS802)。その後、処理はステップS803へ進む。
 ステップS803およびステップS804では、トランザクションログの送受信が開始される。ログ送信部24は、以降、第一のノード1Aにおいて新たに発生したトランザクションログおよびLSNを、発生次第、互いに関連づけて第二のノード1B’に順次送信する(ステップS803)。第二のノード1B’のデータ受信部32は、第一のノード1Aによって送信された、トランザクションログおよび該トランザクションログに係るLSNの受信を開始する(ステップS804)。即ち、第二のノード1B’は、ログの送信開始後、所定の時点以降のトランザクションログを全て受信することとなる。その後、処理はステップS805へ進む。
 ステップS805では、検索要求(クエリ)の受付が開始される。第二のノード1B’は、後述するオンデマンド処理を開始させることで、ユーザー端末9から送信されるクエリの受付を開始する。以降、検索要求受付部35は、ユーザー端末9からのクエリを受け付け、クエリが受け付けられると、クエリに応じるために必要なページ(管理情報を含む)が取得される。その後、本フローチャートに示された処理は終了する。
 即ち、第二の実施形態では、第一の実施形態と異なり、データベースの構築開始の時点で管理情報送受信処理が行われない。
 また、図4に示すデータベース送受信処理については、第一の実施形態において「第一のノード1Aによって管理されているデータベースのページ構成を把握可能となったことを契機として開始される」と説明したが、第二の実施形態では、第一の実施形態とは異なり、後述するオンデマンド処理の中で呼び出されるタイミングで実行される(後述するステップS605およびステップS514を参照)。
 図11は、本実施形態において、第二のノード1B’によって実行されるオンデマンド処理の流れを示すフローチャートである。本フローチャートに示された処理は、第二のノード1B’が、ユーザー端末9等からクエリを受信したことを契機として開始される。即ち、本実施形態では、第一の実施形態において説明した検索要求対応処理(図7および図8を参照)に代えて、オンデマンド処理が実行される。
 但し、第二の実施形態では、上述の通り、データベースの構築開始の時点で管理情報送受信処理が行われていない。このため、検索要求が受け付けられた時点で、第二のノード1B’が管理情報を有していない可能性がある。そして、第二のノード1B’が管理情報を有していない場合、データの送信要求においてクエリに係るページを指定することが出来ない。このため、本実施形態に係るオンデマンド処理では、検索要求が受け付けられると、はじめに、第二のノード1B’が管理情報を有しているか否かが確認される。そして、第二のノード1B’が管理情報を有していない場合、これを第一のノード1Aから取得してから、データベース送受信処理が実行される。以下、本実施形態に係るオンデマンド処理の詳細を、図11を参照しながら説明する。
 ステップS601では、クエリが受け付けられる。検索要求受付部35は、ユーザー端末9からのクエリを受け付ける。その後、処理はステップS602へ進む。
 ステップS602では、管理情報のキャッシュが存在するか否かが判定される。検索応答部36は、メモリ上に、管理情報のキャッシュが存在するか否かを判定する。なお、本実施形態では、レコードはページ単位で管理されているため、検索応答部36は、検索対象での管理情報を含むページのキャッシュが存在するか否かを判定する。
 本実施形態では、管理情報を含むページがRAM12Bに読み出された段階で、当該ページに対して、待機させられた更新命令が実行される(図6および後述するステップS606からステップS609に示す処理を参照)。また、キャッシュが存在するページに対する更新命令は即座に実行される(図5を用いて説明したマップ生成処理を参照)。このため、本実施形態において、管理情報を含むページのキャッシュが既に存在する場合(ステップS602における判定結果が「YES」の場合)、当該ページに対する更新命令の実行が待機されていることはない。従って、管理情報を含むページのキャッシュが存在する場合、検索応答部36は、記憶領域からの読み出しを行わず、既にキャッシュが存在する管理情報を参照の対象とし、処理はステップS610へ進む。一方、管理情報のキャッシュが存在しない場合、処理はステップS603へ進む。
 ステップS603では、管理情報を含むページが第二のノード1B’のストレージ(データベース)に存在するか否かが判定される。上述の通り、本実施形態では、データベースの構築開始の時点で管理情報送受信処理が行われていない可能性があるため、クエリを受けた時点で、第二のノード1B’がクエリに係るページを特定するための管理情報を有していない場合がある。管理情報がストレージに存在しないと判定された場合、管理情報を第一のノード1Aから取得するために、処理はステップS605へ進む。一方、ページがストレージに存在すると判定された場合、処理はステップS604へ進む。
 ステップS605では、図4に示されたデータベース送受信処理が実行される。ステップS603において管理情報がストレージに存在しないと判定された場合、要求送信部31は、クエリに応じて、第一のノード1Aに対して、管理情報に係るデータを指定してデータの送信要求を送信する。上述の通り、本実施形態では、管理情報の送受信についても、他のテーブルと同様ページ単位で行われるため、図4に示されたデータベース送受信処理によって管理情報を取得することが出来る。その後、処理はステップS602へ戻る。そして、第一のノード1Aから管理情報が取得されるまで、ステップS602からステップS605に示された処理が繰り返される。
 ステップS604では、管理情報がストレージから読み出される。展開部37は、管理情報のキャッシュが存在しないが、第二のノード1B’のストレージに存在する場合、管理情報をストレージ(補助記憶装置14B)からRAM12Bに読み出す。その後、処理はステップS606へ進む。
 ステップS606では、待機している更新命令の有無が判定される。第二のノード1B’は、マップを参照し、RAM12Bに読み出された管理情報のページについて待機している更新命令があるか否かを判定する。RAM12Bに読み出されたページについて待機している更新命令がマップに記録されていない場合、処理はステップS610へ進む。一方、RAM12Bに読み出したページについて待機している更新命令がマップに記録されている場合、処理はステップS607に進む。
 ステップS607では、更新対象ページに関する更新命令がマップから抽出される。第二のノード1B’は、ステップS603において存在すると判定された更新対象のページ(ここでは、管理情報を含むページ)に対する更新命令を、マップから全て抽出する。このようにすることで、更新対象ページに関するマップ上の更新命令を全て実行し、更新命令が実行されたページをそのままキャッシュとして、データの検索または処理に供することが出来る。その後、処理はステップS608へ進む。
 ステップS608およびステップS609では、マップに待機している更新命令および抽出された更新命令が実行され、実行済みの更新命令がマップから削除される。実行部33は、マップを参照して、RAM12Bに読み出した管理情報に係る更新命令を実行する(ステップS608)。即ち、本実施形態において、第二のノード1B’は、クエリに応じて(ステップS601)、データ受信部32によって受信された管理情報(ステップS207)をメモリに展開し(ステップS604)、マップに基づいて更新命令を管理情報に対して実行する。
 ここで、実行部33は、マップに記録されている順に、待機している更新命令を実行する。そして、第二のノード1B’は、RAM12Bに読み出した管理情報について待機している更新命令を全て実行した後に、実行した更新命令に関する記録をマップから削除する(ステップS609)。その後、処理はステップS610へ進む。
 ステップS610では、管理情報が参照されてページが特定される。検索応答部36は、受信されたクエリにより検索範囲に指定された記憶領域を特定するために、管理情報を参照する。本実施形態では、管理情報を参照することで、クエリを処理するために必要なデータを含むページが特定される。その後、処理は図8を用いて説明した検索要求対応処理のステップS511からステップS520に示す処理の内容と概略同様の処理へ進む。
 即ち、第一のノード1Aから対象ページが取得されるまで、ステップS511からステップS514に示された処理が繰り返され、ステップS601で受け付けられたクエリへの対応は、対象ページが第一のノード1Aから取得されるまで待機される。本実施形態では、検索要求を受けて検索対象となることで、はじめてリクエスト(データ送信要求)の対象となる。その後、ステップS519およびステップS520に示された処理が実行され、クエリに対する応答が完了すると、本フローチャートに示された処理は終了する。
 図12は、本実施形態において、第二のノード1B’によって実行される削除処理の流れを示すフローチャートである。本フローチャートに示された処理は、第二のノード1B’において、メモリに展開されてキャッシュとなっているデータの単位(本実施形態では、ページ単位)毎に、定期的に実行される。
 ステップS701では、データが削除条件を満たしたか否かが判定される。削除部40は、第二のノード1B’上にあるキャッシュのうち、判定対象のページに係るキャッシュついて、所定の削除条件を満たしたか否かを判定する。ここで用いられる削除条件は、例えば、データ処理に関する時点(第一のノード1Aから取得された時点や、クエリ応答や更新等のために最後に参照された時点等)から所定の時間が経過したこと、等である。但し、削除条件は、本実施形態における例示に限定されない。削除条件を満たさないと判定された場合、判定対象のページに係るキャッシュは削除されず、本フローチャートに示された処理は終了する。一方、削除条件を満たしたと判定された場合、処理はステップS702へ進む。
 ステップS702では、データが保持の対象であるか否かが判定される。判定部38は、第二のノード1B’によって保持されているデータのうち、判定対象のページについて、第二のノード1B’における保持対象とするか否かを判定する。ここで、判定のための条件は、例えば、当該データがクエリにおいて参照される頻度等に基づいて決定されてよい。例えば、参照される頻度の高いデータを保持の対象とし、頻度の低いデータを保持の対象としないことで、クエリへの応答速度を犠牲にすること無く、第二のノード1B’のストレージやメモリを節約することが出来る。また、例えば、予め管理者等によって指定されたテーブルやページを保持の対象として設定しておくことも可能である。但し、保持対象とするか否かの判定条件は、本実施形態における例示に限定されない。判定条件は、実施の形態に応じて適宜採用することが出来る。判定対象のページが、保持の対象となるための条件を満たさない場合、処理はステップS704へ進む。一方、判定対象のページが、保持の対象となるための条件を満たしている場合、処理はステップS703へ進む。
 ステップS703では、データがストレージに記録される。記録部39は、判定部38によって保持対象と判定されたデータ(本実施形態では、ページ単位で判定される)を、ストレージ(本実施形態では、補助記憶装置14B)に記録する。その後、処理はステップS705へ進む。
 ステップS704では、削除条件を満たしたデータがストレージから削除される。削除部40は、判定部38によって保持対象ではないと判定されたデータ(本実施形態では、ページ単位で判定される)が、第二のノード1B’のストレージに記録されている場合に、これをストレージ(本実施形態では、補助記憶装置14B)から削除する。このようにすることで、受信されてキャッシュとなる前に一旦ストレージに記録されたデータについても、ストレージから削除することが出来る。その後、処理はステップS705へ進む。
 ステップS705では、削除条件を満たしたデータのキャッシュが削除される。削除部40は、削除条件を満たしたページのキャッシュを、第二のノード1B’のメモリから削除する。その後、本フローチャートに示された処理は終了する。
 なお、図12に示したフローチャートでは、キャッシュとなっているデータについて削除の対象とするか否かを判定している。但し、ストレージに保持されているがキャッシュとなっていないデータについても、定期的に保持対象であるか否かを判定し、保持対象となるための条件(ステップS702を参照)を満たさなくなった場合にはストレージから削除することとしてもよい。このようにすることで、ストレージにのみ保持されているようなデータについても、時間の経過に従ってストレージから削除し、ストレージの容量を節約することが出来る。
 <<第二の実施形態に係るシステムの効果>>
 第二の実施形態に係るシステムによっても、第一の実施形態に係るシステムと同様の効果を得ることが出来る。また、第二の実施形態では、更に判定部38、記録部39および削除部40を備えることで、第二のノード1B’のストレージやメモリを節約しながら、ユーザー端末9に対して、あたかも第二のノード1B’がデータベース全体に係るデータを有しているかのようにサービスを提供することが出来る。
 また、判定部38や削除部40によって用いられる条件を実施の形態に応じて適宜設定することで、ストレージリソースとネットワークリソースのバランスに応じて、リソースの無駄が少ないシステムを構築することが可能となる。

Claims (17)

  1.  複数のノードを有するデータベースシステムであって、
     前記複数のノードのうち、第一のノードは、
      該第一のノードによって管理されているデータベースのトランザクションログを、該トランザクションログに係る命令の順序を把握可能な識別情報とともに保持するログ保持手段と、
      前記複数のノードのうち、前記第一のノードと異なる第二のノードから、該第一のノードによって管理されているデータの送信要求を受信する要求受信手段と、
      前記送信要求に応じて、前記ログ保持手段によって保持されている前記識別情報のうち、要求されたデータに係る、所定の時点におけるトランザクションログを示す特定識別情報を、前記第二のノードに送信する特定識別情報送信手段と、
      少なくとも前記所定の時点より後の前記トランザクションログおよび前記識別情報を、互いに関連づけて前記第二のノードに送信するログ送信手段と、
      前記送信要求に応じて、前記データベースによって管理されているデータのうち要求されたデータを、前記所定の時点以降に、前記第二のノードに送信するデータ送信手段と、
      を備え、
     前記第二のノードは、
      ユーザー端末からの検索要求を受け付ける検索要求受付手段と、
      前記検索要求に応じて、前記第一のノードに対して、前記データベース中の少なくとも前記検索要求に係るデータの前記送信要求を送信する要求送信手段と、
      前記第一のノードから、前記トランザクションログ、該トランザクションログの識別情報、前記特定識別情報および前記データを受信する受信手段と、
      受信された前記データが該第二のノードのメモリに展開されてデータの検索または処理に供される状態となった場合に、受信された前記トランザクションログのうち、少なくとも前記特定識別情報が示すトランザクションログよりも新しい前記トランザクションログに係る命令を、メモリに展開された前記データに対して実行する実行手段と、
      前記検索要求の結果前記第一のノードから得られ、前記トランザクションに基づく命令が実行されたデータに基づいて、前記検索要求への応答を前記ユーザー端末に対して返す検索応答手段と、
      前記検索要求の結果前記第一のノードから得られ、前記トランザクションに基づく命令が実行されたデータを、前記検索応答手段による応答に用いた後、所定の条件に従って自動的に該第二のノードから削除する削除手段と、
      を備える、
     データベースシステム。
  2.  前記削除手段は、前記データに関する処理に関する時点から所定時間経過した場合に、前記データを削除する、
     請求項1に記載のデータベースシステム。
  3.  前記第二のノードは、前記検索要求の結果前記第一のノードから得られ、前記トランザクションに基づく命令が実行されたデータを、該第二のノードにおける保持対象とするか否かを判定する判定手段を更に備え、
     前記削除手段は、前記判定手段によって前記保持対象と判定されなかったデータを、前記所定の条件に従って自動的に削除する、
     請求項1または2に記載のデータベースシステム。
  4.  前記第二のノードは、前記判定手段によって前記保持対象と判定されたデータを、不揮発性の記憶装置に記録する記録手段を更に備える、
     請求項3に記載のデータベースシステム。
  5.  前記データ送信手段は、前記データを、前記トランザクションログに係る命令の順序が互いに依存関係にあるレコードが同一の管理単位に入るように区切られた所定の管理単位毎に送信する、
     請求項1から4の何れか一項に記載のデータベースシステム。
  6.  受信された前記トランザクションログのうち、少なくとも前記特定識別情報が示すトランザクションログよりも新しい前記トランザクションログに基づいて、命令の対象となるデータが収容された前記所定の管理単位と命令の内容との関係を示すマップを生成するマップ生成手段を更に備え、
     前記実行手段は、前記マップを参照して、前記トランザクションログに係る命令を、前記所定の管理単位毎に実行する、
     請求項5に記載のデータベースシステム。
  7.  受信された前記トランザクションログのうち、少なくとも前記特定識別情報が示すトランザクションログよりも新しい前記トランザクションログに基づいて、命令の対象となるデータと命令の内容との関係を示すマップを生成するマップ生成手段を更に備え、
     前記実行手段は、前記マップを参照して、前記トランザクションログに係る命令を、命令の対象となるデータに対して実行する、
     請求項1に記載のデータベースシステム。
  8.  前記データ送信手段は、前記第一のノードのメモリに展開されてデータの検索または処理に供されている状態のデータを、前記第二のノードに送信する、
     請求項1から7の何れか一項に記載のデータベースシステム。
  9.  前記データ送信手段は、前記データベースの管理情報を、前記第二のノードに送信し、
     前記要求送信手段は、前記管理情報を参照して、前記第一のノードに対して、前記データベース中のデータを指定して送信要求を送信する、
     請求項1から8の何れか一項に記載のデータベースシステム。
  10.  前記第二のノードは、
      前記第一のノードから受信したデータを直接メモリに展開して、データの検索または処理に供する展開手段を更に備え、
     前記実行手段は、受信したデータが前記展開手段によってメモリに展開されたことを受けて、前記トランザクションログに係る命令を前記データに対して実行する、
     請求項1から9の何れか一項に記載のデータベースシステム。
  11.  前記特定識別情報送信手段は、前記特定識別情報として、ログ保持手段によって保持されている前記識別情報のうち、最新のトランザクションログを示す識別情報を送信する、
     請求項1から10の何れか一項に記載のデータベースシステム。
  12.  前記データは、テーブル単位またはページ単位で送受信される、
     請求項1から11の何れか一項に記載のデータベースシステム。
  13.  前記実行手段は、前記トランザクションログに係る命令を、前記識別情報によって把握される命令の順序に応じて、受信された前記データに対して実行する、
     請求項1から12の何れか一項に記載のデータベースシステム。
  14.  データベースを管理する管理手段と、
     前記データベースのトランザクションログを、該トランザクションログに係る命令の順序を把握可能な識別情報とともに保持するログ保持手段と、
     他の情報処理装置から、前記データベースによって管理されているデータの送信要求を受信する要求受信手段と、
     前記送信要求に応じて、前記ログ保持手段によって保持されている前記識別情報のうち、要求されたデータに係る、所定の時点におけるトランザクションログを示す特定識別情報を、前記他の情報処理装置に送信する特定識別情報送信手段と、
     少なくとも前記所定の時点より後の前記トランザクションログおよび前記識別情報を、互いに関連づけて前記他の情報処理装置に送信するログ送信手段と、
     前記送信要求に応じて、前記データベースによって管理されているデータのうち要求されたデータを、前記所定の時点以降に、前記他の情報処理装置に送信するデータ送信手段と、
     を備える情報処理装置。
  15.  ユーザー端末からの検索要求を受け付ける検索要求受付手段と、
     前記検索要求に応じて、データベースを管理する他の情報処理装置に対して、前記データベース中の少なくとも前記検索要求に係るデータの前記送信要求を送信する要求送信手段と、
     前記他の情報処理装置から、該データベースのトランザクションログ、該トランザクションログに係る命令の順序を把握可能な識別情報、前記識別情報のうち所定の時点におけるトランザクションログを示す特定識別情報、および前記データベースによって管理されているデータを受信する受信手段と、
     受信された前記データがメモリに展開されてデータの検索または処理に供される状態となった場合に、受信された前記トランザクションログのうち、少なくとも前記特定識別情報が示すトランザクションログよりも新しい前記トランザクションログに係る命令を、メモリに展開された前記データに対して実行する実行手段と、
     前記検索要求の結果前記他の情報処理装置から得られ、前記トランザクションに基づく命令が実行されたデータに基づいて、前記検索要求への応答を前記ユーザー端末に対して返す検索応答手段と、
     前記検索要求の結果前記他の情報処理装置から得られ、前記トランザクションに基づく命令が実行されたデータを、前記検索応答手段による応答に用いた後、所定の条件に従って自動的に該情報処理装置から削除する削除手段と、
     を備える情報処理装置。
  16.  複数のノードを有するデータベースシステムにおいて、
     前記複数のノードのうち、第一のノードが、
      該第一のノードによって管理されているデータベースのトランザクションログを、該トランザクションログに係る命令の順序を把握可能な識別情報とともに保持するログ保持ステップと、
      前記複数のノードのうち、前記第一のノードと異なる第二のノードから、該第一のノードによって管理されているデータの送信要求を受信する要求受信ステップと、
      前記送信要求に応じて、前記ログ保持ステップで保持されている前記識別情報のうち、要求されたデータに係る、所定の時点におけるトランザクションログを示す特定識別情報を、前記第二のノードに送信する特定識別情報送信ステップと、
      少なくとも前記所定の時点より後の前記トランザクションログおよび前記識別情報を、互いに関連づけて前記第二のノードに送信するログ送信ステップと、
      前記送信要求に応じて、前記データベースによって管理されているデータのうち要求されたデータを、前記所定の時点以降に、前記第二のノードに送信するデータ送信ステップと、
      を実行し、
     前記第二のノードが、
      ユーザー端末からの検索要求を受け付ける検索要求受付ステップと、
      前記検索要求に応じて、前記第一のノードに対して、前記データベース中の少なくとも前記検索要求に係るデータの前記送信要求を送信する要求送信ステップと、
      前記第一のノードから、前記トランザクションログ、該トランザクションログの識別情報、前記特定識別情報および前記データを受信する受信ステップと、
      受信された前記データが該第二のノードのメモリに展開されてデータの検索または処理に供される状態となった場合に、受信された前記トランザクションログのうち、少なくとも前記特定識別情報が示すトランザクションログよりも新しい前記トランザクションログに係る命令を、メモリに展開された前記データに対して実行する実行ステップと、
      前記検索要求の結果前記第一のノードから得られ、前記トランザクションに基づく命令が実行されたデータに基づいて、前記検索要求への応答を前記ユーザー端末に対して返す検索応答ステップと、
      前記検索要求の結果前記第一のノードから得られ、前記トランザクションに基づく命令が実行されたデータを、前記検索応答ステップにおける応答に用いた後、所定の条件に従って自動的に該第二のノードから削除する削除ステップと、
      を実行する、
     方法。
  17.  複数のノードを有するデータベースシステムにおいて、
     前記複数のノードのうち、第一のノードを、
      該第一のノードによって管理されているデータベースのトランザクションログを、該トランザクションログに係る命令の順序を把握可能な識別情報とともに保持するログ保持手段と、
      前記複数のノードのうち、前記第一のノードと異なる第二のノードから、該第一のノードによって管理されているデータの送信要求を受信する要求受信手段と、
      前記送信要求に応じて、前記ログ保持手段によって保持されている前記識別情報のうち、要求されたデータに係る、所定の時点におけるトランザクションログを示す特定識別情報を、前記第二のノードに送信する特定識別情報送信手段と、
      少なくとも前記所定の時点より後の前記トランザクションログおよび前記識別情報を、互いに関連づけて前記第二のノードに送信するログ送信手段と、
      前記送信要求に応じて、前記データベースによって管理されているデータのうち要求されたデータを、前記所定の時点以降に、前記第二のノードに送信するデータ送信手段と、
      として機能させ、
     前記第二のノードを、
      ユーザー端末からの検索要求を受け付ける検索要求受付手段と、
      前記検索要求に応じて、前記第一のノードに対して、前記データベース中の少なくとも前記検索要求に係るデータの前記送信要求を送信する要求送信手段と、
      前記第一のノードから、前記トランザクションログ、該トランザクションログの識別情報、前記特定識別情報および前記データを受信する受信手段と、
      受信された前記データが該第二のノードのメモリに展開されてデータの検索または処理に供される状態となった場合に、受信された前記トランザクションログのうち、少なくとも前記特定識別情報が示すトランザクションログよりも新しい前記トランザクションログに係る命令を、メモリに展開された前記データに対して実行する実行手段と、
      前記検索要求の結果前記第一のノードから得られ、前記トランザクションに基づく命令が実行されたデータに基づいて、前記検索要求への応答を前記ユーザー端末に対して返す検索応答手段と、
      前記検索要求の結果前記第一のノードから得られ、前記トランザクションに基づく命令が実行されたデータを、前記検索応答手段による応答に用いた後、所定の条件に従って自動的に該第二のノードから削除する削除手段と、
      として機能させる、
     プログラム。
     
PCT/JP2014/058382 2014-03-25 2014-03-25 データベースシステム、情報処理装置、方法およびプログラム Ceased WO2015145587A1 (ja)

Priority Applications (4)

Application Number Priority Date Filing Date Title
EP14886733.6A EP3125123A4 (en) 2014-03-25 2014-03-25 Database system, information processing device, method, and program
JP2016509682A JP6461101B2 (ja) 2014-03-25 2014-03-25 データベースシステム、情報処理装置、方法およびプログラム
PCT/JP2014/058382 WO2015145587A1 (ja) 2014-03-25 2014-03-25 データベースシステム、情報処理装置、方法およびプログラム
US15/274,446 US10579604B2 (en) 2014-03-25 2016-09-23 Database system, information processing device, method and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2014/058382 WO2015145587A1 (ja) 2014-03-25 2014-03-25 データベースシステム、情報処理装置、方法およびプログラム

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/274,446 Continuation US10579604B2 (en) 2014-03-25 2016-09-23 Database system, information processing device, method and medium

Publications (1)

Publication Number Publication Date
WO2015145587A1 true WO2015145587A1 (ja) 2015-10-01

Family

ID=54194185

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2014/058382 Ceased WO2015145587A1 (ja) 2014-03-25 2014-03-25 データベースシステム、情報処理装置、方法およびプログラム

Country Status (4)

Country Link
US (1) US10579604B2 (ja)
EP (1) EP3125123A4 (ja)
JP (1) JP6461101B2 (ja)
WO (1) WO2015145587A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020504377A (ja) * 2016-12-23 2020-02-06 イングラム マイクロ インコーポレーテッド データベースバウンドアプリケーション用にユーザインターフェースバックエンドクラスタをスケーリングするための技術

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10552418B2 (en) * 2016-12-29 2020-02-04 Ancestry.Com Operations Inc. Optimization of first set of ordered items and delayed non-duplicated work queue
US10678773B2 (en) * 2017-08-25 2020-06-09 Salesforce.Com, Inc. Parallel processing of disjoint change streams into a single stream
US20200097215A1 (en) * 2018-09-25 2020-03-26 Western Digital Technologies, Inc. Adaptive solid state device management based on data expiration time

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009015476A (ja) * 2007-07-03 2009-01-22 Hitachi Ltd Cdpリモート構成におけるジャーナル管理方法
WO2010106991A1 (ja) * 2009-03-19 2010-09-23 株式会社ココリンク データの複製管理方法及びシステム
JP2013015915A (ja) * 2011-06-30 2013-01-24 Fujitsu Ltd 送信制御方法、装置及びプログラム

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5353410A (en) 1992-03-18 1994-10-04 International Business Machines Corporation Method and system for deferred read in lazy-write disk cache systems
US7257699B2 (en) 2004-07-08 2007-08-14 Sun Microsystems, Inc. Selective execution of deferred instructions in a processor that supports speculative execution
JP4929782B2 (ja) 2006-03-27 2012-05-09 富士通株式会社 ミラーサイト運用プログラム、方法及びミラーサイトサーバコンピュータ
JP4833734B2 (ja) 2006-05-19 2011-12-07 株式会社日立製作所 データベースシステム、ストレージ装置、初期コピー方法及びログ適用方法
KR100926880B1 (ko) 2007-05-21 2009-11-16 엔에이치엔(주) Dbms에서의 데이터 복제 방법 및 시스템
KR101265388B1 (ko) 2009-07-02 2013-05-20 엔에이치엔비즈니스플랫폼 주식회사 고가용성 데이터베이스 관리 시스템 및 이를 이용한 데이터베이스 관리 방법
JP5039891B2 (ja) 2009-10-19 2012-10-03 インターナショナル・ビジネス・マシーンズ・コーポレーション データベースの複製を生成する装置及び方法
US20110178984A1 (en) 2010-01-18 2011-07-21 Microsoft Corporation Replication protocol for database systems
US8671074B2 (en) * 2010-04-12 2014-03-11 Microsoft Corporation Logical replication in clustered database system with adaptive cloning
CN101860797B (zh) * 2010-05-21 2014-08-13 中兴通讯股份有限公司 数据信息的传输方法、装置及移动多媒体广播业务系统
US10430298B2 (en) 2010-10-28 2019-10-01 Microsoft Technology Licensing, Llc Versatile in-memory database recovery using logical log records
JP5724363B2 (ja) 2010-12-20 2015-05-27 日本電気株式会社 情報処理システム

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009015476A (ja) * 2007-07-03 2009-01-22 Hitachi Ltd Cdpリモート構成におけるジャーナル管理方法
WO2010106991A1 (ja) * 2009-03-19 2010-09-23 株式会社ココリンク データの複製管理方法及びシステム
JP2013015915A (ja) * 2011-06-30 2013-01-24 Fujitsu Ltd 送信制御方法、装置及びプログラム

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3125123A4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020504377A (ja) * 2016-12-23 2020-02-06 イングラム マイクロ インコーポレーテッド データベースバウンドアプリケーション用にユーザインターフェースバックエンドクラスタをスケーリングするための技術

Also Published As

Publication number Publication date
JPWO2015145587A1 (ja) 2017-04-13
US10579604B2 (en) 2020-03-03
EP3125123A4 (en) 2017-11-22
EP3125123A1 (en) 2017-02-01
JP6461101B2 (ja) 2019-01-30
US20170011075A1 (en) 2017-01-12

Similar Documents

Publication Publication Date Title
CN110502507B (zh) 一种分布式数据库的管理系统、方法、设备和存储介质
US10747752B2 (en) Space management for transactional consistency of in-memory objects on a standby database
US12235809B1 (en) Efficient data backup in a distributed storage system
EP2653986B1 (en) Client-side caching of a database transaction token.
US9690796B2 (en) Non-transitory computer-readable media storing file management program, file management apparatus, and file management method
JP2007286860A (ja) データ転送方法及び情報処理装置
JP4741371B2 (ja) システム、サーバ装置及びスナップショットの形式変換方法
JP6279770B2 (ja) ファイルサーバ装置
JP6461101B2 (ja) データベースシステム、情報処理装置、方法およびプログラム
KR20140047448A (ko) 트랜잭션 재시작 가능한 클라이언트 장치와 데이터베이스 서버 및 방법
JP6586174B2 (ja) データベースシステム、トランザクション管理ノード、方法およびプログラム
JP5721056B2 (ja) トランザクション処理装置、トランザクション処理方法およびトランザクション処理プログラム
JP6257748B2 (ja) データベースシステム、情報処理装置、方法およびプログラム
CN117255101B (zh) 分布式存储系统的数据处理方法、装置、设备及介质
WO2009147847A1 (ja) データベース並行編集方式
US11269735B2 (en) Methods and systems for performing data backups
WO2016206070A1 (zh) 一种文件更新方法及存储设备
US10073874B1 (en) Updating inverted indices
CN121116971A (zh) 基于云搜索服务的数据查询方法、介质、设备及产品
JP4855537B2 (ja) データベース並行編集方式
JP4923140B2 (ja) データベース並行編集方式
CN121009061A (zh) 基于云搜索服务的数据查询方法、介质、设备及程序产品
CN120011326A (zh) 文件存储方法、读取方法、装置、设备及介质
JPWO2016117322A1 (ja) 処理要求装置、処理装置、データベースシステム、データベース更新方法およびプログラム
CN120123421A (zh) 数据库集群、数据处理方法、数据处理系统及相关设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14886733

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2016509682

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

REEP Request for entry into the european phase

Ref document number: 2014886733

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2014886733

Country of ref document: EP