Download - Google Wave: Under the Hood
![Page 1: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/1.jpg)
![Page 2: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/2.jpg)
Google Wave: Under the Hood
David Wang, Alexandre Mah, Daniel Danilatos and Casey Whitelaw28 May, 2009
![Page 3: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/3.jpg)
What are waves?
• Hosted content• Live collaboration• Robust and extensible platform
![Page 4: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/4.jpg)
New technology that makes Google Wave possible:
• Concurrency Control for structured data• The Wave Editor
New technology that Google Wave makes possible:• Natural Language Processing in Wave
![Page 5: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/5.jpg)
Concurrency Control
![Page 6: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/6.jpg)
Introduction
• Concurrent rich text editor• Existing concurrent editors
o Google Docs, EtherPad, Subetha Edito Jupiter System
• We want to have both live concurrent editing and rich text• Operational Transformation
o Our starting point, High-Latency, Low-Bandwidth Windowing in the Jupiter Collaboration System (David A. Nichols, Pavel Curtis, Michael Dixon and John Lamping)
![Page 7: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/7.jpg)
Concurrency (the naive way)
![Page 8: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/8.jpg)
Concurrency (the correct way)
![Page 9: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/9.jpg)
Operational Transformation
• Any changes to the shared object are described as an operationo e.g. insert character "a" at position x
• As long as there is a function transform() with the following behaviour, the states of the object in all the clients and the server will eventually converge.o S = Server Operation
C = Client OperationS' = Transformed Server OperationC' = Transformed Client Operation
(S', C') = transform(S, C)where
C'⋅S = S'⋅C
![Page 10: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/10.jpg)
State space
The state space the client and server traverses through while processing the operations• Any left traversal is caused by client operation• Any right traversal is caused by server operation
![Page 11: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/11.jpg)
State space
![Page 12: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/12.jpg)
Changes to Operational Transformation
• Client waits for an ACK before sending more operations to the server. i.e. only 1 outstanding unacknowledged delta per cliento Client keeps the inferred server OT path o Client transforms cached client operations before sending
to server• Keeps the server state simple
o Server no longer needs to maintain multiple client states as clients always sends operations along the server's OT path
![Page 13: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/13.jpg)
Added Support for Recovery
• Can be caused byo Client disconnecto Server crash (front end server or wave server)o Any form of communication failure
• Reconnect gracefully without user action
![Page 14: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/14.jpg)
Wave Operations
We've introduced the ability to compose together any two consecutive operations and we've designed our operations in such a way that the composition of two operations is always another operation. That is, given two consecutive operations A and B, their composition B⋅A can be expressed as another operation.
![Page 15: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/15.jpg)
Handling large transformations!
If the server and client have each accumulated a lot of concurrent operations, transformation can be expensive.This requires nm transformations, where n is the number of client operations and m is the number of server operations.
![Page 16: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/16.jpg)
If efficient composition is possible...
Transforming many client operations with many server operations can be made efficient.
We can design composition to be efficient enough that we can cut the transformation running time to O(n log n + m log m), where n is the total size of the client operations and m is the total size of the server operations.
![Page 17: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/17.jpg)
The document interface
• A streaming interface.• Traverses the operation linearly.
An example operation could perform the following sequence:
![Page 18: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/18.jpg)
"Zipping"
The operation composer works by "zipping" two streaming operations into a single streaming operation.
![Page 19: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/19.jpg)
"Zipping" (continued)
The operation transformer works by "zipping" two streaming operations into two streaming operations.
![Page 20: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/20.jpg)
The composition algorithm illustrated
![Page 21: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/21.jpg)
The composition algorithm illustrated
![Page 22: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/22.jpg)
The composition algorithm illustrated
![Page 23: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/23.jpg)
Composition tree
![Page 24: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/24.jpg)
Composition tree
![Page 25: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/25.jpg)
Editing Waves
![Page 26: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/26.jpg)
![Page 27: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/27.jpg)
Editor Goals
• High granularity extraction and application of operations
• Rich text and media• Extensible (custom widgets, extensions)• Mapping of an abstract Document Model to HTML• Full control over concurrent rich text editing• Multilingual (IMEs, RTL, etc)
![Page 28: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/28.jpg)
Document Model
XML + Annotations
• Simple XML for structure• Standoff annotations for style and metadata
<blip><p>
Hey have you seen this website?</p><p>
It's sweet!</p>
</blip>
![Page 29: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/29.jpg)
Image Thumbnail Example
<w:image attachment="..."><w:caption>A Thumbnail
</w:caption> </w:image>
A Thumbnail
![Page 30: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/30.jpg)
Content XML to Rendered HTML
<w:image attachment="..."><w:caption>pony
</w:caption> </w:image>
<table unselectable='on' cellpadding='0' class='ittt' cellspacing='0'><tbody><tr unselectable='on'><td unselectable='on' style='visibility: visible;' class='itco'><div unselectable='on' style='width: 120px; height: 79px;' class='itci'><a href='...' target='_blank'><img style='width: 120px; height: 79px;' src='...' class='gwt-Image J' />
</a><div style='display: none;' class='itcc' /><div style='display: none;' class='pw'><div style='width: 0%;' class='pwa' /><div style='width: 100%;' class='pwg' />
</div></div>
</td></tr><tr unselectable='on'>
<td unselectable='on' style='visibility: visible;'><div contenteditable='true'>pony<br /></div>
</td></tr>
</tbody></table>
![Page 31: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/31.jpg)
Annotations
Appears as:
hiho
![Page 32: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/32.jpg)
Properties of Annotations
• Don't affect the structural content or its operations• Clients may choose to ignore some or all annotations
![Page 33: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/33.jpg)
Some uses for annotations
• Other users' cursor position, selection• Rich link annotations• Robot-specific data• Diff highlighting (using local annotations)• May reference structured data in another document
o E.g. spelling suggestions and state
![Page 34: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/34.jpg)
![Page 35: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/35.jpg)
![Page 36: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/36.jpg)
<blip><p>
Hey haev you seen</p><p>
this website? And some</p><p>
styled text</p>
</blip>
![Page 37: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/37.jpg)
![Page 38: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/38.jpg)
<blip><p>
Hey <l:p hover="...">haev</l:p><l:spell/> you seen</p><p>
<l:p href="...">this</l:p> website?And <l:p fontWeight="bold">some</l:p>
</p><p>
<l:p fontWeight="bold" fontStyle="italic">styled</l:p><l:p fontStyle="italic">text</l:p>
</p></blip>
l:p - "paint"l:xyz - "boundary"
![Page 39: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/39.jpg)
Rendering the Document Wave Model
![Page 40: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/40.jpg)
Extracting Operations
![Page 41: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/41.jpg)
How this all fits together
![Page 42: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/42.jpg)
Editor within the Document Wave Model
![Page 43: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/43.jpg)
Editor within the Document Wave Model
![Page 44: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/44.jpg)
Summary
• Arbitrary separation of document model from rendering• Balance between maintaining control, and leveraging native
support.
![Page 45: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/45.jpg)
Natural Language Processing
![Page 46: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/46.jpg)
Text: Not So Plain Anymore
Google Wave is an ideal platform for building smarter tools• Structure• Collaboration• Liveness• Hosting / The Cloud
![Page 47: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/47.jpg)
Spelling Correction
The typist's dream: concentrate on writing, let the spelling mistakes sort themselves out!
![Page 48: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/48.jpg)
Interacting With Spelling Suggestions
![Page 49: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/49.jpg)
Representing Spelling Suggestions
<spell>
<suggestion type="original">starled</suggestion>
<suggestion score="2.6">started</suggestion>
<suggestion score="1.2">startled</suggestion>
<suggestion score="0.6">stared</suggestion>
</spell>
![Page 50: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/50.jpg)
Spelly, the spelling robot
Listen to changes on wavesCheck spellingAdd suggestions into the wave
![Page 51: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/51.jpg)
![Page 52: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/52.jpg)
![Page 53: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/53.jpg)
![Page 54: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/54.jpg)
![Page 55: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/55.jpg)
![Page 56: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/56.jpg)
![Page 57: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/57.jpg)
![Page 58: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/58.jpg)
![Page 59: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/59.jpg)
Robots in the Cloud
• available from any device • more data → better quality• shared resources → more efficient • interactive → positive feedback and learning
![Page 60: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/60.jpg)
Collaborative Robots
![Page 61: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/61.jpg)
Collaborative System
![Page 62: Google Wave: Under the Hood](https://reader035.vdocuments.net/reader035/viewer/2022081719/5466a582b4af9f01758b47f9/html5/thumbnails/62.jpg)