OPERATIONAL TRANSFORMATION

'Operational transformation' (OT) is a theoretical framework of concurrency control that has been continuously researched in the context of group editing, a subfield of computer supported cooperative work (CSCW). OT typically replicates the shared document at all sites and allows any user to edit any part of the document at any time. Local editing operations are executed often without being delayed or blocked. Remote operations are transformed before execution to repair inconsistencies. The lockfree, nonblocking property of OT makes the local response time not sensitive to networking latencies. As a result, OT is particularly good for implementing group editing in the Web/Internet context.
OT can also be considered as an optimistic replication framework. Therefore, optimistic replication systems such as distributed file systems and distributed version control systems can be built on top of the OT framework.
OT was initially proposed for merging text documents represented as a sequence of characters . However, OT approach was also applied for merging hierarchical structures

such as XML documents, rich text documents ,
spreadsheets and tables. In OT mechanism was proposed as a generic merge framework.

Contents
History
OT principles
Correctness models
The CC Model
The CCI Model
The CSM Model
Transformation Functions
Forward Transformation Functions
Backward Transformation Functions
Undo in OT
OT Integration Algorithms
Criticisms of OT
OT Software
See Also
External Links
References

History


OT was pioneered by Ellis and Gibbs Concurrency control in groupware systems, Ellis, C.A., , , ACM SIGMOD Record, 1989 . They proposed the dOPT approach and the GROVE group editor based on it. Several years later, some correctness issues were identified and several approaches such as adOPTed, Jupiter and GOT were proposed to solve these issues.

OT principles


An OT framework considers n sites, each site owning a copy
of shared data. When a site performs an update, it generates a
corresponding operation. Every operation is processed in four steps:
# executed on one site,
# broadcasted to other sites, [1]
# received by other sites,
# integrated and executed on other sites.
OT frameworks distinguish two main components:

★ an 'integration algorithm'. This algorithm is in charge of reception, diffusion and execution of operations. When necessary, it calls transformation functions. This algorithm does not depend on type of replicated data ;

★ a set of 'transformation functions'. These functions merge concurrent modifications in serializing two concurrent operations. These functions are specific to a particular type of replicated data like string of characters, XML document or file system.
Correctness models

Up to now three correctness models of operational transformation were proposed.
The CC Model

The first and the basic correctness model of Operational Transformation was defined in dOPT and adOPTed
. These approaches use two criteria of correctness:

★ ''Causality'' : Considering two operations op_1 and op_2, operation op_1 is said to precede op_2 if and only if op_2 is generated on a copy after op_1 was executed on this copy. Subsequently, op_2 may depend on effects of execution of op_1. Causality preservation criterion ensures that all operations ordered by a precedence relation will be executed in the same order on every copy.

★ ''Convergence'' : When two operations are not causally connected by a precedence relation, they are concurrent. Two concurrent operations can be executed in different order on two different copies. Consequently, when an operation is received on one site, the current state of shared object may be different from the one where the operation has been generated. Thus, executing this operation in its generated form on a remote site may not preserve its effects and the copies may diverge.
The CCI Model

Sun Achieving convergence, causality preservation, and intention preservation in real-time cooperative editing systems, Chengzheng Sun, , , ACM Trans. Comput.-Hum. Interact., 1998 approach extended the correctness model defined in previous approaches by the concept of operation intention. The correctness criteria proposed by GOT are the following:

★ ''Causality'': the same definition as in CC Model

★ ''Convergence'': the same definition as in CC Model

★ ''Intention preservation''. Intention preservation criteria is expressed as follows: For any operation O, the effects of executing O at all sites are the same as the intention of O, and the effect of executing O does not change the effects of independent operations.

''the notion of ''Intentions'' has been often critized because it does not exist a formal definition of ''Intentions''. Consequently, how to prove that the model is correct ?''

The CSM Model

