Graph Compute allows you to develop graph models based on tables that support multiple types of indexes, including Pkey-value tables, Pkey-Skey-value tables, and index tables.
Graph Edit page
Publish: You can publish a graph model and its configurations. Data backflow is performed based on the published graph. A version is created each time you publish a graph model.
Add Node and Add Edge: You can create, delete, and modify vertices and edges.
Reset: You can zoom in or zoom out on the graph and adjust the viewing angle of the canvas.
Create a vertex
Step 1: Go to the Graph Edit page of a graph. Click Add Node in the upper part of the page.
Step 2: In the Add Data Configuration (Node) panel, enter a vertex name.
Step 3: Configure parameters for the vertex and add at least two fields. Then, click Submit. A vertex is created.
Create an edge
You can use one of the methods in Step 1.
Step 1: Create an edge.
Recommended. Right-click an existing vertex on the canvas and select Add Edge.
Step 2: In the Add Data Configuration (Edge) panel, enter an edge name.
Step 3: Configure parameters for the edge and add at least three fields. Then, click Submit. An edge is created.
Configure data
Click a vertex or an edge on the canvas to open the data configuration panel.
Basic information
NodeName or EdgeName: the name of the selected vertex or edge.
Data Source: the data source of the vertex or edge. Valid values:
API Update: incremental data update.
All data is imported from SWIFT MSMQ. After data backflow, the online system consumes messages in real time to ensure real-time data updates.
Mechanism: During data backflow, data is pulled from SWIFT to build indexes, and the index building task remains in the running state to periodically pull updated messages to build indexes of incremental versions. During this process, the online system consumes the updated messages in real time.
Take note of the following items:
A time-to-live (TTL) period is specified for the data imported from a table whose data source is SWIFT. After the specified TTL period expires, the imported data becomes invalid.
We recommend that you set the TTL period to no more than seven days. Otherwise, index building may time out and errors may occur. You can specify the TTL period based on your business requirements. If the number of update queries per second (QPS) exceeds 1,000, we recommend that you set the TTL period to no more than three days. Alternatively, you can set the Data Source parameter to MaxCompute Data Source and API Update.
The storage engine does not support persistent storage. If indexes are unavailable because the index file is damaged or exceptions occur during data writing, you must perform incremental update on all data based on your business requirements.
MaxCompute Data Source: full data update.
All data is imported from MaxCompute. During data backflow, full data update is performed on online data. Data is pulled from MaxCompute to build indexes.
Take note of the following items:
The data of a new backflow replaces that of the previous backflow.
At least one data record is generated in the corresponding partition in MaxCompute.
Online data must correspond to an existing MaxCompute partition. Otherwise, the accuracy of online data is affected.
No TTL period is specified for the data imported from a table whose data source is MaxCompute.
MaxCompute Data Source and API Update: full data update and incremental data update.
This is the combination of the preceding two data sources. Data is pulled from MaxCompute and SWIFT to build indexes. A data source of this type integrates the features of MaxCompute and SWIFT data sources. If you select this data source type, indexes of incremental versions can also be built during full data update, and the online system updates messages in real time.
Take note of the following items:
Full data backflow must be periodically performed. The full data of a new backflow contains the incremental data of the previous backflow. The following risks may arise if data backflow is not periodically performed:
SWIFT MSMQ stores data only for a period of time, such as seven days. If no MaxCompute partitions are generated to perform full data backflow for an extended period of time, some real-time data may be lost during the next full data backflow.
If you retrieve real-time data for many days, index building may time out. Therefore, periodical data backflow is required.
No TTL period is specified for the data imported from a source table of this data source type.
When you trigger data backflow for a MaxCompute partition, you must specify the start timestamp at which incremental data is retrieved. This timestamp indicates the time when MaxCompute starts to process incremental data.
Index types and field structures
Index Type: the type of index. Valid values:
KV: You must specify a primary key field. At least two fields must be added.
KKV: You must specify a start field and an end field. At least three fields must be added.
Inverted INDEX: You must configure index fields and specify a primary key field.
Field Structure:
The filed attributes of the source table.
Import fields:
If fields are imported from a MaxCompute data source, you must grant the read permissions on the source table to Graph Compute in advance.
Data TTL and .done partitions
Data TTL: the lifecycle of data.
If you import data by calling API operations, you must specify a TTL period for the imported data. We recommend that you set the TTL period to no more than seven days. Otherwise, index building may time out and errors may occur. If the number of update QPS exceeds 1,000, we recommend that you set the TTL period to no more than three days.
Scan DONE Partition: specifies whether to scan .done partitions.
If you turn on the switch, a .done partition is also created after you create a partition. Ali Basic Feature Server (ABFS) can detect the .done partition that you create for the partition on which data backflow can be performed.
If you turn off the switch, a message can be sent to notify Graph Compute after you create a partition. The message indicates that data backflow can be performed on the partition.
View graph information
Versions
The basic information of a graph model includes the publishing status, current version, valid online version, and historical versions.
Version switching: You can switch the version of a graph model. After the version of a graph model is changed, the configurations of the current version take effect for the graph model. If you want to modify the configurations and make the modified configurations take effect, you must click Publish.
Graph information
The name and description of a graph are displayed. Only the graph description can be modified.