Skip to content

Comment on Ask HN: Implementing a graph database using Postgres tables for nodes and edges?parent

Comments

You raise a good point. I don't expect graph queries that go more than a few links away. To the extent that there will be such queries, I think appropriate indexing will help a great deal.

Implementation wise, it is not that different from a query with many joins anyway - which is a standard problem, and is addressed by materialized views as well as indexing. So as long as the complex queries don't need to be ad hoc and real time, I can prepare for them using materialized views.

However you are quite right in that complex, ad hoc, and realtime graph queries Will be a pain point. That is a risk I am prepared to tolerate in the short term. The thing is, I also need transactional integrity, so I am stuck with an rdbms as the primary solution. In the long term, I anticipate the need for both graph queries and transactions - thus, I think it is better to start with postgres and incorporate a graphdb as the need arises than the other way round.

Hopefully this line of reasoning make sense? I am really not experienced at this, so am trying to not bump into too many walls.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.