SlideShare a Scribd company logo
1 of 69
Download to read offline
The future will be 
realtime & collaborative 
Joseph Gentle
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
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
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

What's hot

Introduction tomongodb
Introduction tomongodbIntroduction tomongodb
Introduction tomongodb
Lee Theobald
 

What's hot (13)

Testing http calls with Webmock and VCR
Testing http calls with Webmock and VCRTesting http calls with Webmock and VCR
Testing http calls with Webmock and VCR
 
TDD of HTTP Clients With WebMock
TDD of HTTP Clients With WebMockTDD of HTTP Clients With WebMock
TDD of HTTP Clients With WebMock
 
JDO 2019: Serverless Hype Driven Development - Grzegorz Piotrowski
JDO 2019: Serverless Hype Driven Development - Grzegorz Piotrowski JDO 2019: Serverless Hype Driven Development - Grzegorz Piotrowski
JDO 2019: Serverless Hype Driven Development - Grzegorz Piotrowski
 
Aio...whatever
Aio...whateverAio...whatever
Aio...whatever
 
Introduction tomongodb
Introduction tomongodbIntroduction tomongodb
Introduction tomongodb
 
Gittalk
GittalkGittalk
Gittalk
 
ClojureScript Introduction
ClojureScript IntroductionClojureScript Introduction
ClojureScript Introduction
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
 
Server Side Swift
Server Side SwiftServer Side Swift
Server Side Swift
 
VersionEEring
VersionEEringVersionEEring
VersionEEring
 
Dev8d 2011-pipe2 py
Dev8d 2011-pipe2 pyDev8d 2011-pipe2 py
Dev8d 2011-pipe2 py
 
Ruby File I/O
Ruby File I/ORuby File I/O
Ruby File I/O
 
Mashing Up The Guardian
Mashing Up The GuardianMashing Up The Guardian
Mashing Up The Guardian
 

Viewers also liked

molson coors brewing 200710K
molson coors brewing   200710Kmolson coors brewing   200710K
molson coors brewing 200710K
finance46
 
liz claiborne cert_incorp
liz claiborne cert_incorpliz claiborne cert_incorp
liz claiborne cert_incorp
finance48
 
telephone data systems 2007proxyexibit13tothe2006form10k
telephone data systems  2007proxyexibit13tothe2006form10ktelephone data systems  2007proxyexibit13tothe2006form10k
telephone data systems 2007proxyexibit13tothe2006form10k
finance48
 
advance auto parts 2006AnnualReport
advance auto parts 2006AnnualReportadvance auto parts 2006AnnualReport
advance auto parts 2006AnnualReport
finance48
 
FIS Road Show Presentation June 2008
FIS Road Show Presentation June 2008FIS Road Show Presentation June 2008
FIS Road Show Presentation June 2008
finance48
 
Breast Cancer040710
Breast Cancer040710Breast Cancer040710
Breast Cancer040710
klee4vp
 
Engaged Reading And Writing
Engaged Reading And WritingEngaged Reading And Writing
Engaged Reading And Writing
UCEW
 
molson coors brewing COORS_AR2003
molson coors brewing  COORS_AR2003molson coors brewing  COORS_AR2003
molson coors brewing COORS_AR2003
finance46
 
ncr annual reports 2006
ncr annual reports 2006ncr annual reports 2006
ncr annual reports 2006
finance46
 
Thesis Midterm032610
Thesis Midterm032610Thesis Midterm032610
Thesis Midterm032610
klee4vp
 
Digital business #3
Digital business #3Digital business #3
Digital business #3
finanzas_uca
 
molson coors brewing COORS_AR1998
molson coors brewing  COORS_AR1998molson coors brewing  COORS_AR1998
molson coors brewing COORS_AR1998
finance46
 

Viewers also liked (20)

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

Similar to Make everything realtime & collaborative - JS Summit 2014

OSSBarCamp Talk on Dexy
OSSBarCamp Talk on DexyOSSBarCamp Talk on Dexy
OSSBarCamp Talk on Dexy
ananelson
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
Thomas Conté
 
Core .NET Framework 4.0 Enhancements
Core .NET Framework 4.0 EnhancementsCore .NET Framework 4.0 Enhancements
Core .NET Framework 4.0 Enhancements
Robert MacLean
 
Exploring SharePoint with F#
Exploring SharePoint with F#Exploring SharePoint with F#
Exploring SharePoint with F#
Talbott Crowell
 
Creating a Single View Part 2: Loading Disparate Source Data and Creating a S...
Creating a Single View Part 2: Loading Disparate Source Data and Creating a S...Creating a Single View Part 2: Loading Disparate Source Data and Creating a S...
Creating a Single View Part 2: Loading Disparate Source Data and Creating a S...
MongoDB
 

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

OSSBarCamp Talk on Dexy
OSSBarCamp Talk on DexyOSSBarCamp Talk on Dexy
OSSBarCamp Talk on Dexy
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own Domain
 
Intro To Spring Python
Intro To Spring PythonIntro To Spring Python
Intro To Spring Python
 
Python tools for testing web services over HTTP
Python tools for testing web services over HTTPPython tools for testing web services over HTTP
Python tools for testing web services over HTTP
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
 
session_01_react_.pptx
session_01_react_.pptxsession_01_react_.pptx
session_01_react_.pptx
 
Rails 101
Rails 101Rails 101
Rails 101
 
Core .NET Framework 4.0 Enhancements
Core .NET Framework 4.0 EnhancementsCore .NET Framework 4.0 Enhancements
Core .NET Framework 4.0 Enhancements
 
Exploring SharePoint with F#
Exploring SharePoint with F#Exploring SharePoint with F#
Exploring SharePoint with F#
 
Building Services With gRPC, Docker and Go
Building Services With gRPC, Docker and GoBuilding Services With gRPC, Docker and Go
Building Services With gRPC, Docker and Go
 
BreizhCamp 2013 - Pimp my backend
BreizhCamp 2013 - Pimp my backendBreizhCamp 2013 - Pimp my backend
BreizhCamp 2013 - Pimp my backend
 
MWLUG 2014: ATLUG Comes To You
MWLUG 2014: ATLUG Comes To YouMWLUG 2014: ATLUG Comes To You
MWLUG 2014: ATLUG Comes To You
 
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years laterSymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
 
Rails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSSRails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSS
 
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP MeetupWeb Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
 
HTML literals, the JSX of the platform
HTML literals, the JSX of the platformHTML literals, the JSX of the platform
HTML literals, the JSX of the platform
 
TypeScript and SharePoint Framework
TypeScript and SharePoint FrameworkTypeScript and SharePoint Framework
TypeScript and SharePoint Framework
 
Creating a Single View Part 2: Loading Disparate Source Data and Creating a S...
Creating a Single View Part 2: Loading Disparate Source Data and Creating a S...Creating a Single View Part 2: Loading Disparate Source Data and Creating a S...
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
Modern javascript localization with c-3po and the good old gettextModern javascript localization with c-3po and the good old gettext
Modern javascript localization with c-3po and the good old gettext
 
2018 03 20_biological_databases_part3
2018 03 20_biological_databases_part32018 03 20_biological_databases_part3
2018 03 20_biological_databases_part3
 

Make everything realtime & collaborative - JS Summit 2014