ipfs / ipfs/specs

Idea: add a "join table" capability inherently within IPFS (aka the missing link)

Open
#109 3 comments 3 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
1.2k
Forks
247
Avg merge
5d 21h
Merged PRs (30d)
4

Description

I've been thinking off and on ever since I discovered IPFS about how i could leverage its awesomeness. Obviously it's perfect for storing and accessing static content, but the sticking point always seems to be that it's “not dynamic”.

It occurred to me today that, when people make this argument, it's generally not the data that needs to be dynamic, it's how the data links together that allows an app or website to be dynamic. For example, people aren't constantly editing their tweets on Twitter (their tweets aren't dynamic), they create new tweets that generally relate somehow to other tweets. The ability to dynamically associate data seems to be what's missing.

From a database perspective, this is generally accomplished through the use of a join table. Since all data within IPFS is already uniquely identified (Merkle-links), and IPLD does an amazing job of distributing and routing data, it seems that the benefits of a join table could be accomplished through a small (conceptually) addition to IPLD.

I’m not familiar with the actual IPFS/IPLD implementation, so please forgive my ignorance. Conceptually my idea goes something like this…

IPLD should already be implementing a kind of join table, but, instead of linking two objects together, it’s linking an object to an IPFS node that can return that object. Now imagine expanding this capability slightly so it can also manage the linking of one object to another.

I’ll use a simple hypothetical command line example below to explain how this could be used.

```
> echo “Hi, my name is Bob” | ipfs add -q
QmR5wc8AuuJhLKTZMfH9eV6SYwao68eGuDitSkbAsB3UDu

> echo “Hi Bob, my name is Mary” | ipfs add -q
QmPn73mc9DqmhpeyE4T4TxuWGFXjAaLta49PSiUxcavRNr

> echo “Hi Bob, my name is Sally” | ipfs add -q
QmVgaeqotXMg2hs4tfHgRGm8EqWDF72hqf7aowyBoozYWz

> ipfs associate QmR5wc8AuuJhLKTZMfH9eV6SYwao68eGuDitSkbAsB3UDu QmPn73mc9DqmhpeyE4T4TxuWGFXjAaLta49PSiUxcavRNr

> ipfs associate QmR5wc8AuuJhLKTZMfH9eV6SYwao68eGuDitSkbAsB3UDu QmVgaeqotXMg2hs4tfHgRGm8EqWDF72hqf7aowyBoozYWz

> ipfs get_associates QmR5wc8AuuJhLKTZMfH9eV6SYwao68eGuDitSkbAsB3UDu
QmPn73mc9DqmhpeyE4T4TxuWGFXjAaLta49PSiUxcavRNr
QmVgaeqotXMg2hs4tfHgRGm8EqWDF72hqf7aowyBoozYWz
```

Linked objects would not automatically be returned when you fetch an object. Instead, it would be up to the client to explicitly query for a list of related objects, and they would then iterate through that list of hashes fetching each “child” normally.

With this new capability you can imagine how trivial it would be to add a comments section to a blog post or really any other scenario that normally relies on a relational database for its “dynamic” content.

Thoughts? Comments? Has this idea already been discussed elsewhere?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.