Hi team. I'm trying to model a graph in Nebula and...
# nebula-users
s
Hi team. I'm trying to model a graph in Nebula and currently stuck in modelling a hypergraph. The problem I'm dealing with is something similar to this question (https://stackoverflow.com/questions/61395285/graphdb-node-as-a-property-of-a-relationship) There are two answers here. 1. First answer suggests to break the hypergraph by introducing an intermediatory node 2. Second one suggests to add an edge property With respect to the Nebula Graph, which approach would be better here (Considering the performance for large datasets and scalability)
❤️ 1
w
great topic, Sandeep! I think it depends on your query pattern. The recommended way to decide between modeling methods is to list all query patterns your system will do, and see their costs in the GraphDB. i.e.
to find everyone who likes a particular store
• in intermediate node approach will be:
start from store vid, expand via at_store reversely, expand via likes reversely
• in another approach will be:
start from store vid, expand via sells, expand via likes reversely
The cost of the two are basically the same.
find which store's apples Angela likes
, the 2nd approach is cheaper as only one-hop traversal is needed, especially in NebulaGraph
find how many groceries that Angela likes at Walmart
, ditto So I would suggest listing all query patterns your system cares first. :)
❤️ 1
s
Oh Okay! Thanks @wey :)
❤️ 1