-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Ecosystem
How does the GUN ecosystem fit together? Here's an explanation from the chatroom about how HAM, GUN, DAM, SEA, RAD, AXE play into each other while also being independent tools on their own:
DAM is lower level, but sits on the side, GUN does something different
here is a good example
GUN only does brute force deduplication of messages in its event loop
so it acts like it is WiFi router or that its just jamming noisy signals into a room
so like, perfect for UDP multicast
but other than that, GUN doesn't actually care about the outside world
it cares more about taking that noisy data in and merging it with the conflict resolution algorithm
so that way whenever you access the in-memory graph (usually hidden behind an API so you do'nt corrupt it, but if you're at the protocol layer like we are, we directly manipulate it) that is always valid/consistent.
so it takes data in, merges it (HAM), and emits the resolutions out.
that's noisy
DAM comes along and says, "hey, let's optimize the shouting inside a room"
so DAM hears things, and then feeds it in to GUN
and DAM also listens on out to then say things to the external world.
DAM is your ears, GUN is the brain.
RAD basically only listens to out from GUN
and filters for what/when it should save of the graph to disk/storage.
so RAD is your memories.
tho like DAM, since GUN has its own protocol semantics, RAD wraps that and exposes a boring interface for storage engines to plugin
basically just key-value read/write
because RAD does all the tedious work of converting GUN graphs into disk serializable radix trees (well, radisk does that, which is the biggest "part" of RAD) , and making sure those "blobs" are consistent and not trashing each other.
DAM is intentionally pretty limited tho in what it does.
AXE is the real kicker, it does build on top of DAM & GUN
so it cannot be used without at least DAM.
oh, I forgot SEA
SEA has 0 knowledge of GUN or DAM or RAD
it literally is just like "you guys, cryptography APIs are hard, but actually, the reusable patterns/concepts are as easy as cooking analogies" and is a friendly wrapper API for those concepts.
there is an adapter for GUN that I default include in SEA, but its perfectly safe to exclude
so relative to GUN ecosystem, SEA has 3 parts: (1) core (2) GUN wire protocol adapter (3) chain API extensions
I guess just like RAD has a bunch of parts (1) radisk (2) GUN wire protocol adapter (3) bunch of storage engine plugins.
from a vocabulary standpoint, GUN has no plugins - only wire protocol adapters & chain API extensions. DAM & RAD have plugins, networking transports and storage engines.
so back to AXE, it is the first thing that actually builds on top of the others, or needs/assumes the others
AXE is where we go from "shouting in a room locally" to doing efficient global routing - if that fails, it falls back to DAM, if that fails, it falls back to GUN.
AXE is the only reason why GUN has scaled as well as it has
and will be the thing that is most important to implement in Rust. The chaining API, RAD, etc. are not as important.
SEA in Rust should be outsourced to vetted cryptography crates.
however to do the interesting Rust things in AXE, we need DAM/GUN first - which thankfully, is pretty easy to port.