CPC G06F 16/9024 (2019.01) [G06F 16/9027 (2019.01)] | 17 Claims |
1. A data processing method for a graph database, wherein the method comprises:
receiving a writing request for first target graph data, wherein the first target graph data comprises nodes and edges, and edge types of the edges are used for characterizing relationship types between nodes associated with the edges;
determining a balanced B-tree corresponding to each node in the first target graph data, storing graph data of at least one edge type corresponding to each node into a leaf node of a B-tree, and storing index information of the leaf node into an internal node corresponding to the leaf node in the B-tree, wherein index information of the B-tree is stored at a root node of the B-tree, and the index information of the B-tree is determined based on a node identifier of the node corresponding to the B-tree and the at least one edge type corresponding to the B-tree; and
determining, in a key-value store system, a key-value pair corresponding to each node in the B-tree, persistently storing an index key in the index information of each node into a key of the corresponding key-value pair, and persistently storing the graph data or the index information stored in each node into a key of the corresponding key-value pair, wherein the key-value store system is configured to persistently store the graph data;
wherein before determining a B-tree corresponding to each node in the first target graph data, the method further comprises:
generating log information corresponding to the writing request wherein the log information is used for recording operation information of the writing request;
storing the log information corresponding to the writing request into the key-value store system; and
in response to determine that a B-tree corresponding to the log information meets a preset first playback condition and/or an idle state of a current system meets a preset second playback condition, obtaining the log information from the key-value store system; and
determining a B-tree corresponding to each node in the first target graph data respectively comprises:
determining, based on the operation information of the writing request that is recorded in the log information, the B-tree corresponding to each node in the first target graph data corresponding to the operation information.
|