Hacker News new | ask | show | jobs
by spothedog1 871 days ago
Can you expand on Postgres vs Graph Databases?
2 comments

It is easy to represent a graph in Postgres using edge and node tables. For the use case we have, it is more performant to query such a setup for many millions of relationships vs using the big names in graph databases.

You just need a little bit of appropriate index selection and ability to read the output of EXPLAIN ANALYZE to do so.

There are probably use cases where this doesn't hold, but I found in general that it is beneficial to stick to Postgres for this, especially if you want some ability to query using relations.

IIRC, the biggest (AFAIK) graph DB in the world, TAO from Facebook, is based on an underlying MySQL. There must be a good reason why FB prefers a SQL DB over a dedicated graph DB.