I have a problem in which I need to perform CRUD operations on cyclic graphs. Now I know that there are a bunch of graph databases out there, but I have a specific set of use cases which are not supported in those databases (or at least I'm not aware of them).
Following are my constructs:
- Node: Can have multiple sources and targets
- Directed edge: Connects two nodes
- Node Group: Multiple nodes (connected with edges) forming a group (simply put, it's a smaller graph)
- Directed graph: Comprises of multiple nodes, node groups and edges. The graph can be cyclic.
Following are the functionalities I can have:
- I can simply create a node by defining the incoming and outgoing edge definitions.
- I can create a simple graph by adding nodes and connecting them with edges.
- I can perform standard graph traversals.
- I can now group the nodes of a graph and call it as a Node Group which I can use multiple instances of this Node Group (just like a node) in another bigger graph. This can create complex hierarchies.
- I can create multiple graphs which in turn use any of the above constructs.
- I can make changes to Node and Node Group definitions, which means there can be structural changes to the graph. If I make changes to a Node or Node Group definition, all the instances of this node in all the graphs should be updated too.
Now I understand that all of this can be done best with a relational database which will ensure that the relationships are intact and querying is simple. But the performance will take a hit when there are complex graphs and multiple of those graphs are to be updated.
So, I was wondering if there is a hybrid/better approach to storing, retrieving and updating these graphs that would be much faster compared to relational databases.
Any ideas would be really helpful. Thanks in advance!