Alex Rivera | Logout

Is storing graphs in MySQL a good idea?

Asked 2011-03-06T09:01:18.257
10

I am using MySQL to store reports from a tool. I am extremely happy with the speed and flexibility with which users can query data. The tool also has some data which is a graph. My question is, is it a good idea to store the graph in MySQL? The number of nodes and edges in the graph is in the millions and queries are usually graph traversals.

Edit
Report

2 Answers

5

MySQL is not created and optimized as a graph database in particular. You might want to try Neo4J which is a good graph database.

answered 2011-03-06T10:51:31.600
4

Plain SQL is usually unfit for manipulating a graph datastructure. There are techniques to index it, however.

For instance, if yours is not frequently updated, using a GRIPP index will let you handle graph traversal queries extremely well. The latter lets you answer parent-child and depth-related queries in more or less fixed time -- irrespective of the graph's number of nodes or density of links.

answered 2011-05-29T11:34:52.437

Your Answer