Diff and Merge or delta sync
Consider a product where changes a client is making to a text file are broadcast to other clients via a Server. The broadcast happens when the person making changes in the editor presses a button. Other client are connected using a tcp\ip pipe so no polling is required
In our current solution each time the button is pressed the entire Text is sent a开发者_如何学编程nd broadcast and receivers just drop the old text and replace with the new Charmingly simple as this approach is, when the size of this text goes up and the number of users dramatically increases and ,any many such groups of users talk to the same server for their needs, then badness ensuesSo we want to transmit deltas. However on the receiving side its more like merging deltas.( its an HTML editor so even stuff like font changes , colors etc lists all have to be transmitted, and of course people have an annoying habit of deleting stuff as well ) My questions are
1) are there well known algorithms in the literature that solve this issue ( and reasonably implementable by mortals )
2) Are there shrinkwrapped products I can buy\license\opensource that basically solve this diff and merge problemI think you want to have a look at operational transformation. It's the algorithms used behind stuff like google docs / google wave / etc.
You could also have a look at Google mobwrite.
精彩评论