3 ms·
I'll help you, but you should know that what they do is nothing like that. They used Operational Transformation. They have convergent properties which guarantee
by espadrine 12y ago
I'll help you, but you should know that what they do is nothing like that. They used Operational Transformation. They have convergent properties which guarantee that you won't ever have merge conflicts. They also have, depending on the implementation, certain causality guarantees that ensure that what you edited stays the way you intended.
The basic idea is that you receive operations that modify your local operations. The challenge is in writing the function that takes each two operations and mutates them. Therefore, the protocol is of no practical interest, it simply serves that function's purpose.
Here's a set of libraries that implement this for strings: https://github.com/Operational-Transformation https://github.com/Operational-Transformation
Implementing this for JSON is certainly possible, and has been done. See this for instance: https://github.com/share/ShareJS https://github.com/share/ShareJS