Operational transformation

7,705 views

Published on

Published in: Technology, Design

Operational transformation

  1. 1. The Secret behind Google Docs, Google Wave and Zoho Suite: OperationalTransformation
  2. 2. Who I am Matteo Collina Twitter: @matteocollina Website: matteocollina.com
  3. 3. What do I do?
  4. 4. I study a lot..CCAC North Library http://www.flickr.com/photos/ccacnorthlib/3554627894/in/photostream/ CC by 2.0
  5. 5. ...and today Illspeak about whatIve studied!CCAC North Library http://www.flickr.com/photos/ccacnorthlib/3554627894/in/photostream/ CC by 2.0
  6. 6. We will see...
  7. 7. We will see...1. Why Real Time is cool2. Why we are solving the wrong problem3. An algorithm to rule them all
  8. 8. is all aboutinteraction..
  9. 9. ..between people,
  10. 10. that acts through Browsers,
  11. 11. that communicate through a server!
  12. 12. We can createnew forms ofcollaboration!
  13. 13. There are LOTS of frameworks
  14. 14. There are LOTS of frameworks...
  15. 15. ...and companies!
  16. 16. ...and companies! Thanks!
  17. 17. The frameworks are solving1. How we present the data to the user2. How to transfer the data on the wire
  18. 18. Where is theinteraction between people?
  19. 19. What happens whenthey change the same document?
  20. 20. Really?
  21. 21. Johannes Gilger http://www.flickr.com/photos/heipei/3236351860/
  22. 22. How can we handle conflicts? Johannes Gilger http://www.flickr.com/photos/heipei/3236351860/
  23. 23. Can usersunderstand this? Johannes Gilger http://www.flickr.com/photos/heipei/3236351860/
  24. 24. We usuallylock ourdocumentsto protectthem!
  25. 25. Only theuser thatlocked thedocumentcan edit it!
  26. 26. Some people aredoing it correctly..
  27. 27. Some people aredoing it correctly.. ..how?
  28. 28. What happens whenwe edit a document?
  29. 29. Insert(0,"hello ")Delete(6, 5)Insert(6,"world")
  30. 30. s = "jsday"Insert(0,"hello ")s = "hello jsday"
  31. 31. s = "hello jsday"Delete(6, 5)s = "hello "
  32. 32. s = "hello "Insert(6,"world")s = "hello world"
  33. 33. The operationsare processedas they arrive:what happens ifthere are moreusers sendingthem?
  34. 34. What happens if theoperations come from two users?
  35. 35. sA = "hello world" sB = "hello world"
  36. 36. What happens if operations get delayed?sA = "hello world" sB = "hello world"
  37. 37. sA = "hello jsday" sB = "hello world"
  38. 38. OperationalTransformation
  39. 39. OperationalTransformation➡ has been a research topic for more than 20 years➡ is a family of algorithms ❖ Jupiter has lead to Google Docs / Wave
  40. 40. OperationalTransformation 1. reorders the operations 2. handles the conflicts between operations 3. garantees the same result on all nodes
  41. 41. Reorder Problem
  42. 42. How can we reorder the operations?
  43. 43. What is theintention behind the delete?
  44. 44. s = "hello jsday" The intention behind theDelete(6, 5) delete is to remove the "jsday" strings = "hello "
  45. 45. Delete(6, 5) Delete(12, 5) Insert(6,"world")
  46. 46. Delete(6, 5) Delete(12, 5) Insert(6,"world") OT transposes the Delete through the Insert
  47. 47. s = "hello worldjsday"Delete(12, 5)s = "hello world"
  48. 48. s = "hello worldjsday" OT is aboutchanging where Delete(12, 5)and how the ops are = "hello uted s exec world"
  49. 49. What happensif two users delete the same string?
  50. 50. What happens if two users delete the same string?Delete(6, 5) NoOperation Delete(6, 5)
  51. 51. OperationalTransformation reorders the operations handles the conflicts between operations garantees the same result on all nodes
  52. 52. Unfortunately,there is some nasty math involved!
  53. 53. DEMO!!! http://www.flickr.com/photos/oneaustin/1261907803
  54. 54. markdocs.com
  55. 55. TL;DR http://www.flickr.com/photos/evilaugust/3307382858
  56. 56. TL;DROperational transformation:• allows to build true real time applications;• is really hard;• garantee the same results for every users! http://www.flickr.com/photos/evilaugust/3307382858
  57. 57. Check out realify.it!
  58. 58. ..but we startedwith a question!
  59. 59. What do I do?
  60. 60. What do I do? • Ph.D. Student • Software Engineer @ Mavigex • Conference Speaker (?)
  61. 61. Choose your tools wisely! http://www.flickr.com/photos/chuffy/186676221
  62. 62. Thank You!
  63. 63. Any Questions?

×