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

synchronisation to allow offline editing #25

Closed
ghost opened this issue Aug 18, 2018 · 6 comments
Closed

synchronisation to allow offline editing #25

ghost opened this issue Aug 18, 2018 · 6 comments

Comments

@ghost
Copy link

ghost commented Aug 18, 2018

Love this project.

We can add offline editing by using Lamport clocks. What this does is ensure globally ordering or OT operations.

THis also allows git style branches and merges to be possible. Users can edit in a branch, and merge to Master and have no conflicts.

If your interested in this i would be happy to help collaborate on this to add it.

@pulyaevskiy
Copy link
Contributor

Thanks for your feedback!

As it stands right now, I've intentionally excluded all OT-specifics for the editor because there are many ways to implement these.

As far as I understand offline editing would be an integral part of OT workflow because those edits will likely need to be transformed against any remote revisions and vice versa.

This also means that Zefyr would need to be aware of current network status in some way. This one specifically seems like an overkill for this package at least.

Overall, I feel like it would be hard to come up with a generic-enough approach to this without taking into account online side things. But I'd be curious to see any proposals either in form of a pull-request or a spec. PR would definitely be much better though.

@ghost
Copy link
Author

ghost commented Sep 6, 2018

Hey @pulyaevskiy sorry about late reply

I worked a little bit on this before.
Generally these system use CRDT or OT. Your using OT.
The next thing is ordering and time. Generally you use a hybrid logical clock to do with. Its hydrib because its the clock time ( synced with your server) and a local updating UUID. These two concatenated give you global and local ordering. Its not perfect though.

There are a few libraries out there in golang to do this. Generally if i need it to interact with Dart i used GRPC. GRPC between golang and dart works really wel btw. Its almost too easy.

Anyway, let me knwo if your interested and we can work on it together and maybe get more interest in this rolling forward.

@pulyaevskiy
Copy link
Contributor

Sure, but again there are many ways to implement this logic.

I have implemented fully working OT server in my project which supports both offline edits and online sync using Firebase.

I’m not clear on which path exactly you are suggesting yet. E.g.

  • which server side technology to use?
  • where to store local edits while offline?
  • how to reliably determine we are offline / online?

@ghost
Copy link
Author

ghost commented Sep 10, 2018

@pulyaevskiy thanks for the info.

What Server Side language ?
I would use golang. I already use golang with flutter, both server-side and for plugins.
By using golang as a plugin you can also have offline storage using the exact same code that you use on the server. Its very easy to use also.

Where to store local edits when offline?
Ah. i just answered that one. Your reading my mind :) SO golang offline DB inside flutter.
Golang compiles to a and then its exposed through the IOS and Java Flutter plugin standard architecture. It also gets you search using the standard golang bleve lib, so you can index and search the content too.

How to determine offline / online ?
There is Flutter plugin that does it now.
https://github.com/jogboms/flutter_offline

@leedstyh
Copy link

leedstyh commented Apr 9, 2019

Hi @gedw99

Would you like sharing more details about golang / flutter stack, both server side and client side?

@pulyaevskiy
Copy link
Contributor

I'm going to close this one as I consider it out of scope for this package itself. Feel free to open a discussion (in Discussions) on this subject though.

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