Decentralized Graph Databases: Optimizing Relationships with Intermediate Nodes

Gustav Corpas
4 min readNov 1, 2023
Photo by Kevin Ku on Unsplash

First things first. A random image, so the page doesn’t look so boring.

Now :) I have recently been getting into this open source project called gunDB. It is a really cool decentralized graph database, that allow peer-to-peer streaming of data.

Because of this, I have been thinking about establishing some best practices when working with such databases. While this endeavor is primarily for my benefit, I though I would share it so that others might benefit, or perhaps just provide some food for thought… — after all, I’m just a passionate enthusiast trying to make sense of it all!

Over the coming weeks I plan on publishing a couple of stories with whatever insights I discover. 🕵️ I’d love your company, hit that follow button and all that jazz 🎷, otherwise — happy reading!

OKAY ! Now that the disclaimers are out of the way — let’s dive in!

Very quickly about gun

If the words node, edge, graph database or perhaps even gunDB is something you are familiar with, feel free to skip ahead… Otherwise I think it would be handy, to just do a speed run of what gun and graph databases are.

Normally you might image a database like a big table or spread-sheet with a bunch of data in it. What we are talking about here is a bit different. In Gun data is structured in nodes that are linked together.

Example time:
Imagine modeling car dealerships (because cars are the go-to example 🚗). You’d have a list of companies, each with details about their facilities, staff, and the cars they stock. Each car node might carry information about its seat count and motor size.

In a graph database each company, facility, staff, and car becomes a separate node, interconnected for easy reference. The nodes could then reference each other. Your car node would have an ID, say “car001” and then the car-dealer could reference the car by that ID.

Graph databases, like Gun, thrive on flexible node navigation. A well-structured setup enhances usability. A bad structure will be hard to work with. The main idea of graph databases is that you can jump around between…

--

--

Gustav Corpas

I write about technology and society. Or anything that is interesting to me.