Information processing device, information processing method, and program
The information processing device synchronizes relational and graph databases in real time by using dedicated processing units and synchronization mechanisms, addressing the challenge of redundant data management and ensuring timely data consistency.
Patent Information
- Application Number
- JP2021065299
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-04-07
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2041-04-07
AI Technical Summary
Existing information processing devices do not synchronize relational databases and graph databases in real time, necessitating redundant management of the same information in both types of databases.
An information processing device that includes a first database processing unit for graph databases, a second database processing unit for tabular or key-value format databases, and a synchronization unit that generates queries based on mapping information to synchronize data between the two databases in real time, handling updates to nodes and edges accordingly.
Enables real-time synchronization of data between relational and graph databases, ensuring consistent and efficient management of network configuration information.
Smart Images

Figure 0007780874000001 
Figure 0007780874000002 
Figure 0007780874000003
Abstract
Description
[Technical Field]
[0001] The present invention relates to an information processing device, an information processing method, and a program. [Background technology]
[0002] There has long been a demand for technology that allows users to search for desired data from vast amounts of complex data. One example of such vast amounts of complex data is data representing the configuration of a communication network (network configuration information). Telecommunications carriers and providers offer a variety of new services in response to market demands, but as services become more diverse, communication networks are becoming larger in capacity and their configurations are becoming more diverse and complex. For telecommunications carriers and providers, providing stable services is a top priority, and ensuring the consistency of network equipment and network configuration information representing the connections between network equipment is an essential requirement for communication networks. To meet this requirement, relational databases, which excel at managing the consistency of network configuration information, have traditionally been used.
[0003] Graph databases have been known for some time as a type of database different from relational databases. Graph data is a database that contains node information and edge information. The node information is information that includes label names (node names) and node properties, and the edge information is information for identifying relationships (connections) between graph nodes.
[0004] Examples of technologies using relational databases and graph databases include information processing devices described in References 1 and 2. [Prior art documents] [Patent documents]
[0005] [Patent Document 1] Japanese Patent Application Publication No. 2020-161088 [Patent Document 2] Japanese Patent Application Publication No. 2020-161089 Summary of the Invention [Problem to be solved by the invention]
[0006] The information processing devices described in Patent Documents 1 and 2 realize processing using both a relational database and a graph database, but it is necessary to manage substantially the same information in both the relational database and the graph database. However, Patent Documents 1 and 2 do not consider technology for synchronizing the relational database and the graph database in real time.
[0007] The present invention has been made in consideration of the above-mentioned problems, and aims to provide an information processing device, an information processing method, and a program that can synchronize information in real time between a relational database and a graph database. [Means for solving the problem]
[0008] (1) One aspect of the present invention includes a first database processing unit that executes update processing of the nodes and / or the edges for a graph database including nodes and edges between the nodes; a second database processing unit that executes processing for a tabular or key-value format database; a reception unit that receives an update request for the tabular or key-value format database; and a synchronization unit that supplies a query to the first database processing unit to update the graph database based on a processing result by the second database processing unit each time an update request is received by the reception unit, wherein the synchronization unit refers to mapping information between the tabular or key-value format database and the graph database, Request data registration If the table that received the update request is a parent table, which is a table that is not related to other tables, Data registered in the parent table Create only the nodes that correspond to Request the registration of said dataIf the table that received the update request is a child table, which is a table that has a relationship with other tables, Data to be registered in the child table The node corresponding to and Connects the node to other nodes that are related by the data registered in the child table Create an edge Request the registration of said data If the type of table that received the update request is an intermediate table, which is a table located between tables, Connecting nodes that are related by the data registered in the intermediate table It is an information processing device that creates only edges.
[0010] (2) One aspect of the present invention is the above-mentioned information processing device, wherein the synchronization unit may supply a query for the node and a query for the edge in parallel to the first database processing unit in response to the processing results by the second database processing unit corresponding to the update request.
[0011] (3) One aspect of the present invention is the above-mentioned information processing device, wherein the second database processing unit converts the processing results by the second database processing unit using a logical replication function and supplies the converted update information to the synchronization unit.
[0012] (4) As an aspect of the present invention, the information processing device may further include a management unit that manages the mapping information independently of the operation of the synchronization unit.
[0013] (5) In one aspect of the present invention, in the information processing device, when the update request is information requesting data registration in a parent table in the tabular or key-value format database, the synchronization unit generates a query to register the node based on the update request requesting data registration in the parent table, and when the update request is information requesting data update in a parent table in the tabular or key-value format database, the synchronization unit generates a query to update the node based on the update request requesting data registration in the parent table, and the update request is information requesting data registration in a child table in the tabular or key-value format database. If so, the synchronization unit may generate a query to register the node and the edge based on the update request requesting data registration in the child table, if the update request is information requesting data deletion from a child table in the tabular or key-value format database, the synchronization unit may generate a query to delete the node and the edge based on the update request requesting data deletion in the child table, and if the update request is information requesting data registration in an intermediate table in the tabular or key-value format database, the synchronization unit may generate a query to register the edge based on the update request requesting data registration in the intermediate table.
[0014] (6) In one aspect of the present invention, a computer executes the following steps: receiving an update request for a tabular or key-value format database; executing processing on the tabular or key-value format database based on the update request; each time the computer receives the update request, generating a query to update a graph database including nodes and edges between the nodes based on a result of processing the tabular or key-value format database; and executing update processing on the graph database for the nodes and / or the edges based on the query, and the update processing Steps to performreferring to mapping information between the table format or key-value format database and the graph database; Request data registration If the table that received the update request is a parent table, which is a table that is not related to other tables, Data registered in the parent table creating only the nodes corresponding to Request the registration of said data If the table that received the update request is a child table, which is a table that has a relationship with other tables, Data to be registered in the child table The node corresponding to and Connects the node to other nodes that are related by the data registered in the child table creating an edge; Request the registration of said data If the type of table that received the update request is an intermediate table, which is a table located between tables, Connecting nodes that are related by the data registered in the intermediate table and creating only edges.
[0015] (7) One aspect of the present invention is a method for causing a computer to execute the steps of: receiving an update request for a tabular or key-value format database; executing processing on the tabular or key-value format database based on the update request; generating a query for updating a graph database including nodes and edges between the nodes based on a result of processing the tabular or key-value format database each time the update request is received; and executing update processing on the nodes and / or the edges for the graph database based on the query; The update process Steps to perform referring to mapping information between the table format or key-value format database and the graph database; Request data registration If the table that received the update request is a parent table, which is a table that is not related to other tables, Data registered in the parent table creating only the nodes corresponding to Request the registration of said data If the table that received the update request is a child table, which is a table that has a relationship with other tables, Data to be registered in the child table The node corresponding to and Connects the node to other nodes that are related by the data registered in the child tablecreating an edge; Request the registration of said data If the type of table that received the update request is an intermediate table, which is a table located between tables, Connecting nodes that are related by the data registered in the intermediate table and creating only edges. [Effects of the Invention]
[0016] According to one aspect of the present invention, information can be synchronized in real time between a relational database and a graph database. [Brief explanation of the drawings]
[0017] [Figure 1] 1 is a block diagram illustrating an example of an information processing system according to an embodiment of the present invention. [Figure 2] 1 is a diagram illustrating an example of a processing target of an information processing system according to an embodiment to which the present invention is applied; [Figure 3] FIG. 2 is a diagram illustrating an RDB and a graph DB in an embodiment to which the present invention is applied. [Figure 4] FIG. 10 is a block diagram illustrating an update process for an RDB and a graph DB. [Figure 5] FIG. 2 is a block diagram of an RDB processing unit, a real-time synchronization unit, and a graph DB processing unit in an embodiment to which the present invention is applied. [Figure 6] FIG. 2 is a block diagram of an RDB processing unit in an embodiment to which the present invention is applied. [Figure 7] FIG. 10 is a diagram showing the relationship between mapping patterns, table types of an RDB, and reflection processing to a graph DB in an embodiment to which the present invention is applied. [Figure 8] FIG. 10 is a diagram illustrating an example of synchronization processing from an RDB to a graph DB in an embodiment to which the present invention is applied. [Figure 9] FIG. 10 is a diagram illustrating an example of a process for reflecting data registration in a parent table of an RDB in a graph DB in an embodiment to which the present invention is applied. [Figure 10]FIG. 10 is a diagram illustrating an example of a process for reflecting data updates to a parent table of an RDB in a graph DB in an embodiment to which the present invention is applied. [Figure 11] FIG. 10 is a diagram illustrating an example of a process for reflecting data registration in a child table of an RDB in a graph DB in an embodiment to which the present invention is applied. [Figure 12] FIG. 10 is a diagram illustrating an example of a process for reflecting data deletion from a child table of an RDB in a graph DB in an embodiment to which the present invention is applied. [Figure 13] FIG. 10 is a diagram illustrating an example of a process for reflecting data registration in an intermediate table of an RDB in a graph DB in an embodiment to which the present invention is applied. [Figure 14] 10 is a diagram for explaining a process for measuring the speed at which data registration in a parent table is reflected in a graph DB. FIG. [Figure 15] 10 is a graph showing the relationship between the number of registered data items in a parent table in an RDB and the time it takes to reflect the data in a graph DB. [Figure 16] 10 is a table showing the relationship between the number of registered data items in a parent table in an RDB and the time it takes to reflect the data in a graph DB. [Figure 17] 10 is a diagram for explaining a process for measuring the speed at which data registration in a child table is reflected in a graph DB. FIG. [Figure 18] 10 is a graph showing the relationship between the number of registered data items in a child table in an RDB and the time it takes to reflect the data in a graph DB. [Figure 19] 10 is a table showing the relationship between the number of registered data items in a child table in an RDB and the time required for the data to be reflected in a graph DB. [Figure 20] FIG. 10 is a diagram for explaining the process of registering an edge from a user to a shop in the graph DB from a favorite shop table (intermediate table) in the RDB. [Figure 21] 10 is a graph showing the relationship between the number of data items registered in an intermediate table in an RDB and the time required for the data to be reflected in a graph DB. [Figure 22] 10 is a table showing the relationship between the number of data items registered in an intermediate table in an RDB and the time required for the data to be reflected in a graph DB. DETAILED DESCRIPTION OF THE INVENTION
[0018] An information processing device, an information processing method, and a program to which the present invention is applied will be described below with reference to the drawings.
[0019] (overview) FIG. 1 is a block diagram showing an example of an information processing system according to an embodiment of the present invention, FIG. 2 is a diagram showing an example of the relationship between elements to be processed by the information processing system, and FIG. 3 is a diagram showing an example of an RDB and a graph DB according to an embodiment of the present invention. An information processing system according to an embodiment of the present invention performs processes for registering, updating, and deleting favorite shop information, for example. The processing targets of the information processing system include elements such as users, areas, and shops. Each element can be added, modified, or deleted by the user of the information. Note that the elements may also include other elements.
[0020] The information processing system constructs a relational database and a graph database. Hereinafter, the relational database will be referred to as an RDB, and the graph database will be referred to as a graph DB. The information processing system of the embodiment uses, for example, at least one of the RDB and the graph DB to search for information desired by a user and present the search results to the user. The information processing system of the embodiment synchronizes the RDB and the graph DB in real time by updating the graph DB based on the processing results of the RDB in response to an update request received for the RDB.
[0021] (Configuration of information processing system) 1, the information processing system includes, for example, an information processing device 100, an RDB storage device 200, a graph DB storage device 300, and a user terminal device 400. The information processing device 100, the RDB storage device 200, the graph DB storage device 300, and the user terminal device 400 each have a communication interface (not shown) such as a NIC (Network Interface Card) or a wireless communication module.
[0022] The information processing device 100 includes, for example, an RDB processing unit 110, a graph DB processing unit 120, a real-time synchronization unit 130, and a control unit 140. The functional units such as the RDB processing unit 110, the graph DB processing unit 120, the real-time synchronization unit 130, and the control unit 140 are realized by a processor such as a CPU (Central Processing Unit) executing a program stored in a program memory. Furthermore, some or all of these functional units may be realized by hardware such as an LSI (Large Scale Integration), an ASIC (Application Specific Integrated Circuit), or an FPGA (Field-Programmable Gate Array), or may be realized by a combination of software and hardware.
[0023] The RDB processing unit 110 performs processing related to the RDB in the RDB storage device 200. Processing related to the RDB includes, for example, processing of registering records as RDB data, updating records, deleting records, etc. Processing related to the RDB includes processing of reading RDB data from the RDB storage device 200 during a search.
[0024] The graph DB processing unit 120 includes, for example, a node management unit 120a and an edge management unit 120b. The graph DB processing unit 120 executes processing related to the graph DB based on the graph data stored in the graph DB storage device 300. The processing related to the graph DB includes, for example, processing to add a graph node as graph data and processing to add an edge. The processing related to the graph DB includes synchronization processing to update the graph DB based on the update results of the RDB when an operation is performed on the RDB. The processing to update the graph DB includes, for example, processing to read graph data from the graph DB storage device 300 and to register, update, and delete the graph data. The processing related to the graph DB includes processing to read graph data from the graph DB storage device 300 when searching.
[0025] The real-time synchronization unit 130 performs synchronization processing to update the graph DB based on the update results of the RDB when the RDB is operated.
[0026] The control unit 140 comprehensively controls each unit in the information processing device 100. The control unit 140 performs processes such as accepting registration, update, and deletion queries from the user terminal device 400 and executing registration, update, and deletion, synchronizing the RDB and the graph DB when an operation is performed on the RDB, accepting search queries from the user terminal device 400 and executing a search, and transmitting search results to the user terminal device 400.
[0027] The RDB storage device 200 and the graph DB storage device 300 are realized by storage devices such as HDDs (Hard Disc Drives), flash memories, EEPROMs (Electrically Erasable Programmable Read Only Memory), ROMs (Read Only Memory), RAMs (Random Access Memory), etc. The RDB storage device 200 and the graph DB storage device 300 may be realized by SANs (Storage Area Networks) or NASs (Network Attached Storage), for example.
[0028] The RDB storage device 200 stores RDB data for constructing an RDB. Note that an RDB is an example of a table-format or key-value format database, and this embodiment can also be applied to table-format or key-value format databases other than an RDB.
[0029] The graph DB storage device 300 stores graph data for constructing a graph DB. The graph data includes node information and edge information. The node information is information including a label name (node name) and node properties. The properties of a graph node are information that identifies the graph node. Examples of information that identifies a graph node include the name, type, and location (address) of a shop. The edge information is information that identifies the relationship between graph nodes. In other words, the edge information is information that identifies the connection between graph nodes. The properties of an edge are, for example, the degree of relationship, weight, etc.
[0030] In this embodiment, a node in a graph database is also referred to as a graph node. In addition, in this embodiment, edge information may be simply referred to as an "edge," "relation," "relationship," or other terms used in the technical field.
[0031] The user terminal device 400 is, for example, a portable computer such as a personal computer or smartphone equipped with a display unit, an operation unit, a CPU, etc. The user terminal device 400 accepts a user's operation and transmits an RDB update request based on the user's operation to the information processing device 100. The RDB update request may be, for example, a process of specifying a favorite shop, but is not limited to this. It may also be a process of registering a new user, shop, or area, a process of specifying a favorite area or another user, or a process of specifying updating or deleting an element. The user terminal device 400 acquires a processing result in response to the update request and displays the processing result. The user terminal device 400 accepts a user's operation and transmits a search request specifying a search query based on the user's operation to the information processing device 100. The user terminal device 400 acquires a search result in response to the search request and displays the search result.
[0032] (Database description) The graph DB and RDB are explained below. The elements to be processed shown in FIG. 2 include user information, area information, and shop information. The user information is associated with the shop information. The shop information is associated with the area information. The user information, area information, and shop information are, for example, table data including records in an RDB. The tables include, for example, a user table, a favorites table, a shop table, and an area table, as shown in the upper diagram of FIG. 3. These tables are represented by user nodes, shop nodes, area nodes, and edges in the graph DB, as shown in the lower diagram of FIG. 3. The relationships between tables are represented as edges in the graph DB. The relationship between the RDB and the graph DB will be described in detail later.
[0033] (database processing) FIG. 4 is a block diagram for explaining processing for the RDB and the graph DB. The information processing device 100 includes an API (Application Programming Interface) processing unit 150 implemented by the control unit 140. The API processing unit 150 receives an RDB update request and information corresponding to the update request from the user terminal device 400, and registers the information corresponding to the update request in the RDB storage device 200. The information registered in the RDB storage device 200 is registered as master data in a table format or key-value format. The real-time synchronization unit 130 converts the master data registered in the RDB storage device 200, and the graph DB storage device 300 registers the converted master data as graph data including nodes and edges. This allows information held in the RDB to be registered in the graph DB. That is, the information processing device 100 registers the same information in the graph DB in the node and edge format and in the RDB in the key-value format. As a result, information is redundantly stored in different formats.
[0034] FIG. 5 is a block diagram of an RDB processing unit, real-time synchronization unit, and graph DB processing unit in an embodiment to which the present invention is applied. The RDB processing unit 110 includes, for example, an RDB storage device 200 and a logical replication function unit 112. The logical replication function unit 112 converts (decodes) master data stored in the RDB storage device 200 into logical-level data (hereinafter referred to as logical data). The logical replication function unit 112 operates, for example, in response to information indicating an operation on the RDB being supplied to the RDB processing unit 110. For example, when commands expressed as "INSERT_A," "INSERT_B," "INSERT_C," "INSERT_D," "INSERT_E," and "COMMIT" are supplied, the logical replication function unit 112 performs a conversion process for each command corresponding to the operation to generate logical data corresponding to each command and stores the logical data in the change data accumulation slot 112a. The logical replication function unit 112 supplies the logical data stored in the changed data accumulation slot 112a to the real-time synchronization unit 130. In the following description, RDB data changed based on user operations will also be referred to as changed data.
[0035] The real-time synchronization unit 130 includes, for example, a change data receiving unit 132, a format conversion unit 134, and multiple query generation units 136. The change data receiving unit 132 and the format conversion unit 134 process each change data supplied for each operation on the RDB. The change data receiving unit 132 receives change data from the logical replication function unit 112. The format conversion unit 134 converts the change data in a table format or key-value format into graph data in a format including nodes and edges. The format conversion unit 134 performs the conversion process by referring to mapping information stored in a mapping information storage device 138. The mapping information is information representing correspondences (mappings) based on definitions for converting the format from an RDB to a graph DB. The mapping information storage device 138 also functions as a management unit that manages the mapping information independently of the processing of the real-time synchronization unit 130. The query generation unit 136 generates a query corresponding to a node converted from the change data or a query corresponding to an edge converted from the change data. A query corresponding to a node corresponds to a command requesting registration, update, or deletion of a node in the graph DB. A query corresponding to an edge corresponds to a command requesting registration, update, or deletion of an edge in the graph DB. One of the multiple query generation units 136 generates a query corresponding to one node, and another query generation unit 136 generates a query corresponding to one edge. The multiple query generation units 136 generate queries corresponding to nodes and queries corresponding to edges in parallel, and supply the multiple queries in parallel to the graph DB processing unit 120.
[0036] The node management unit 120a receives a query corresponding to a node from the query generation unit 136, and registers, updates, or deletes the node according to the query. The edge management unit 120b receives a query corresponding to an edge from the query generation unit 136, and registers, updates, or deletes the edge according to the query. As a result, the graph DB processing unit 120 registers, updates, or deletes a node and registers, updates, or deletes an edge in parallel for each user operation on the RDB.
[0037] 6 is a block diagram of an RDB processing unit in an embodiment to which the present invention is applied. The RDB processing unit 110 includes an output plug-in 112b and a change data accumulation slot 112a. The output plug-in 112b is implemented by software that converts transaction logs output from the RDB storage device 200. The output plug-in 112b converts transaction logs 200B read from the RDB storage device 200 into logical data (change data) in a predetermined format (JSON format) and supplies the data to the change data accumulation slot 112a. The transaction log 200B is log data obtained by extracting data that has been changed based on user operations from the data stored in the RDB storage device 200, for example.
[0038] Note that existing logical replication functions are often used to extract logs contained in an RDB and supply them to other RDBs. The logical replication function unit 112 of the embodiment uses replication used between the RDBs to convert transaction logs 200B output from the RDB storage device 200 into logical data (change data) in a predetermined format (JSON format) using an output plug-in 112b, and can supply the change data to the change data receiving unit 132 in real time from a change data accumulation slot 112a.
[0039] FIG. 7 is a diagram showing the relationship between mapping patterns, RDB table types, and reflection processing to a graph DB in an embodiment to which the present invention is applied. The format conversion unit 134 performs conversion processing according to, for example, the mapping pattern shown in FIG. 7. If the type of table changed based on a user's operation is a parent table, the format conversion unit 134 creates only a node corresponding to the changed table. A parent table is a table that is not related to other tables. If the type of table changed based on a user's operation is a child table, the format conversion unit 134 creates nodes and edges corresponding to the changed table. A child table is a table that is related to other tables. If the type of table changed based on a user's operation is an intermediate table, the format conversion unit 134 creates only an edge corresponding to the changed table. An intermediate table is a table located between tables in a many-to-many relationship.
[0040] 8 is a diagram showing an example of synchronization processing from an RDB to a graph DB in an embodiment to which the present invention is applied. When data is registered in a user table, which is a parent table in the RDB, by a user operation, the format conversion unit 134 adds a user node to the graph DB according to mapping pattern 1. The properties of the user node are set as information corresponding to the "user ID and name" of the record included in the RDB. Similarly, when an area table, which is a parent table, is registered in the RDB, an area node is added to the graph DB according to mapping pattern 1.
[0041] When data is registered in a shop table, which is a child table in the RDB, by a user operation, the format conversion unit 134 adds a shop node to the graph DB and also adds an edge connecting the shop node and area node in accordance with mapping pattern 2. Although the edges in the embodiment do not have properties, this is not limiting, and information that identifies the edge, such as an area ID, may be set as a property.
[0042] When a favorite shop table, which is an intermediate table, is registered in the RDB by a user operation, the format conversion unit 134 adds an edge connecting the user node and the shop node in accordance with mapping pattern 3. The edge has, for example, a user ID and a shop ID as properties.
[0043] 9 is a diagram showing an example of a process for reflecting data registration in a parent table of an RDB in a graph DB in an embodiment to which the present invention is applied. For example, when a request to add the user name "Suzuki" of user ID "2" to the user table (table name: users) in the RDB storage device 200 is received by a user operation, the RDB processing unit 110 adds the user name "Suzuki" of user ID "2" to the user table in the RDB. The logical replication function unit 112 decodes the change data based on the data registration in the RDB into a predetermined format and supplies it to the real-time synchronization unit 130 via the change data accumulation slot 112a.
[0044] The real-time synchronization unit 130 receives change data expressed as, for example, “change data” in FIG. 9 . Upon receiving the change data, the real-time synchronization unit 130 references the mapping information for the parent table and generates a query for reflecting the change data in the graph DB. Specifically, the real-time synchronization unit 130 generates a node registration query for registering a node having a label corresponding to the table whose data is registered in the RDB and a user ID and user name corresponding to the user ID and user name whose data is registered in the RDB. The node registration query is expressed as, for example, “node registration query” in FIG. 9 . The real-time synchronization unit 130 outputs the generated node registration query to the graph DB storage device 300. As a result, the graph DB storage device 300 executes the node registration query to generate a node having a label of “Users” and a user ID of “2” with a user name of “Suzuki.” In this way, upon receiving a data registration request to a table in the RDB through a user operation, the information processing device 100 can execute a series of processes in real time, such as registering data in the RDB, converting the change data, and registering a node in the graph DB, for each user operation.
[0045] FIG. 10 is a diagram showing an example of a process for reflecting data updates to a parent table of an RDB in a graph DB in an embodiment to which the present invention is applied. For example, when a request is received from a user to update the user name "Tanaka" of the user ID "1" in the user table (table name: users) in the RDB storage device 200 to "Sato," the RDB processing unit 110 updates the user name of the user ID "1" in the user table in the RDB to "Sato." The logical replication function unit 112 decodes the change data based on the data update in the RDB into a predetermined format and supplies it to the real-time synchronization unit 130 via the change data accumulation slot 112a. Note that if the user's operation is a data update to the RDB, the value of the primary key of the updated record is also sent to the real-time synchronization unit 130.
[0046] The real-time synchronization unit 130 receives change data expressed, for example, as “change data” in FIG. 10 . Upon receiving the change data, the real-time synchronization unit 130 references the mapping information for the parent table and generates a query for reflecting the change data in the graph DB. Specifically, the real-time synchronization unit 130 generates a node update query for updating a node having a label corresponding to the table whose data has been updated in the RDB and the user ID of the record whose data has been updated in the RDB. The node update query is expressed, for example, as “node update query” in FIG. 10 . The real-time synchronization unit 130 outputs the generated node update query to the graph DB storage device 300. As a result, the graph DB storage device 300 executes the node update query to update the node by changing the label of “Users” and the username corresponding to the user ID 1 to “Sato.” In this way, the information processing device 100 can execute a series of processes in real time, such as updating data in the RDB, converting the change data, and updating nodes in the graph DB, for each user operation, in response to receiving a data update request for a table in the RDB due to a user operation. In the embodiment, an example of a process for reflecting data updates to a parent table of an RDB in a graph DB has been described, but the process for reflecting data updates to a child table or intermediate table of an RDB in a graph DB can be achieved by performing an update process on the nodes and edges corresponding to the child table and the edges corresponding to the intermediate table.
[0047] FIG. 11 is a diagram showing an example of a process for reflecting data registration in a child table of an RDB in a graph DB in an embodiment to which the present invention is applied. For example, when a user requests addition of a shop name "shopB" and an area ID "2" for shop ID "2" in a shop table (table name: shop) in the RDB storage device 200, the RDB processing unit 110 adds the shop name "shopB" and the area ID "2" for shop ID "2" in the shop table in the RDB. The area ID of the shop table is linked to the area ID of the area table. The logical replication function unit 112 decodes the change data based on the data registration in the RDB into a predetermined format and supplies it to the real-time synchronization unit 130 via the change data accumulation slot 112a.
[0048] The real-time synchronization unit 130 receives change data expressed, for example, as "change data" in FIG. 11. Upon receiving the change data, the real-time synchronization unit 130 references the mapping information for the child table and generates a node registration query for reflecting the change data in the graph DB. In parallel with this, the real-time synchronization unit 130 references the mapping information for the edge connecting the node corresponding to the shop table (child table) to the node corresponding to the area table (parent table) and generates an edge registration query. Specifically, the real-time synchronization unit 130 generates a node registration query for registering a node having a label corresponding to the table whose data is registered in the RDB and a shop ID and shop name corresponding to the shop ID and shop name whose data is registered in the RDB. In parallel with this, the real-time synchronization unit 130 generates an edge registration query whose start node is a shop node and whose end node is an area node. The node registration query is expressed, for example, as "node registration query" in FIG. 11, and the edge registration query is expressed, for example, as "edge registration query" in FIG. 11. The real-time synchronization unit 130 outputs the generated node registration query and edge registration query to the graph DB storage device 300. As a result, the graph DB storage device 300 executes the node registration query to register a shop node having a label of "shop" and properties of shop ID "2", shop name "shopB", and area ID "2" in the graph DB. In parallel with this, the graph DB storage device 300 executes an edge registration query to generate an edge connecting the shop node and the area node. In this way, in response to receiving a data registration request to a child table in the RDB through a user operation, the information processing device 100 can execute a series of processes in real time, such as registering data in the RDB, converting changed data, and registering nodes and edges in the graph DB, for each user operation.
[0049] 12 is a diagram showing an example of processing for reflecting data deletion from a child table of an RDB in a graph DB in an embodiment to which the present invention is applied. For example, when a request to delete shop ID "2" from a shop table (table name: shop) in the RDB storage device 200 is received by user operation, the RDB processing unit 110 deletes shop ID "2" from the user table in the RDB. The logical replication function unit 112 decodes change data based on the data deletion in the RDB into a predetermined format and supplies it to the real-time synchronization unit 130 via the change data accumulation slot 112a. Note that when the user operation is to delete data in the RDB, only the primary key of the deleted record is sent to the real-time synchronization unit 130.
[0050] The real-time synchronization unit 130 receives the change data, which is expressed as "change data" in FIG. 12, for example. Upon receiving the change data, the real-time synchronization unit 130 references the mapping information for the child table and generates a delete query for deleting nodes and edges from the graph DB. Specifically, the real-time synchronization unit 130 generates a delete query for deleting a node having a label corresponding to the table whose data was deleted in the RDB and the shop ID of the record whose data was deleted in the RDB. The delete query is expressed as "delete query" in FIG. 12, for example. The real-time synchronization unit 130 outputs the generated delete query to the graph DB storage device 300. As a result, the graph DB storage device 300 executes the delete query to delete the node corresponding to the deleted data in the RDB and the edge connected to the node. In this way, upon receiving a data deletion request for a table in the RDB through a user operation, the information processing device 100 can execute a series of processes in real time, such as deleting data from the RDB, converting the change data, and deleting nodes and edges in the graph DB, for each user operation. In the embodiment, an example of a process for reflecting data deletion from a child table of an RDB in a graph DB has been described, but the process for reflecting data deletion from a parent table or intermediate table of an RDB in a graph DB can be performed by performing a deletion process on the node corresponding to the parent table and the edge corresponding to the intermediate table.
[0051] 13 is a diagram showing an example of a process for reflecting data registration in an intermediate table in a graph DB in an embodiment to which the present invention is applied. For example, when a request is received from a user to add shop ID "2" of user ID "1" to the favorite shop table (table name: favorite_shop) in the RDB storage device 200, the RDB processing unit 110 adds user ID "1" and shop ID "2" to the favorite shop table. User ID "1" in the favorite shop table is linked to the user table, and shop ID "2" in the favorite shop table is associated with the shop table. The logical replication function unit 112 decodes the change data based on the data registration in the intermediate table into a predetermined format and supplies it to the real-time synchronization unit 130 via the change data accumulation slot 112a.
[0052] The real-time synchronization unit 130 receives the change data, which is expressed as, for example, "change data" in FIG. 13. Upon receiving the change data, the real-time synchronization unit 130 references the mapping information for the intermediate table and generates an edge registration query for registering an edge connecting from the start node (label name: Users) to the end node (label name: Shop). The edge registration query is expressed as, for example, "edge registration query" in FIG. 13. The real-time synchronization unit 130 outputs the generated edge registration query to the graph DB storage device 300. As a result, the graph DB storage device 300 executes the edge registration query to register an edge with a direction from a node with a label name of Users and a user ID of "1" to a node with a label name of shop and a shop ID of "2." In this way, upon receiving a data registration request to an intermediate table in the RDB through a user operation, the information processing device 100 can execute a series of processes in real time, such as registering data in the RDB, converting the change data, and registering an edge in the graph DB, for each user operation.
[0053] Below, we will explain the speed when synchronizing the RDB and graph DB in real time.
[0054] Fig. 14 is a diagram explaining the process of measuring the speed at which data registration in a parent table in an RDB is reflected in a graph DB, Fig. 15 is a graph showing the relationship between the number of data items registered in a parent table in the RDB and the time it takes to reflect the data in the graph DB, and Fig. 16 is a table showing the relationship between the number of data items registered in a parent table in the RDB and the time it takes to reflect the data in the graph DB. As shown in Fig. 14, area data was gradually increased in the area table (parent table) of the RDB from 1 record to 2560 records, and finally committed, and an area node was registered in the graph DB for each area data item registered in the RDB, and the time it took for the area nodes corresponding to all the area data to be registered was measured. As a result, the reflection time versus the number of data items registered in the RDB was as shown in Figs. 15 and 16.
[0055] Fig. 17 is a diagram explaining the process of measuring the speed at which data registration in a child table in an RDB is reflected in a graph DB. Fig. 18 is a graph showing the relationship between the number of data items registered in a child table in the RDB and the time it takes to reflect the data in the graph DB. Fig. 19 is a table showing the relationship between the number of data items registered in a child table in the RDB and the time it takes to reflect the data in the graph DB. As shown in Fig. 17, with area data in the RDB and area nodes in the graph DB already existing, shop data was added to the shop table (child table) in the RDB from 1 record to 2,560 records, and finally committed. For each piece of shop data registered in the RDB, a shop node and an edge connecting the shop node to the area node were registered in the graph DB, and the time it took for the shop nodes and edges corresponding to all the shop data to be registered was measured. As a result, the reflection time versus the number of data items registered in the RDB was as shown in Figs. 18 and 19.
[0056] FIG. 20 is a diagram for explaining the process of measuring the speed at which data registration in an intermediate table in an RDB is reflected in a graph DB. FIG. 21 is a graph showing the relationship between the number of data items registered in the intermediate table in the RDB and the time required to reflect the data in the graph DB. FIG. 22 is a table showing the relationship between the number of data items registered in the intermediate table in the RDB and the time required to reflect the data in the graph DB. As shown in FIG. 20, in a state where shop data in the RDB and shop nodes in the graph DB, area data in the RDB and area nodes in the graph DB, user data in the RDB and user nodes in the graph DB already existed, the favorite shop table (intermediate table) was gradually increased from 1 record to 2,560 records and finally committed. For each favorite shop data item registered in the RDB, edges connecting the user node and shop node were registered in the graph DB, and the time required for edges corresponding to all favorite shops to be registered was measured. As a result, the reflection times for the number of data items registered in the RDB were as shown in FIGS. 21 and 22.
[0057] As explained above, the speed of real-time synchronization between the RDB and graph DB is such that, in all patterns, data can be reflected (synchronized) from the RDB to the graph DB within one second if the number of data items registered in the RDB is up to 1,280. Furthermore, in all patterns, data can be reflected (synchronized) from the RDB to the graph DB in about one second even if the number of data items registered in the RDB is 2,560. Furthermore, it can be seen that the data reflection speed tends to slow down in proportion to an increase in the amount of data, but this trend is gradual. Furthermore, when the number of data items registered in the RDB is small, the reflection speed is thought to be unstable due to the large influence of factors other than the reflection process from the RDB to the graph DB.
[0058] (Effects of the embodiment) The information processing device 100 of the embodiment described above can realize an information processing device including a graph DB processing unit 120 (first database processing unit) that executes node and / or edge update processing for a graph database including nodes and edges between the nodes, an RDB processing unit 110 (second database processing unit) that executes processing for a relational database (a tabular or key-value format database), a control unit 140 (reception unit) that receives an update request for the relational database, and a real-time synchronization unit 130 (synchronization unit) that supplies a query to the first database processing unit to update the graph database based on the processing result by the second database each time the reception unit receives an update request. According to the information processing device 100 of the embodiment, information can be synchronized in real time between the relational database and the graph database each time the reception unit receives an update request.
[0059] It is also possible to consider a method in which a function (application) that writes data to an RDB simultaneously writes data to a graph DB. However, if data cannot be written to the graph DB due to a downtime or other reason, the transaction will not be completed, which will have a significant impact on operations related to the information processing device 100. In contrast, the information processing device 100 of the embodiment provides a stable system by separating writing to the graph DB from the data writing function of the RDB. Furthermore, by completing a transaction solely by writing to the RDB, a quick response can be returned to the user without waiting for successful writing to the graph DB. Furthermore, if a graph DB is to be added to a system that uses an RDB, since the function for writing to the graph DB is independent of the RDB, a hybrid system of an RDB and a graph DB can be easily constructed by simply adding a real-time synchronization unit 130 without modifying the existing RDB writing function.
[0060] Furthermore, according to the information processing device 100 of the embodiment, the real-time synchronization unit 130 can refer to mapping information between the relational database and the graph database each time an update request is received by the reception unit, and convert the processing results by the RDB processing unit 110 into processing on nodes and / or edges by the graph DB processing unit 120.
[0061] Furthermore, according to the information processing device 100 of the embodiment, the real-time synchronization unit 130 can supply queries for nodes and edges in parallel to the graph DB processing unit 120 in response to update information corresponding to an update request, and the graph DB processing unit 120 can execute node-related processing and edge-related processing in parallel. In the information processing device 100 of the embodiment, when performing data operations (registration, update, deletion) on the RDB, it is necessary to operate not only nodes but also edges in the graph DB. When a large amount of data is operated on in the RDB, processing the operated data one by one serially would result in processing delays, so the data can be written to the graph DB using multi-threaded parallel processing.
[0062] Furthermore, according to the information processing device 100 of the embodiment, the RDB processing unit 110 can convert update information using a logical replication function and supply the converted update information to the real-time synchronization unit 130, and the logical replication function can be used to output information from the RDB to the graph DB. According to the information processing device 100 of the embodiment, real-time synchronization between the RDB and the graph DB can be achieved by immediately obtaining change data from a change data accumulation slot used when replicating the RDB, rather than periodically obtaining data written to the RDB. In other words, the real-time synchronization unit 130 can receive change data stored in the change data accumulation slot, one record at a time, in order via message communication and perform processing to generate a query to be supplied to the graph DB.
[0063] Furthermore, the information processing device 100 of the embodiment further includes a management unit that manages mapping information independently of the operation of the real-time synchronization unit 130, and therefore holds definition information as an external file on how to map RDB data and reflect it in the graph DB. As a result, the information processing device 100 can flexibly synchronize RDB data with the graph DB simply by changing the mapping file, without changing the program in the real-time synchronization unit 130.
[0064] Furthermore, according to the information processing device 100 of the embodiment, when the update request is information requesting data registration in a parent table in a relational database, the real-time synchronization unit 130 generates a query to register a node based on the update request requesting data registration in the parent table; when the update request is information requesting data update in a parent table in the relational database, the real-time synchronization unit 130 generates a query to update a node based on the update request requesting data update in the parent table; when the update request is information requesting data registration in a child table in the relational database, the real-time synchronization unit 130 generates a query to register a node and an edge based on the update request requesting data registration in the child table; when the update request is information requesting data deletion from a child table in the relational database, the real-time synchronization unit 130 generates a query to delete a node and an edge based on the update request requesting data deletion from the child table; and when the update request is information requesting data registration in an intermediate table in the relational database, the real-time synchronization unit 130 generates a query to register an edge based on the update request requesting data registration in the intermediate table. As a result, the information processing device 100 can execute different operations depending on the tables in the RDB, and can reflect updates to the RDB in the graph DB.
[0065] Although each embodiment and variant has been described, these are merely examples and are not intended to be limiting. For example, one aspect of the present invention may be realized by combining any of the embodiments or variants, or a part of each embodiment or a part of each variant, with one or more other embodiments or one or more other variants.
[0066] In addition, the various processes described above related to the information processing device 100 may be performed by recording a program for executing each process of the information processing device 100 in this embodiment on a computer-readable recording medium, and reading and executing the program recorded on the recording medium into a computer system.
[0067] Note that the term "computer system" here may include hardware such as the OS and peripheral devices. Furthermore, if a WWW system is used, the term "computer system" also includes the homepage provision environment (or display environment). Furthermore, "computer-readable recording media" refers to storage devices such as flexible disks, magneto-optical disks, ROMs, and writable non-volatile memory such as flash memory, portable media such as CD-ROMs, and hard disks built into computer systems.
[0068] Furthermore, "computer-readable recording medium" refers to the volatile memory (e.g., DRAM (Dynamic Random Access Memory)) within a computer system that acts as a server or client when a program is transmitted via a network such as the Internet or a communication line such as a telephone line. This also includes devices that hold a program for a certain period of time, such as a random access memory (Random Access Memory). The program may also be transmitted from a computer system that stores the program in a storage device to another computer system via a transmission medium or by transmission waves in the transmission medium.
[0069] Here, the "transmission medium" for transmitting the program refers to a medium that has the function of transmitting information, such as a network (communication network) such as the Internet or a communication line (communication line) such as a telephone line. The program may also be one that realizes part of the above-mentioned functions. Furthermore, it may be a so-called differential file (differential program) that can realize the above-mentioned functions in combination with a program already recorded in a computer system.
[0070] Although the embodiments of the present invention have been described in detail above with reference to the drawings, the specific configuration is not limited to this embodiment, and the present invention also includes designs within the scope of the gist of the present invention. [Explanation of symbols]
[0071] 100 Information processing device 110 RDB processing section 112 Logical Replication Function Unit 112a Change data storage slot 112b Output Plugin 120 Graph DB processing unit 120a Node management unit 120b Edge Management Unit 130 Real-time synchronization section 132 Change data receiver 134 Format Conversion Unit 136 Query Generation Unit 140 Control Unit 150 API processing section 200 RDB storage 300 Graph DB storage device 400 User terminal device
Claims
1. a first database processing unit that executes an update process for the nodes and / or the edges in a graph database including the nodes and the edges between the nodes; a second database processing unit that executes processing on a table-format or key-value-format database; a reception unit that receives an update request for the table format or key-value format database; a synchronization unit that supplies a query to the first database processing unit to update the graph database based on a processing result by the second database processing unit every time the reception unit receives an update request, The synchronization unit Refer to mapping information between the table format or key-value format database and the graph database; If the type of table that has received the update request for data registration is a parent table that is a table that is not related to other tables, only a node corresponding to the data to be registered in the parent table is created; If the type of table that has received the update request requesting data registration is a child table that is a table related to another table, create a node corresponding to the data to be registered in the child table and an edge connecting the node to another node that is related by the data to be registered in the child table; If the type of the table for which the update request for registering data has been received is an intermediate table, which is a table located between tables, only edges connecting nodes associated with each other by the data registered in the intermediate table are created. Information processing device.
2. 2. The information processing device according to claim 1, wherein the synchronization unit supplies a query for the node and a query for the edge in parallel to the first database processing unit in response to a processing result by the second database processing unit corresponding to the update request.
3. the second database processing unit converts a processing result by the second database processing unit using a logical replication function, and supplies the converted update information to the synchronization unit; 3. The information processing device according to claim 1.
4. The information processing device according to claim 1 , further comprising a management unit that manages the mapping information independently of the operation of the synchronization unit.
5. when the update request is information requesting data registration in a table in the tabular or key-value database, the synchronization unit generates a query to register the node and / or the edge corresponding to the table based on the update request requesting data registration in the table; when the update request is information requesting a data update for a table in the tabular or key-value database, the synchronization unit generates a query to update the node and / or the edge corresponding to the table based on the update request requesting a data update for the table; When the update request is information requesting deletion of data from a table in the tabular or key-value database, the synchronization unit generates a query to delete the node and / or the edge corresponding to the table based on the update request requesting data deletion from the table. The information processing device according to claim 1 .
6. The computer receiving an update request for a table-format or key-value-format database; executing a process on the table-format or key-value-format database based on the update request; generating a query for updating a graph database including nodes and edges between the nodes based on a processing result of the table-format or key-value-format database each time the update request is received; performing an update operation on the nodes and / or edges on the graph database based on the query; Run The step of executing the update process includes: referencing mapping information between the table format or key-value format database and the graph database; a step of creating only a node corresponding to data to be registered in a parent table when the type of the table for which an update request for data registration has been received is a parent table that is a table not related to other tables; a step of creating a node corresponding to the data to be registered in the child table and an edge connecting the node to another node associated with the data to be registered in the child table, when the type of the table for which the update request requesting data registration has been received is a child table that is a table related to another table; creating only edges connecting nodes associated with each other by data to be registered in the intermediate table when the type of the table for which the update request requesting data registration has been received is an intermediate table that is a table located between tables; An information processing method, including:
7. On the computer, receiving an update request for a table-format or key-value-format database; executing a process on the table-format or key-value-format database based on the update request; generating a query for updating a graph database including nodes and edges between the nodes based on a processing result of the table-format or key-value-format database each time the update request is received; and performing an update operation on the nodes and / or edges on the graph database based on the query; The step of executing the update process includes: referencing mapping information between the table format or key-value format database and the graph database; a step of creating only a node corresponding to data to be registered in a parent table when the type of the table for which an update request for data registration has been received is a parent table that is a table not related to other tables; a step of creating a node corresponding to the data to be registered in the child table and an edge connecting the node to another node associated with the data to be registered in the child table, when the type of the table for which the update request requesting data registration has been received is a child table that is a table related to another table; and if the type of table that has received the update request requesting data registration is an intermediate table, which is a table located between tables, creating only edges that connect nodes that are associated by the data to be registered in the intermediate table.
Citation Information
Patent Citations
Query mediator, method of querying polyglot data tier and computer program executable to implement method of querying polyglot data tier
JP2016207202A
Replication program
JP2017027349A
Information processing device, extraction method, and program
JP2020161088A
Information processing device, information processing method, and program
JP2020161089A
Graph database and relational database mapping
US20200201909A1