Updated on 2022-09-14 GMT+08:00

Rules

The token validity period in REST API authentication is 20 minutes by default, and can be customized

The token validity period in REST API authentication is 20 minutes. If the token is not used to interact with the server within 20 minutes, the token becomes invalid. To ensure the validity of the token, the invoker must interact with the server within 20 minutes using the token or obtain a new token after the token expires.

The token period can be customized in the GraphBase configuration interface to search for "graphserver.session.timeout" to set custom values.

Proper Index Design

A proper index mechanism has a great impact on data query, especially in full graph query scenarios. The index design must be designed based on service query requirements. If no valid index is designed, all data in the entire graph may be forcibly scanned during data query, resulting in low query performance and even request timeout.

Typical application scenarios of indexes are as follows:

  • Query an entity with a same property value (string or numeric type) as the specified one.

    For a large graph, if the service requires a query for entities that have the same property value with a specified property value, create indexes for the property (composite or mixed index) first. Otherwise, you need to perform a full graph query for the entities with the same property value as specified by the service in GraphBase, and perform full graph scan, which may cause query timeout.

  • Query an entity by comparing property values (numeric type) with a specified one.

    In the case of a large graph, if the service requires the query of entities by comparing property values with a specified one, you need to create mixed indexes for the property first. You can use this property index to efficiently lock the database entity objects that meet the query conditions.

  • Full-text Search by Condition
  • Currently, only mixed indexes support full-text search in GraphBase. For queries similar to the following one, create mixed indexes:

    Perform full graph query to query the entity with a particular area or qualifier (such as Xi'an or BEIDAJIE) contained in the value of the address property.

Supplementary Indexes

If no index is created for a specified property at first but new indexes need to be created for the property after the property data is saved, the newly added indexes are supplementary indexes. This process involves recreating indexes.

After an index is created, index data is not automatically updated for the data imported previously. In this case, the user needs to invoke the interface for recreating an index to initiate an index data update.

Using the API for Deleting a Graph Cautiously

The interface for deleting a graph not only deletes the definition of the graph, but deletes all the data in the graph. Before invoking this API, ensure that the data is no longer used.

User Rights Description

Users who log in to GraphBase must have the permissions of the graphbaseadmin, graphbaseoperator, or graphbasedeveloper user group.

Client Currency

The load sharing between multiple GraphServer in GraphBase is based on the HTTP session mode. Multiple requests of the same HTTP session are sent to the same GraphServer for processing. Therefore, in the high concurrency scenario, the client code should use multiple HTTP clients to share loading using multiple GraphServers and to increase the number of concurrent requests.

has Usage Specifications in Gremlin Graph Query

  1. Query the information about a vertex with a specified vertex label.
    gremlin> g.V().hasLabel('person')

    This query requires full graph query for vertices. If the number of vertices meeting this search condition is large or the graph is large, the query times out.

    It is recommended that the output be limited.

    gremlin> g.V().hasLabel('person').limit(10)
  1. Perform full graph query for vertices using specified property conditions.
    gremlin> g.V().has('key', 'value')

    This query requires full graph query for vertices. If a large graph is accessed and no index is created for the property key, the query times out.

    To sum up, exercise caution when performing full graph query.