SlideShare a Scribd company logo
The future will be 
realtime & collaborative 
Joseph Gentle
Make everything realtime & collaborative - JS Summit 2014
I am not here to talk 
about ShareJS
This is about doing what 
ShareJS does: 
Use Operational Transform 
to make better apps
A quick history lesson
Static Pages 
HTML, CSS 
1990
Static Pages 
HTML, CSS 
1990 
Browser 
Web 
Server 
Filesystem
Static Pages 
1990 
Forms, CGI-BIN 
HTML, CSS PHP, Perl 
1997
Static Pages 
1990 
Forms, CGI-BIN 
HTML, CSS PHP, Perl 
1997 
Web 
Server 
Filesystem 
Browser 
CGI 
Database 
POST 
Render
Static Pages 
HTML, CSS PHP, Perl Rails, Python 
1990 
REST endpoints 
Forms, CGI-BIN 
2000 
1997
REST endpoints 
HTML & 
JS 
Filesystem 
Browser 
REST 
Database 
XHR 
App 
rendering 
DOM updates 
Model data
Static Pages 
HTML, CSS PHP, Perl Rails, Python 
1990 
Forms, CGI-BIN 
1997 
REST endpoints 
2000 
Realtime full page apps 
Meteor, Firebase 
2005
DOM 
HTML & 
JS 
Filesystem 
Model view 
Stream 
Live data 
view 
Database 
Events 
Render 
Render 
REST endpoints Realtime full page apps
Realtime full page apps
Realtime full page apps
Realtime full page apps
Realtime full page apps
Realtime full page apps
DOM 
HTML & 
JS 
Filesystem 
Model view 
Stream 
Live data 
view 
Database 
Events 
Render 
Render 
REST endpoints Realtime full page apps
DOM 
HTML & 
JS 
Filesystem 
Model view 
Stream 
Live data 
view 
Database 
Events 
Render 
Render 
REST endpoints Realtime full page apps
This talk: 
• What is operational transform? 
• How you can use it today 
• The things nobody’s built yet
3 big advantages:
1. Your model data gets updated 
in realtime
1. Your model data gets updated 
in realtime 
2. Seamless online / offline
1. Your model data gets updated 
in realtime 
2. Seamless online / offline 
3. Never accidentally overwrite 
data (F/LWW)
Part 1: OT
Make everything realtime & collaborative - JS Summit 2014
Make everything realtime & collaborative - JS Summit 2014
Make everything realtime & collaborative - JS Summit 2014
Operational Transform
Operational Transform 
Insert “hi there” at position 100 in the document 
[{pos:100, ins:“hi there”}]
Initial doc 
xxxxxxxxxx 
Anne Beth 
Insert ‘C’, pos 1 
Insert ‘a’, pos 2 
Insert ‘t’, pos 3 
Insert ‘D’, pos 11 
Insert ‘o’, pos 12 
Insert ‘g’, pos 13 
CatxxxxxxxxxxDog
Initial doc 
xxxxxxxxxx 
Insert ‘C’, pos 1 
Insert ‘D’, pos 11 
Insert ‘a’, pos 2 
Insert ‘o’, pos 12 
Insert ‘t’, pos 3 
Insert ‘g’, pos 13 
CatxxxxxxxxxgoDx
Initial doc 
xxxxxxxxxx 
Insert ‘C’, pos 1 
Transform 
these } 
Insert ‘D’, pos 12 
Insert ‘a’, pos 2 
Insert ‘o’, pos 14 
Insert ‘t’, pos 3 
Insert ‘g’, pos 16 
CatxxxxxxxxxxDog
Initial doc 
xxxxxxxxxx 
Transform 
these } 
Insert ‘C’, pos 1 
Insert ‘a’, pos 2 
Insert ‘t’, pos 3 
Insert ‘D’, pos 14 
Insert ‘o’, pos 15 
Insert ‘g’, pos 16 
CatxxxxxxxxxxDog
Initial doc 
xxxxxxxxxx 
Insert ‘D’, pos 11 
Insert ‘o’, pos 12 
Insert ‘g’, pos 13 
Insert ‘C’, pos 1 
Insert ‘a’, pos 2 
Insert ‘t’, pos 3 
Transform 
these } 
CatxxxxxxxxxxDog
<Demo text>
But why only text editing?
Initial doc 
[1,2,3,4,5,6,7,8,9,10] 
Anne Beth 
Insert ‘C’, pos 1 
Insert ‘a’, pos 2 
Insert ‘t’, pos 3 
Insert ‘D’, pos 11 
Insert ‘o’, pos 12 
Insert ‘g’, pos 13 
[‘C’,’a’,’t’,1,2,3,4,5,6,7,8,9,10, ‘D’, ‘o’, ‘g’]
Initial doc 
[‘C’,’a’,’t’,…, ‘D’, ‘o’, ‘g’] 
Anne Beth 
Move item 1 to last position 
Replace item 1 with “e” 
[’a’,’t’,…, ‘D’, ‘o’, ‘g’, ‘e’]
<Demo app state>
DOM 
HTML & 
JS 
Filesystem 
state 
Stream 
state 
Events 
Render
{ 
location: ‘inbox’, 
messages: { 
inbox: […] 
spam: [] 
} 
} 
DOM 
client 
state 
client 
state 
Events 
Render 
Client 
Database 
Server
{ 
location: ‘spam’, 
messages: { 
inbox: […] 
spam: [] 
} 
} 
DOM 
client 
state 
client 
state 
Go to spam folder 
Render 
Client 
Database 
Server
{ 
location: ‘spam’, 
messages: { 
inbox: […] 
spam: [] 
} 
} 
DOM 
client 
state 
client 
state 
Go to spam folder 
Render 
Client 
Database 
Server 
Populate the spam messages
{ 
location: ‘spam’, 
messages: { 
inbox: […] 
spam: […!!! STUFF] 
} 
} 
DOM 
client 
state 
client 
state 
Go to spam folder 
Render 
Client 
Database 
Server 
All the messages!
Part 2: How you can use 
it today
Make everything realtime & collaborative - JS Summit 2014
Make everything realtime & collaborative - JS Summit 2014
You are here
github.com/ottypes/json0
OT Types 
JSON Text Rich text
ShareJS 
Client server protocol on top of OT types
ReactJS demo
DOM 
HTML & 
JS 
Filesystem 
Model 
Ops 
ShareJS 
Database 
Events 
Render
Derby & Racer 
Web framework & ORM on top of ShareJS
Part 3: Going where no 
code has gone before
We are still in the dark ages, 
figuring it out. 
Help by making stuff and 
documenting what you 
make.
Bother your framework authors! 
Tell them to get on board.
Polymer needs OT bindings for object observers 
https://github.com/Polymer/observe-js 
doc.submitOp([{p:[‘users’, users.length],li:“Sam”}]); 
users.push(“sam”);
Help make data bindings & 
examples
Help port ot types to your fav language
Full offline support? 
Mobile first?
We need a database which provides 
this API out of the box. 
If you write databases for a living, lets 
have coffee.
Make cool stuff and show 
people. 
Especially me. I love cool stuff.
IDE!!!
Editor 
libllvm libllvm 
Source files 
Compiler 
Binaries 
Output 
Debugger 
libllvm 
Parse 
Parse 
X-Code Today
X-Code In the world of Tomorrow! 
Editor libllvm 
Syntax & autocomplete 
Annotated 
Source code 
Compiler 
Binaries 
Output 
Filesystem 
saver 
Errors 
Test 
runner
josephg.com 
github.com/josephg 
ShareJS.org

