ibGib - a different approach to code and data

I decided to reply to this again, as I continually have trouble explaining ibGib to others. This is not their fault but mine. But I still try! :wink:

Starting a few months ago, I became aware of something called IPFS (website, question on elixir forum). Despite obvious implementation differences (they are looking to work all the way down at the transport/protocol level), their approach shares many characterstics with ibGib.

And just now, I’ve watched a great talk by Joe Armstrong, and at one point he talks about content addressable storage, at which point he shows two slides with very concrete aspects: 1) “Content-addressable web” - URL addressing scheme, 2) “API” - Content Repo interface.

I thought showing these might help explain ibGib a little, partly in the vague hopes of attracting anyone with a UX mindset (I suck at the front end), but partly just to show something concrete on the somewhat abstract subject.

“Content-addressable web” - URL addressing scheme

JA Video (at time 36:14)
http://my.site.land/get/sha1/afg123def23,
http://some.other.site/get/md5/adf1234

ibGib (current implementation, not encoded for example purposes):
http://ibgib.com/ibgib/ib^gib,
http://ibgib.com/ibgib/some ib here^AFG123DEF23

The ibGib ib is a string, and the gib is usually a SHA-256 hash. These are like first and last names. Lots of people share first names, just like the ib can be non-unique, and this can be specified/controlled by the end user. The gib last name is always generated by the engine and is usually calculated as a SHA-256 hash of the ib, data, and rel8ns. The data is a key/value map used for storing “internal” data to a node, e.g. %{"value" => "Hello World"}. The rel8ns is a map in the form of "relationship" => ["array^of", "other^ibgib"], e.g. %{"ancestor" => ["ib^gib"], "dna" => [ib^gib]}.

“API” (Content Repo API)

JA Video (at time 37:34):
put(Data) => void (no return)
get(SHA) => Data (or no return)

IbGib (In IbGib.Data):
def save(info)
def load(ib, gib)

Mr. Armstrong’s focus is mainly centered on the access of the content at this point, and so his API is basically the content repo API. I think his particular “phrasing” here is a little misleading. Either he is including the hash inside of the data he is passing to put, in which case he needs no return but the “Data” is actually Data + Metadata. Or he actually wants to return the hash on the put, and that way when you put the data, you get an address that is a hash. Then you’re able to get at that data again by passing in that same hash.

In ibGib’s save/1 function, the info corresponds to his Data construct. I have implemented this as a map that contains the ib, gib, data, and rel8ns as described above. The load/2 is the get equivalent, passing in the ib and gib which form a unique address to a resource.

Discussion

In the above ibGib URL addressing scheme, I list only the ibgib domain. But I have specifically designed it to be entirely distributed and a primary goal is to allow others to get copies of whatever information is pertinent to them, much like cells in a body exchanging information (and like a compiler removing unused code). This distribution is planned in the form of initially a single server, then nodes and clusters, then multiple sites, then eventually non-server based. So ultimately, just using the system would provide all of the benefits of fault tolerance, availability, etc. The BEAM’s implementation along these lines is one of the primary reasons I chose Elixir!

Also, notice the SHA aspect of both JA’s URL scheme and the API. Yes he lists md5 as an alternative, but this is really still an implementation detail. The ib mechanism provides this at an abstract level, not presupposing what its own use is going to be. Stepping back, all of this stuff is a huge paradigm shift and who knows what else it could end up being! So for people looking to encode information in the ib, they can do so because of its abstract flexibility. For people who don’t have this focus, they don’t have to. Plus it allows me (or whoever is doing coding) to use this as metadata as well, although this is only one route for metadata (there are plenty others). But still ibGib’s design is compacted, IMO quite elegantly (I’m biased :wink:), to the ib, gib, data, and rel8ns.

Summary

So according to the video (also this one about the mess we’re in), Mr. Armstrong is looking for us to solve these kinds of problems, and ibGib is my approach to this.

The near-term goal is to have this kind of structure with notes, pictures, etc. Think git (forking, merging, and more) for any type of content, as well as enabling quite purposefully big data and ML. The far-term goals…well, the applications of the architecture are boundless…I could go on and on about them.

It’s the upcoming IoT!..but even more than just that! :scream: :smile: I chose Elixir because I think it is better suited than Go for many reasons, as I’ve expounded elsewhere on this forum. I hope that it comes to fruition and I’m right! :laughing:

Anyway, this is wayy too long. Thanks for reading! :wave:

3 Likes