1
votes

In graph database, namely Titan, I store various data. Some of them tend to create large data sets (10000's), but can be modelled as a Map.

Should I store these maps in vertex properties, using their key:value as key:value of the map, or rather model them using edge labels (as keys) and vertices' labels (or property entries) as values?

I.e.

Vertex { prop1: val1
         prop2: val2 }

versus

Vertex ----- [prop1] -------> Vertex [val1]
       \-----[prop2] -------> Vertex [val2]
1

1 Answers

1
votes

It is generally advised to model your data with Titan schema properties. Typically, the more you can tell Titan about your schema the better it will perform and the more Titan features you can take advantage of. If you store all of your properties in a single property containing a Map, those properties can't be indexed, writing to certain graph formats like GraphML and GML won't be supported, your gremlin won't be quite as fluid because you'll be getting a Map of a Map from a vertex/edge, etc.