简体   繁体   中英

Whats the difference between nomsdb and gundb

As far as I understand those two database seem to follow almost the same principles. Both support offline scenarios, are decentralised and have a flexible datamodel. The only real difference I see is that noms implements some of the ideas from git and by that allows for custom merge operations, whereas gun implements automatic conflict resolution.

Is this the only difference or am I missing something?

The main difference is that one tastes yummy, and the other one you should not put in your mouth. ;) Kidding aside:

(1) noms always stores the entire revision history, like git as mentioned. While with gun this is optional.

(2) They both have "just works" data sync/merge "out of the box", both can support DAGs and Merkle trees. Here is how gun does it: http://gun.js.org/distributed/matters.html .

(3) To the ops question, gun also supports custom merge algorithms that can be built on top of the automatic one.

(4) I know that gun can support non-directed or non-acyclic graphs, aka graphs that have circular references and bidirectional relationships. I am not sure if noms can, or I'm sure you can, but if this works is a first class / easy feature or not.

(5) noms design doc says it is "effectively CA" (with respect to the CAP theorem) which would indicate that it should not be used with offline-first peers. However I'm pretty sure what they INTEND to mean is that noms is AP (offline-first) and because data never mutates/changes (can only ever be appended, like Datomic) it has C like properties (however how you access the data as a developer is not necessarily C). Here is gun's take: https://github.com/amark/gun/wiki/CAP-Theorem

In conclusion, from my limited overview it seems like they are similar, both can do what the other can do but it might be slightly easier to:

(A) If you are building your own blockchain, audit log, or doing accounting/banking then noms would be easier.

(B) If you are building a game, social network, mobile app, or IoT network then gun would be easier.

NOMS is what is known as a "content addressable" database (like Camlistore), holding structured data as a Merkle DAG. It provides probabilistic B-Trees as an indexing mechanism. Because of this structure, a lot of data sync/merge problems work "out of the box". I'm not entirely certain of Gun's internal structure, but I do know that employs a suite of merge algorithms such as Operational Transform for reconciliation.

GunDB is implemented in Javascript. While NOMS has a JS implementation (and Attic Labs employs engineers with very serious JS backgrounds), implementation issues are leading them to drop client-side JS support. See me whining on https://github.com/attic-labs/noms/issues/3120

I'd be very curious to hear from others who have tried both.

both database almost the same principles. both support offline scenarios, are decentralised and have a flexible datamodel. noms implements some of the ideas from git and by that allows for custom merge operations and gun implements automatic conflict resolution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM