Suppose I have a set of directed graphs. I need to query those graphs. I would like to get a feeling for my best choice for the graph modeling task. So far I have these options, but please don’t hesitate to suggest others:
-
Proprietary implementation (matrix)
and graph traversal algorithms. -
RDBM and SQL option (too space consuming)
-
RDF and SPARQL option (too slow)
What would you guys suggest? Regards.
EDIT: Just to answer Mad’s questions:
-
Each one is relatively small, no more than 200 vertices, 400 edges. However, there are hundreds of them.
-
Frequency of querying: hard to say, it’s an experimental system.
-
Speed: not real time, but practical, say 4-5 seconds tops.
You didn’t give us enough information to respond with a well thought out answer. For example: what size are these graphs? With what frequencies do you expect to query these graphs? Do you need real-time response to these queries? More information on what your application is for, what is your purpose, will be helpful.
Anyway, to counter the usual responses that suppose SQL-based DBMSes are unable to handle graphs structures effectively, I will give some references:
They used PostgreSQL as DBMS, which is probably not particularly good at this kind of applications. You can try LucidDB and see if it is better, as I suspect.
Edit: you give more details so… I think the best way is to experiment a little with both a main-memory dedicated graph library and with a DBMS-based solution, then evaluate carefully pros and cons of both solutions.
For example: a DBMS need to be installed (if you don’t use an “embeddable” DBMS like SQLite), only you know if/where your application needs to be deployed and what your users are. On the other hand, a DBMS gives you immediate benefits, like persistence (I don’t know what support graph libraries gives for persisting their graphs), transactions management and countless other. Are these relevant for your application? Again, only you know.