3 ms·
Great comment! The P2P protocol's base case is an ad-hoc mesh network (how the messaging between peers works is explained here: https://github.com/amark/gun/wi
by marknadal 10y ago
Great comment!
The P2P protocol's base case is an ad-hoc mesh network (how the messaging between peers works is explained here: https://github.com/amark/gun/wiki/Mesh-Network-Messaging-Algorithm https://github.com/amark/gun/wiki/Mesh-Network-Messaging-Alg... ).
Initial connections are handled statelessly, both peers exchange blobs of the requested/subscribed data to make sure they are in sync (not out of date / old / stale). On the wire, this is a GET command.
Then the connection becomes stateful, and only the changes/deltas/diff of data are pushed over the network, thus allowing for realtime updates. Over ther wire, this is a PUT command.
All data is represented as a graph (whether key/value, table, relational, document, or graph itself).
And that is about it! Other than, of course, the AP aspects and the hybrid vector/lexical/timestamp CRDT for conflict resolution. The architecture is genuinely quite simple, intended to be the foundation for more complex data structures to be built on top (other CRDTs, or DAGs, simple linked lists, etc.).
There is a half baked "How to port GUN" guide here: https://github.com/amark/gun/wiki/porting-gun https://github.com/amark/gun/wiki/porting-gun .