title: Is it a good idea to use MySQL and Neo4j together?
body: <p>I will make an application with a lot of similar items (millions), and I would like to store them in a MySQL database, because I would like to do a lot of statistics and search on specific values for specific columns.</p>
  
  <p>But at the same time, I will store relations between all the items, that are related in many connected binary-tree-like structures (transitive closure), and relation databases are not good at that kind of structures, so I would like to store all relations in Neo4j which have good performance for this kind of data.</p>
  
  <p>My plan is to have all data except the relations in the MySQL database and all relations with <code>item_id</code> stored in the Neo4j database. When I want to lookup a tree, I first search the Neo4j for all the <code>item_id</code>:s in the tree, then I search the MySQL-database for all the specified items in a query that would look like:</p>
  
  <p><code>SELECT * FROM items WHERE item_id = 45 OR item_id = 345435 OR item_id = 343 OR item_id = 78 OR item_id = 4522 OR item_id = 676 OR item_id = 443 OR item_id = 4255 OR item_id = 4345</code></p>
  
  <p><b>Is this a good idea, or am I very wrong?</b> I haven't used graph-databases before. Are there any better approaches to my problem? How would the MySQL-query perform in this case?</p>