Operation intention was not formally defined in CCI model. The SDT and LBT approaches tried to formalise the notion of intention by means of the effects relation concept. The effects relation between two operations relies on the fact that there exists a total order relation between the target characters of the operations. The consistency model proposed by these approaches consist of the following properties:

★ ''Causality'': the same definition as in CC Model

★ ''Single-operation effects'':the effect of executing any operation in any execution state achieves the same effect as in its generation state

★ ''Multi-operation effects'': the effects relation of any two operations is maintained after they are both executed in any states

Transformation Functions


Illustration of the TP1 property

Illustration of the TP2 property

A transformation function T takes two concurrent operations op_1,op_2 defined on the same state s and return
a new operation op_1' defined on the state s circ op_2. A Transformation function is also named a ''forward transformation function'' or ''Inclusion transformation''
Forward Transformation Functions

For example, suppose a type String with an operation ins(p,c,sid) where p is the position of insertion, c the character to insert and
sid the identifier of the site that has generated the operation. We can write the following transformation function:
T(ins(p_1,c_1,sid_1),ins(p_2,c_2,sid_2)) :-
if (p_1 < p_2) return ins(p_1,c_1,sid_1)
else if (p_1=p_2 and sid_1 < sid_2) return ins(p_1,c_1,sid_1)
else return ins(p_1+1,c_1,sid_1)
In order to ensure correction, integration algorithms may require properties on transformation functions:

★ the property 'TP1' is defined as :

For every pair of concurrent operations op_1 and op_2 defined on the
same state, the transformation function T satisfies TP_1 property
if and only if:
op_1 circ T(op_2,op_1) equiv op_2
circ T(op_1,op_2)
where op_i circ op_j denotes the sequence of operations containing
op_i followed by op_j ; and where equiv denotes equivalence of
the two sequences of operations.


★ the property 'TP2' is defined as :

For every three concurrent operations op_1, op_2 and op_3
defined on the same state, the transformation function T satisfies
TP_2 property if and only if:
T(op_3, op_1 circ T(op_2,op_1)) = T(op_3, op_2 circ T(op_1,op_2))
This second property TP_2 stipulates ''equality'' between two
operations transformed with regard to two equivalent sequences of
operations. Given three operations op_1, op_2 and op_3, the
transformation of op_3 with regard to the sequence formed by op_2
followed by T(op_1,op_2) must give the same operation as the
transformation of op_3 with regard to the sequence formed by op_1
followed by T(op_2,op_1).

The TP2 property is difficult to achieve and currently only the TTF transformation set Tombstone Transformation Functions for Ensuring Consistency in Collaborative Editing Systems, Gerald Oster, , , Procs. 2nd Intl. Conf. on Collaborative Computing: Networking, Appln. and Worksharing, 2006 ensures TP2
Backward Transformation Functions

Illustration of the Partial Concurrency problem

Some integration algorithm (SOCT2, GOTO) requires to re-order operations in the local log in the case of partial concurrency. On the figure on the right, when op_3 arrives on site 1,
it cannot be transformed with op_1 because op_1 and op_3 are not defined on the same state. However, if site 1 can compute the equivalent log op_2 circ op_1'
(ensured by condition TP1), then op_3 can be safely transformed with op_1'.
In this case, integration algorithms will call a ''backward transformation'' or ''exclusion transformation'' or ''inverse transformation''.
(caution ! definitions are not rigorously equivalent)
A backward transformation T^{-1}(op_1,op_2) take two concurrent operations op_1,op_2 where op_1 is defined on the state S circ op_2 and compute the operation op_1' which is defined on S and is equivalent to op_1.
T^{-1}(ins(p_1,c_1,sid_1),ins(p_2,c_2,sid_2)) :-
if (p_1 < p_2) return ins(p_1,c_1,sid_1)
else if (p_1=p_2 and sid_1 < sid_2) return ins(p_1,c_1,sid_1)
else return ins(p_1-1,c_1,sid_1)
T^{-1} transformations have to ensure the reversibility property:
T^{-1}(T(op_1,op_2),op_2)=op_1

It is not safe, in the general case, to backward transform two causally dependant operations i.e. if we have S circ op_1=ins(X,3) circ op_2=del(3), it is not safe to call T^{-1}(op_2,op_1). However, some authors, within a particular context, allow integration algorithms to call backward transformation function with two causal operations.

Undo in OT


The Undo feature in OT allows users to Undo any operation at anytime i.e. not only the last operation, or your last operation. Ensuring the CC or the CCI correctness model
with the Undo feature is complex.
The undo effect of an operation op is obtained by using its inverse operation overline{op}.
More properties are required on transformation functions such as IP1, IP2, IP3. Some of those properties can be forced by the integration algorithm as in AnyUndo or COT.

★ Inverse Property 1 (IP1):

The property IP1 expresses that the sequence op circ overline{op} has no effect on the document. This property has been formalized as:
S circ op circ overline{op} = S

Illustration of the IP3 property


★ Inverse Property 2 (IP2):

The property IP2 expresses that the sequence op circ overline{op} has no effect on the transformation of other operations. In other words, transforming any operation op_x with this sequence must not modify the operation op_x. The transformation functions satisfy IP2 if and only if: T(op_x, op circ overline{op})=op_x


★ Inverse Property 3 (IP3):

If op_1 and op_2 are two concurrent operations, the transformation functions satisfy the property IP3 if and only if T(overline{op_1},T(op_2,op_1))=overline{T(op_1,op_2)}. This property ensures that the order of reception of operations has no influence on the undo effect.

OT Integration Algorithms


A continuous total order is a strict total order where it possible to detect a missing element i.e. 1,2,3,4,... is a continuous total order, 1,2,3,5,... is not a continuous total order. A continuous total order is costly to maintain in a distributed system.
Algorithm Convergence Causality Transformations Undo
GOTO TP1+TP2 State vectors Forward and Backward transformations Not supported
GOTO+AnyUndo Undo as concurrent inverse in group editors, Sun, C., , , ACM Transactions on Computer-Human Interaction (TOCHI), 2002 TP1+TP2+IP1 State Vectors Forward and Backward transformations Any operations
SOCT4 TP1+Continuous Total Order Timestamps Forward transformation Not Supported
SOCT2 TP1+TP2 State vectors Forward and Backward transformation Not Supported
ADOPTED TP1+TP2 State vectors Forward transformation Partially supported
COT TP1+Continuous Total Order Context Vectors Forward transformation Any Operation
GOT UNDO-DO-REDO+Discontinuous Total order State Vector Forward + Backward transformations ??
MOT2 Synchronizer Based on Operational Transformation for P2P Environments, M. Cart, Jean Ferrié,, , , , 2006 TP1 None Forward Transformation Not Supported

Criticisms of OT



★ OT has been mainly used for real-time group editors. Who really needs Real-time group editors ?

★ Transformation functions are difficult to write and prove.

★ What is really intentions ?

★ There are many other ways to merge data and OT is too complex.

★ Is the theoretical framework completely sound ?

OT Software



CoWord is a free closed-source Collaborative real-time editor based on Ms Word

Ace is a free open-source Collaborative real-time editor

Gobby is a free open-source Collaborative real-time editor

Subethaedit is a commercial Collaborative real-time editor

★ So6 is a free open-source version control system integrated in the LibreSource platform.

See Also



Optimistic Replication

Data synchronization

Collaborative Editing

Consistency models

External Links



International Workshop on Collaborative Editing Systems

Distributed System Online - Collaborative editing

References



1. how the operation is broadcasted is out of the scope of OT. OT suppose that operations eventually arrive. The order of arrival is not ensured. see reliable multicast



This article provided by Wikipedia. To edit the contents of this article, click here for original source.

psst.. try this: add to faves