Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is GUN suitable for building collaborative text editor using causal-tree merging strategy? #459

Closed
coodoo opened this issue Nov 21, 2017 · 3 comments

Comments

@coodoo
Copy link

coodoo commented Nov 21, 2017

The plan is to put a n array of chars into GUN db, let it syncs to all clients, and each client do the merging work using causal-tree strategy (by comparing the lamport timestamp to decide who wins), wondering is this something supported by GUN? Thanks.

@amark
Copy link
Owner

amark commented Nov 21, 2017

Yes, I did a demo a long time ago here: https://youtu.be/rci89p0o2wQ

We even did an entire interactive explainer article on it: http://gun.js.org/explainers/school/class.html

GUN's base CRDT allows for other CRDTs (like a causal-tree) to be implemented on top, so you could do your own custom algorithm. For instance a counter CRDT is implemented here in just 12 LOC: https://github.com/amark/gun/wiki/snippets-(v0.3.x)#counter

But note, GUN does not support JS-style arrays (it has no way to determine if the arrays are atomic, strongly ordered, or loosely ordered), GUN does support sets (tables/collections/lists), and strongly ordered linked-lists can be implemented on top of it, as well as loosely ordered (streamable) items as explained here: http://gun.js.org/explainers/basketball/basketball.html

Would love to see you implement a text editor!!! What are you building it for? I'd love to see it!

(note: this should be a StackOverflow Q, not a bug report, so I'll be closing. Any chance you could copy&paste your Q and my answer into stackoverflow?)

@amark amark closed this as completed Nov 21, 2017
@coodoo
Copy link
Author

coodoo commented Nov 22, 2017

Thanks for the response and details, I'm primarily doing research on various eventually consistent data store for an upcoming project, will keep you posted if I ended up using gun for that!

@amark
Copy link
Owner

amark commented Nov 26, 2017

@coodoo yes, please. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants