Storage of BLOB objects?

As far as I can see, Memgraph only supports the storage of a small number of data types (strings, integers etc.). Is there any way the database could allow nodes to store binary objects? I realise that graph databases are not the most appropriate type of storage for large binary objects (in contrast to e.g.key-value stores), but this would be very handy to have the possibility to associate some nodes/properties with binary content.

In particular, as far as I can see, there is no straightforward way to associate numeric vectors (encoded in NumPy arrays or Pytorch tensors) to nodes properties, which makes it more difficult to apply graph neural networks (since there is no way to store embeddings in the database itself). Right now, I’m solving this problem by creating a separate key-value store for those binary objects (with unique identifiers for each binary object that cannot be inserted in the graph DB itself), but that’s not very elegant.

2 Likes

@plison, yes, good points! Memgraph started going in a similar direction with this add property database interface by MasterMedo · Pull Request #58 · memgraph/gqlalchemy · GitHub (storing properties on disk, instead of SQLite there could DuckDB or something more appropriate to store “vector” data). → Maybe an alternative to the key-value store you mentioned :smiley:

Could you please be a bit more specific with the exact requirements/environment/etc?

1 Like

I guess the easiest for us would be to allow node/edge properties to have values with binary content in addition to the generic data types, like BLOB in SQL databases. For our use case, the binary content would typically not be very large, as it would mostly consist of numeric vectors (at most a few KB in size for each). So I don’t think it should be necessary to have on-disk storage for us.