Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Graph DBs work if you know your relationships of interest ahead of time, and are happy to have them baked into your dataset.

With relational databases, you can join on anything anywhen, so you can explore new relationships as you go.



> Match (a)-[:knows]-(b) > Match (b)-[:loves_to_eat]-(c) > Return a.name,c.name //food suggestions

Why isn’t this sufficient to explore novel relationships?


That's exactly the trade off, isn't it? Either you do the work to store the relationships and save on the compute and memory cost later, or you pay as you go to build it in real time with a relational database. It's horses for courses.


It could be argued that a graph dB is just a really badly implemented index.


To propose a different perspective, a relationship in a graph db is like a materialized join. You pay on relationship creation (you might be using index lookups to find the nodes to connect, similar to a relational db), then for traversal it's just pointer hopping across the relationships to the connected nodes. Aside from the initial lookup of starting node(s), traversing the graph won't use indexes at all, so becomes constant time operations.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: