Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

A minimal impl. of Operational Transformation

A minimal impl. of Operational Transformation

計算機網路實驗期末專案

Avatar for Andy Pan

Andy Pan

June 20, 2019
Tweet

More Decks by Andy Pan

Other Decks in Technology

Transcript

  1. A minimal implementation of Operational Transformation 潘廣霖 B03203004 詹丰億 B05902126

    巫尚謙 B04902129 蘇瑞揚 B04902042 方銘浩 B05902082 CNLab 2019 Final Project Group 17
  2. Outline • What is operational transformation? • Basic OT techniques

    • Our implementation ◦ local version ◦ online version (server) ◦ offline version (離線編輯) • References • Demo
  3. Operational Transformation • Operational transformation (OT) is a technology for

    supporting a range of collaboration functionalities in advanced collaborative software systems. • Originally invented for consistency maintenance and concurrency control in collaborative editing of plain text documents.
  4. OT explained • OT: The CC model ◦ Causality Preservation

    (保留因果關係) ◦ Convergence (收斂) • The most basic question: Two transitions happen concurrently. How to find a (reasonable) state merge(A, B), such that a S b A b’ ?? B a’ apply(apply(S, A), B') = apply(apply(S, B), A') ?
  5. How about this? a S b A ?? B A’

    A’’ Drawbacks of OT: 1. OT is often too complicated to design on various actions. 2. Complexity grows as increasing concurrent users. 3. Hard to (formally) prove the correctness even for the simplest cases. ? ? ? ?
  6. Focus on text editing only; A state transition can be

    formalized as a sequence consist of 3 kinds of operations: 1. Insertion: Insert(string) 2. Deletion: Delete(uint) 3. Retention: Retain(uint) Along with the initial/final document length. Changeset
  7. Changeset example • Before: "我大127依舊電" • After: "大127就是電" Changeset: Delete(1),

    Retain(4), Delete(2), Insert("就是"), Retain(1) [8 -> 7] Reference
  8. Other techniques • Diff-match-patch: ◦ Diff: ▪ Compare two blocks

    of plain text and efficiently return a list of differencess. ◦ Match: ▪ Given a search string, find its best fuzzy match in a block of plain text. Weighted for both accuracy and location. ◦ Patch: ▪ Apply a list of patches onto plain text. Use best-effort to apply patch even when the underlying text doesn't match. • CRDT: Conflict-free replicated data type Can describe peer-to-peer collaborations!
  9. • Text editor: CodeMirror 5 ◦ Allow smooth compositions (組字)

    ◦ Does not interrupt typing when content is changing ◦ CM6 (still in prototype phase) even serialize operations for you! • Calculating transforms: ot.js • Hand-wiring the state transition, simulate network channels, ... Implementation
  10. Reference [1]Ellis, C.A.; Gibbs, S.J. (1989). "Concurrency control in groupware

    systems". ACM SIGMOD Record. 18 (2): 399–407. [2]Rui Li; Du Li (2007). "A New Operational Transformation Framework for Real-Time Group Editors". IEEE Transactions on Parallel and Distributed Systems. 18 (3): 307–319.