Five years ago I was absolutely frustrated with the state of Graph databases and libraries and tried putting several non-Graph DBMSs behind a NetworkX-like Python interface <<a href="https://github.com/unum-cloud/NetworkXum">https://github.com/unum-cloud/NetworkXum</a>>.<p>When benchmarked, Neo4J crashed on every graph I’ve tried <<a href="https://www.unum.cloud/blog/2020-11-12-graphs" rel="nofollow">https://www.unum.cloud/blog/2020-11-12-graphs</a>>, making SQLite and Postgres much more viable options even for network-processing workloads. So I wouldn’t be surprised to learn that people actually use pgRouting and Supabase in that setting.<p>With the rise of Postgres-compatible I’m wondering if it’s worth refreshing the project. Similarly, there are now more Graph DBs like MemGraph compatible with CYPHER, which should probably work much better than Neo4J.
My original goal in this article was to figure out if pgrouting would be a good tool to build a memory-layer (for AI/agents) but the article got a bit long. Early results are promising - I’ll follow up with another article soon<p>there are some other interesting extensions in this space - onesparse[0] is early in development but pretty exciting as it builds on SuiteSparse which is very mature<p>[0] <a href="https://onesparse.com/docs.html" rel="nofollow">https://onesparse.com/docs.html</a>
Supabase consistently puts out such fantastic bite-sized gems - and for me some of my favorites have been related to PostGIS - whether it’s about serving tiles directly, or this (ab)use of functionality typically used in a PG geospatial context. Nothing revolutionary or massive and complex - not like reading DDIA of course, but just fun and mentally activating, making me want to jump into something new. I really applaud them for frequently posting actually engaging content that just gets you excited to work with databases… it sounds silly to say it like that, but it does feel like I get regularly struck with the feeling of sadness when I realize how vanilla all of my daily development related interactions with dbs are so vanilla.
I’ve always wondered why there isn’t a “SQLite for graphs,” so to speak. Is there something about how they have to be stored that precludes an in-process solution with disk-based storage?
I'm working on a little Poatgres graph db project. The querying and table structure is much simpler for the same task:<p><a href="https://memelang.net/03/" rel="nofollow">https://memelang.net/03/</a>
<a href="https://github.com/memelang-net/memesql3">https://github.com/memelang-net/memesql3</a>
Interesting in hearing some thoughts about using roaring bitmaps stored in a bytea postgres column to represent adjacency matrixes.<p>I was thinking that given RDS has support for plrust and PostgreSQL's SPI I could use the fact they support croaring-rs there as a crate and build upon that.<p>I figure I can use that to represent many graph's with say 100s to ~100m nodes and many relations between these things. But each graph would be tenanted to a tenant (company/b2b saas use case).<p>I was thinking that by using plrust storing the roaring bitmap on the DB server in a bytea and using SPI, I can benefit from the minimal network overhead to mutate and query against the bitmap with croaring. Using SPI locally in the DB server I eliminate network overhead shipping that back to my application code.<p>PostgreSQL also gives me transaction safety to updates etc. And a bunch of support for other column base data such as my tenant ID column, some JSONB for relationship metadata to query on etc.<p>Basically something like <a href="https://jazco.dev/2024/04/20/roaring-bitmaps/" rel="nofollow">https://jazco.dev/2024/04/20/roaring-bitmaps/</a> but on postgres. Given I need to support many tenanted graphs & we're already using citus this seems like something that is feasible at a larger scale too.<p>I was wondering though if I am going to need to create some operator classes to allow me to index relations a bit better (probably seems likely I think).<p>I am aware of <a href="https://github.com/ChenHuajun/pg_roaringbitmap">https://github.com/ChenHuajun/pg_roaringbitmap</a> but would prefer to use int64s and maybe start out on RDS instead of having to add another workload to our self hosted citus cluster/s.<p>Happy to be told I am fool and any insights would be nice. I am potentially going to try this out on some of our data sets we have because our product team is basically laying out a vision where they want us to have a graph powering a bunch of things.<p>I don't like the idea of neo4j when we're already deep into PostgreSQL for a bunch of workloads (~20+ TB table workloads etc so we have some reasonable inhouse PG experience).<p>Also huge thanks to the author of the blog post. I had been looking at pgRouting and wondering with a tilted head.. hmm seems like we can just use this as a graph DB. So that is also on my list to test out.
Any comments on "Apache AGE"?<p>Apache AGE™ is a PostgreSQL that provides graph database functionality.<p><a href="https://age.apache.org" rel="nofollow">https://age.apache.org</a>
Maybe a stupid question. When just looking at the data model (and not e.g. the query language) ... but is there a real difference between a "graph" database and a "normal SQL" database when the SQL database is able to directly point to rows (ROWID?) without a separate index?
Anybody have any experience creating isocrhones using PgRouting? I have a use case that involves generating isochrone maps for walking, biking, etc. but I'd like to just use Postgres if possible and avoid another piece of infrastructure like Valhalla, OpenTripPlanner, OpenRouteService, etc.
You can always trust Postgres to have another extension that opens up great new data modelling opportunities. This is great. Wonder how this stacks up to the CedarDB (Postgres-compatible) graph capabilities.
Great article!
Although it seems that the last section (about YouTube recommendations) is incomplete, as there's no query to actually calculate the recommendations.