Graph Synchronizer

The GraphSynchronizer serves as a core component of the graph management system, bridging the gap between transient in-memory graph structures and their corresponding persistent storage representations. Its central function revolves around ensuring each node in a provided graph is correctly reflected in the storage system.

Graph Synchronization

The process begins when a graph is handed over to the GraphSynchronizer. For each node in this graph, GraphSynchronizer leverages the NodeIdentificatorsProvider to ascertain the existence of a corresponding node within the persistent storage. These identifiers are customizable and specific to each node type, giving you the flexibility to define them as required.

Once a node's existence is determined, the GraphSynchronizer takes one of two actions:

  1. Node Merging: If the node already exists in the storage, the new node and the existing one are merged. During this merging process, several default operations are carried out:

    • Attribute Merging: If the new node introduces attributes that are not present in the existing node, these are added to the stored node, ensuring it is up-to-date.

    • Node De-duplication: If multiple nodes in the new graph share the same identifier, these are consolidated into a single node in the storage, preventing redundancy and promoting efficiency.

    • Edge Merging: In the case of duplicate nodes with edges, the edges are also merged appropriately during the node merging process.

  2. Node Creation: If the node does not exist in the storage, the new node is added to the persistent storage as is.