More Related Content

PPTX
CouchDB Day NYC 2017: JSON Documents
PPTX
CouchDB Day NYC 2017: Mango
PPTX
CouchDB Day NYC 2017: Full Text Search
PDF
Scaling FastAGI Applications with Go
PDF
JS Fest 2019. Артур Торосян. V8 - взгляд на асинхронность и работу с ОС изнутри
PDF
Ankara jug mayıs 2013 sunumu
PDF
Github - Le Wagon Melbourne
PDF
Level Up Your Git and GitHub Experience by Jordan McCullough and Brent Beer
CouchDB Day NYC 2017: JSON Documents
CouchDB Day NYC 2017: Mango
CouchDB Day NYC 2017: Full Text Search
Scaling FastAGI Applications with Go
JS Fest 2019. Артур Торосян. V8 - взгляд на асинхронность и работу с ОС изнутри
Ankara jug mayıs 2013 sunumu
Github - Le Wagon Melbourne
Level Up Your Git and GitHub Experience by Jordan McCullough and Brent Beer

What's hot (13)

PDF
Testing http calls with Webmock and VCR
KEY
TDD of HTTP Clients With WebMock
PDF
JDO 2019: Serverless Hype Driven Development - Grzegorz Piotrowski
PDF
Aio...whatever
PPTX
Introduction tomongodb
KEY
Gittalk
PDF
ClojureScript Introduction
PPTX
Introduction To Git Workshop
PDF
Server Side Swift
PDF
VersionEEring
PPT
Dev8d 2011-pipe2 py
PPTX
Ruby File I/O
PDF
Mashing Up The Guardian
Testing http calls with Webmock and VCR
TDD of HTTP Clients With WebMock
JDO 2019: Serverless Hype Driven Development - Grzegorz Piotrowski
Aio...whatever
Introduction tomongodb
Gittalk
ClojureScript Introduction
Introduction To Git Workshop
Server Side Swift
VersionEEring
Dev8d 2011-pipe2 py
Ruby File I/O
Mashing Up The Guardian
Ad

