Collaborative Real-time Editor - Technical Challenges

Technical Challenges

This section may contain original research.

The complexity of real-time collaborative editing solutions stems from communication latency. In theory, if communication were instantaneous, then creating a real-time collaborative editor would be no more difficult than creating a single-user editor, because a document could be edited using an algorithm similar to the following:

  1. Request an 'edit document' token from the server
  2. Wait until the server says it's our turn to edit the document
  3. Tell the server how to edit the document
  4. Release the 'edit document' token

However, the speed of communication is limited by network latency. This creates a fundamental dilemma: users need their own edits incorporated into the document instantly, but if they are incorporated instantly, then because of communication latency, their edits must necessarily be inserted into different versions of the document.

An example illustrates this problem. Suppose Bob and Alice start with a document containing the word Mary. Bob deletes 'M', then inserts 'H', to change the word into Hary. Alice, before she receives either edit from Bob, deletes 'r', then deletes 'a', to change it into My. Both Bob and Alice will then receive edits that were applied to versions of the document that never existed on their own machines.

Thus, the challenge of real-time collaborative editing is to figure out exactly how to apply edits from remote users, which were originally created in versions of the document that never existed locally, and which may conflict with the user's own local edits.

The most sophisticated solutions solve this problem in a way that does not require a server, does not use locking (all users can freely edit all parts of a document at the same time), and supports any number of users (limited only by the resources of the computers). UNA and SubEthaEdit are examples of two programs that take this approach.

While these sophisticated approaches enable the best user experience, a basic collaborative editor can also be created in a client–server model. In a client–server scenario, one of the editor instances is assigned the role of collaboration server when the document is opened. This server ensures that other editors are kept in sync by determining network latency and acting as a time synchronization server. The server receives timestamped notifications of changes made to the document by other users. It determines how those changes should affect its local copy, and broadcasts its changes to the collaboration pool. In some models, the changes are not reflected on a client until an official response is returned from the server, even if those changes were made locally.

This approach, while significantly less powerful, allows for basic collaboration at a relatively low cost. This makes it preferable in situations where processing resources are limited, such as on Apple's iPhone platform. NetSketch is an example of a program that uses this model.

In the past, Microsoft and IBM have worked to add collaboration facilities to their existing architectures. Although marketed as real-time collaboration, these 'workspace' approaches require either document locking (so only one person can edit it at a time), or 'reconciliation' of conflicting changes, which is generally found by users to be unsatisfactory.

Read more about this topic:  Collaborative Real-time Editor

Famous quotes containing the words technical and/or challenges:

    In effect, to follow, not to force the public inclination; to give a direction, a form, a technical dress, and a specific sanction, to the general sense of the community, is the true end of legislature.
    Edmund Burke (1729–1797)

    The approval of the public is to be avoided like the plague. It is absolutely essential to keep the public from entering if one wishes to avoid confusion. I must add that the public must be kept panting in expectation at the gate by a system of challenges and provocations.
    André Breton (1896–1966)