gritzko / ron

(dated, see the site) Replicated Object Notation, a distributed live data format, golang/ragel lib
http://replicated.cc
Apache License 2.0
360 stars 7 forks source link

Examples #3

Closed ghost closed 6 years ago

ghost commented 6 years ago

Wow. I am needing to build a quill editor that syncs. Basically a poor man's google docs. Are there any projects that use Ron yet that I can study ?

ghost commented 6 years ago

BTW the editor is written in dart and so runs on mobiles using flutter and web using dart transpired to javascript. I used to use gophers but recently found dart to be more productive.

So if I can see a example that exploits the API to handle a json doc I reckon I could write a dart example that uses RON.

It's easy to use the golang RON implementation as you have it now because Flutter / dart can call golang and Visa versa on mobiles. They are called Method Channels in the flutter world.

ghost commented 6 years ago

Been thinking about this a bit more.

It all boils down to if you envisage RON being used server side or client side. If server side, then Ron would hold versions and do all merges and then push updates asynchronous to clients probably. The client would then not need to really have much ROan logic.

Would really like to know what your thinking about this

gritzko commented 6 years ago

Hi! RON principles are derived from several projects, two of them real-time collaborative editors. I can't give you a public example codebase, unfortunately. RON is supposed to be used both client- and server-side. There is a JavaScript implementation that is close to being compatible with go http://github.com/gritzko/swarm

ghost commented 6 years ago

thanks @gritzko

gotta ask some newbie questions because there is no example code...

Is it server side only, Or do clients need to have some of the logic ? From what i can see they need to support your serialisation structure at the very least.

gritzko commented 6 years ago

Yes, the serialization format and data type merge rules (assuming they need incremental updates).

ghost commented 6 years ago

ok thanks @gritzko that helps narrow things down ..

I think that the best strategy for me is to build RON into mobiles using gomobile to make them work offline. On the sever, RON types will need to be there and be handled properly and then marshalled as normal types to the DB.

On mobile in the GUI layer, i use Flutter. i think its best to write a broker / marshaller between the flutter layer and the golang layer running on mobiles. That way the Flutter code has just standard type. Flutter stores no data. Its all at the golang Layer.

Thats my think at the moment, until i get into it.

I will study the swarm JS version too to see the internals.

DO you see any potential gotchas with this approach ?

gritzko commented 6 years ago

Flutter stores no data. Its all at the golang Layer.

If that works for you. Typically, there is some conversion/deserialization from RON frames into the app's native data structures. These depend on the app, even a plain text editor might use quite sophisticated custom data structures (ropes, trees, etc).

ghost commented 6 years ago

ok thanks. will play with it. closing ...