Viewers also liked (20)

PDF
CloudStack&日本CloudStackユーザ会のご紹介(仮)
PDF
molson coors brewing 200710K
PDF
liz claiborne cert_incorp
PPT
2010 5 25 Pres 27 Mei 10
PDF
telephone data systems 2007proxyexibit13tothe2006form10k
PDF
advance auto parts 2006AnnualReport
PDF
FIS Road Show Presentation June 2008
PPTX
Breast Cancer040710
PPT
Engaged Reading And Writing
PDF
molson coors brewing COORS_AR2003
PPT
Presentatie 27 Mei Cluster Htv
PDF
ncr annual reports 2006
PPTX
Fifteen 12112010
PDF
Thesis Midterm032610
PDF
Digital business #3
PDF
Jp2007284370
ODP
NYPHP March 2009 Presentation
PPTX
Warandecollege 05102010
PDF
Resource Thursdays
PDF
molson coors brewing COORS_AR1998
CloudStack&日本CloudStackユーザ会のご紹介(仮)
molson coors brewing 200710K
liz claiborne cert_incorp
2010 5 25 Pres 27 Mei 10
telephone data systems 2007proxyexibit13tothe2006form10k
advance auto parts 2006AnnualReport
FIS Road Show Presentation June 2008
Breast Cancer040710
Engaged Reading And Writing
molson coors brewing COORS_AR2003
Presentatie 27 Mei Cluster Htv
ncr annual reports 2006
Fifteen 12112010
Thesis Midterm032610
Digital business #3
Jp2007284370
NYPHP March 2009 Presentation
Warandecollege 05102010
Resource Thursdays
molson coors brewing COORS_AR1998
Ad

Similar to Make everything realtime & collaborative - JS Summit 2014 (20)

KEY
OSSBarCamp Talk on Dexy
PDF
Free The Enterprise With Ruby & Master Your Own Domain
ODP
Intro To Spring Python
PDF
Python tools for testing web services over HTTP
PPTX
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
PPTX
session_01_react_.pptx
PPT
PPTX
Core .NET Framework 4.0 Enhancements
PPTX
Exploring SharePoint with F#
PDF
Building Services With gRPC, Docker and Go
PDF
BreizhCamp 2013 - Pimp my backend
PPTX
MWLUG 2014: ATLUG Comes To You
PDF
Rails Girls - Introduction to HTML & CSS
PPTX
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
PDF
HTML literals, the JSX of the platform
PPTX
TypeScript and SharePoint Framework
PPTX
Creating a Single View Part 2: Loading Disparate Source Data and Creating a S...
PPTX
Modern javascript localization with c-3po and the good old gettext
PPTX
2018 03 20_biological_databases_part3
PPTX
German introduction to sp framework
OSSBarCamp Talk on Dexy
Free The Enterprise With Ruby & Master Your Own Domain
Intro To Spring Python
Python tools for testing web services over HTTP
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
session_01_react_.pptx
Core .NET Framework 4.0 Enhancements
Exploring SharePoint with F#
Building Services With gRPC, Docker and Go
BreizhCamp 2013 - Pimp my backend
MWLUG 2014: ATLUG Comes To You
Rails Girls - Introduction to HTML & CSS
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
HTML literals, the JSX of the platform
TypeScript and SharePoint Framework
Creating a Single View Part 2: Loading Disparate Source Data and Creating a S...
Modern javascript localization with c-3po and the good old gettext
2018 03 20_biological_databases_part3
German introduction to sp framework

Make everything realtime & collaborative - JS Summit 2014