Skip to content

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

Comments

I think you want to google "triple store" because that is effectively what you are trying to do AIUI. Triple stores are the persistence strategy of choice for RDF and other Semantic-Web-type applications.

Each row in a triple store stores a relationship between 2 objects, with unique IDs for the subject, the relationship type, and the object. The IDs could refer to other tables that store entity and relationship details.

There are specialised triple store DBMSs, but implementing one in PostgreSQL should be pretty easy.

AboutSource Built by g1lg1l

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