SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
Puppet
MAKE STATEFUL APPS
EASIER THAN STATELESS
Marcin Warpechowski

Starcounter - Sep 2015
What is Puppet
Protocol for remote JSON data synchronization.
Uses JSON-Patch over HTTP or WebSocket,
with optional Operational Transformation.
What do we use it for?
UI
server-driven view-models
SPOILER ALERT
What is Puppet
Pattern
Protocol for remote JSON data synchronization.
Uses JSON-Patch over HTTP or WebSocket,
with optional Operational Transformation.
What is Puppet
Pattern
Standards
Protocol for remote JSON data synchronization.
Uses JSON-Patch over HTTP or WebSocket,
with optional Operational Transformation.
What is Puppet
Pattern
Standards
OK, that’s ours
but based on a well-researched principle
Protocol for remote JSON data synchronization.
Uses JSON-Patch over HTTP or WebSocket,
with optional Operational Transformation.
Why JSON
• ECMA and IETF standard (ECMA-404, RFC 7159)
• 7 kinds of values: string, number, object, array, true, false, null
• this simplicity encourages thin client
• ubiquitous (every platform supported)
Why JSON
• ECMA and IETF standard (ECMA-404, RFC 7159)
• 7 kinds of values: string, number, object, array, true, false, null
• this simplicity encourages thin client
• ubiquitous (every platform supported)
Why JSON-Patch
• IETF standard (RFC 6902)
• 3 major operations: add, replace, remove
• 3 helper operations: copy, move, test
• a JSON-Patch is a JSON document itself
• reduces traffic
Why JSON-Patch
• 3 major operations: add, replace, remove
• 3 helper operations: copy, move, test
• a JSON-Patch is a JSON document itself
• reduces traffic
Puppet flow
1. Get HTML representation of the page
2. Get JSON representation of the page
3. Send any change as JSON-Patch (WebSocket or HTTP)
4. Send clicks on links as HTTP GET type JSON-Patch
Elements in italic are not on the diagram
Puppet solves problems
• communicating changes to tree-structured data between two
peers
• in our case: synchronizing UI state between the server and
the client
• removes the need for glue code (a real data object is synced)
• going out of sync (Operational Transformation)
Benefits of Puppet for the UI
SECURITY
No hackable code in the client
COMPOSABILITY
JSON trees can be nested
MITIGATING NETWORK LATENCY
Client sends the data as you type.
Server already has the data when
you press OK
TEMPLATING SYSTEMS
Polymer, Angular, Handlebars, etc
bind JSON nicely to HTML
MORPHABILITY
UI can respond to changes by
replacing parts of the tree
DEEP URLS
Links morph the state if opened in
the same tab. They reload the page
only if you open a new tab
Triggering changes
• when the client sends a change, this is just an intent
• it is up to the server to accept, process and react to this intent
• ...or to reject it
Triggering changes
• Altering FirstName$ or LastName$ on the client 

can cause the server to change the FullName
• Altering Price$ or Quantity$ on the client 

can cause the server to change the Total
• Pressing a button can be sent as incrementation of a number 

or change from false -> true
• Any change can result in morphing of the view 

(alteration of small or big part of JSON tree)
Why HTTP
• W3C and IETF standard (multiple RFC)
• ability to ask for representation as JSON and HTML
• ability to send changes as JSON-Patch or JSON
• ability to morph documents
HTML representation
JSON representation
JSON-Patch representation
Why WebSocket
• W3C and IETF standard (RFC 6455)
• messages don’t have headers
• important when message is smaller than the header
• messages delivered in order
• ability to push
Why WebSocket
Why Operational Transformation
• web reality: the client and the server are doing concurrent
changes asynchronously (most of the time out-of-sync)
• goal: apply patches correctly without freezing UI or disallowing
server push
• how does it work: transforms any remote operation over
operations that were generated locally
Without Operational Transformation
CLIENT SERVER
“ABCDE” “ABCDE”
“ABCE” “ACDE”
“ACD”“ACE”
C = Del 4 S = Del 2
S = Del 2 C = Del 4
TIME
With Operational Transformation
CLIENT SERVER
TIME
“ABCDE” “ABCDE”
“ABCE” “ACDE”
“ACD”“ACE”
C = Del 4 S = Del 2
S’ = Del 2 C’ = Del 3
What Puppet is not
• RPC
• Collaboration tool
What Puppet is not
• RPC
• Collaboration tool
But can be used as such
Puppet implementations
JavaScript:

PuppetJS
Framework agnostic (tested with
Polymer, Angular and plain JS)
Oriented for the role of the client
(server usage samples in
development)
Web Components:

puppet-client
Native Web Component API
Plays well with Polymer
C#:

Starcounter
Oriented for the role of the server
Working on releasing it as NuGet
package that can be used as a
server or as a client
Demo
• Procurement
• trigger server change of InvoiceRow Total in Chrome console:



var	
  o	
  =	
  document.querySelector('puppet-­‐client').obj.workspaces[0]

o.Procurement.CurrentPage.Procurement.PurchaseOrderItems[0].Price$++
• Chatter
• push new Chat message from Chrome console:



o.Chatter.CurrentPage.Chatter.ChatMessage.Text$	
  =	
  "Hi	
  from	
  console!”

o.Chatter.CurrentPage.Chatter.Send$++
Future topics
• Puppet does not replace REST, it enhances it
• Puppet shares some mindset with DDP, Falcor, ShareJS
• Detailed view into OT
GitHub: https://github.com/puppetjs/puppetjs (see Wiki)
Twitter: @starcounterdb, @warpech
Thanks! More info on
.io

Weitere ähnliche Inhalte

Was ist angesagt?

Testing Web Services - QA or the Highway 2016
Testing Web Services - QA or the Highway 2016Testing Web Services - QA or the Highway 2016
Testing Web Services - QA or the Highway 2016Steinn 'Stan' Jónsson
 
CDC Tests - Integration Tests cant be made simpler than this!
CDC Tests - Integration Tests cant be made simpler than this!CDC Tests - Integration Tests cant be made simpler than this!
CDC Tests - Integration Tests cant be made simpler than this!Ramya Authappan
 
THE SCIENCE AND ART OF BACKWARDS COMPATIBILITY
THE SCIENCE AND ART OF BACKWARDS COMPATIBILITYTHE SCIENCE AND ART OF BACKWARDS COMPATIBILITY
THE SCIENCE AND ART OF BACKWARDS COMPATIBILITYInformatics Summit
 
How to Develop for Data Transformation with FME Server
How to Develop for Data Transformation with FME ServerHow to Develop for Data Transformation with FME Server
How to Develop for Data Transformation with FME ServerSafe Software
 
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce LabsHow To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce LabsSauce Labs
 
Performance presentation
Performance presentationPerformance presentation
Performance presentationHashem Khalifa
 
API Proxy Auto Discovery
API Proxy Auto DiscoveryAPI Proxy Auto Discovery
API Proxy Auto DiscoveryVince Soliza
 
From ActiveRecord to EventSourcing
From ActiveRecord to EventSourcingFrom ActiveRecord to EventSourcing
From ActiveRecord to EventSourcingEmanuele DelBono
 
Marrying angular rails
Marrying angular railsMarrying angular rails
Marrying angular railsVolker Tietz
 
Configuration patterns in mule
Configuration patterns in muleConfiguration patterns in mule
Configuration patterns in mulesathishmca143
 
Mule ESB - How to convert from Xml to Json in 5 minutes
Mule ESB - How to convert from Xml to Json in 5 minutesMule ESB - How to convert from Xml to Json in 5 minutes
Mule ESB - How to convert from Xml to Json in 5 minutesGennaro Spagnoli
 
Angular js- 1.X
Angular js- 1.XAngular js- 1.X
Angular js- 1.XNitin Giri
 
ReactJS - Re-rendering pages in the age of the mutable DOM
ReactJS - Re-rendering pages in the age of the mutable DOMReactJS - Re-rendering pages in the age of the mutable DOM
ReactJS - Re-rendering pages in the age of the mutable DOMMarc Cyr
 
Radu vunvulea refactoring&code smells
Radu vunvulea   refactoring&code smellsRadu vunvulea   refactoring&code smells
Radu vunvulea refactoring&code smellsRadu Vunvulea
 
Client side performance testing using blazemeter
Client side performance testing using blazemeterClient side performance testing using blazemeter
Client side performance testing using blazemeterGowthamraj Palani
 
Web service的自动化测试 soap ui的介绍
Web service的自动化测试 soap ui的介绍Web service的自动化测试 soap ui的介绍
Web service的自动化测试 soap ui的介绍bqconf
 
TPSE Thailand 2015 - Rethinking Web with React and Flux
TPSE Thailand 2015 - Rethinking Web with React and FluxTPSE Thailand 2015 - Rethinking Web with React and Flux
TPSE Thailand 2015 - Rethinking Web with React and FluxJirat Kijlerdpornpailoj
 

Was ist angesagt? (20)

Testing Web Services - QA or the Highway 2016
Testing Web Services - QA or the Highway 2016Testing Web Services - QA or the Highway 2016
Testing Web Services - QA or the Highway 2016
 
CDC Tests - Integration Tests cant be made simpler than this!
CDC Tests - Integration Tests cant be made simpler than this!CDC Tests - Integration Tests cant be made simpler than this!
CDC Tests - Integration Tests cant be made simpler than this!
 
THE SCIENCE AND ART OF BACKWARDS COMPATIBILITY
THE SCIENCE AND ART OF BACKWARDS COMPATIBILITYTHE SCIENCE AND ART OF BACKWARDS COMPATIBILITY
THE SCIENCE AND ART OF BACKWARDS COMPATIBILITY
 
How to Develop for Data Transformation with FME Server
How to Develop for Data Transformation with FME ServerHow to Develop for Data Transformation with FME Server
How to Develop for Data Transformation with FME Server
 
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce LabsHow To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
 
Performance presentation
Performance presentationPerformance presentation
Performance presentation
 
API Proxy Auto Discovery
API Proxy Auto DiscoveryAPI Proxy Auto Discovery
API Proxy Auto Discovery
 
From ActiveRecord to EventSourcing
From ActiveRecord to EventSourcingFrom ActiveRecord to EventSourcing
From ActiveRecord to EventSourcing
 
What Is Ajax
What Is AjaxWhat Is Ajax
What Is Ajax
 
Marrying angular rails
Marrying angular railsMarrying angular rails
Marrying angular rails
 
Configuration patterns in mule
Configuration patterns in muleConfiguration patterns in mule
Configuration patterns in mule
 
Mule ESB - How to convert from Xml to Json in 5 minutes
Mule ESB - How to convert from Xml to Json in 5 minutesMule ESB - How to convert from Xml to Json in 5 minutes
Mule ESB - How to convert from Xml to Json in 5 minutes
 
Angular js- 1.X
Angular js- 1.XAngular js- 1.X
Angular js- 1.X
 
Web Services With Delphi, Sep, 2008
Web Services With Delphi, Sep, 2008Web Services With Delphi, Sep, 2008
Web Services With Delphi, Sep, 2008
 
Web application with mule
Web application with muleWeb application with mule
Web application with mule
 
ReactJS - Re-rendering pages in the age of the mutable DOM
ReactJS - Re-rendering pages in the age of the mutable DOMReactJS - Re-rendering pages in the age of the mutable DOM
ReactJS - Re-rendering pages in the age of the mutable DOM
 
Radu vunvulea refactoring&code smells
Radu vunvulea   refactoring&code smellsRadu vunvulea   refactoring&code smells
Radu vunvulea refactoring&code smells
 
Client side performance testing using blazemeter
Client side performance testing using blazemeterClient side performance testing using blazemeter
Client side performance testing using blazemeter
 
Web service的自动化测试 soap ui的介绍
Web service的自动化测试 soap ui的介绍Web service的自动化测试 soap ui的介绍
Web service的自动化测试 soap ui的介绍
 
TPSE Thailand 2015 - Rethinking Web with React and Flux
TPSE Thailand 2015 - Rethinking Web with React and FluxTPSE Thailand 2015 - Rethinking Web with React and Flux
TPSE Thailand 2015 - Rethinking Web with React and Flux
 

Andere mochten auch

oVirt and OpenStack integration
oVirt and OpenStack integrationoVirt and OpenStack integration
oVirt and OpenStack integrationNimbus Concept
 
Pets versus Cattle: servers evolved
Pets versus Cattle: servers evolvedPets versus Cattle: servers evolved
Pets versus Cattle: servers evolvedPhil Cryer
 
Servers as Pets v. Servers as Cattle
Servers as Pets v. Servers as CattleServers as Pets v. Servers as Cattle
Servers as Pets v. Servers as CattleRadamanthus Batnag
 
EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...
EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...
EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...{code}
 
EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms ...
EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms ...EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms ...
EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms ...{code}
 
Why should i care about stateful containers?
Why should i care about stateful containers?Why should i care about stateful containers?
Why should i care about stateful containers?ClusterHQ
 
Born in the Cloud; Build it Like a Startup
Born in the Cloud; Build it Like a StartupBorn in the Cloud; Build it Like a Startup
Born in the Cloud; Build it Like a StartupAmazon Web Services
 
DCOS Presentation
DCOS PresentationDCOS Presentation
DCOS PresentationJan Repnak
 
Pets vs. Cattle: The Elastic Cloud Story
Pets vs. Cattle: The Elastic Cloud StoryPets vs. Cattle: The Elastic Cloud Story
Pets vs. Cattle: The Elastic Cloud StoryRandy Bias
 
Containers: Life Beyond Microservices? by Sushil Kumar, Robin Systems
Containers: Life Beyond Microservices? by Sushil Kumar, Robin SystemsContainers: Life Beyond Microservices? by Sushil Kumar, Robin Systems
Containers: Life Beyond Microservices? by Sushil Kumar, Robin SystemsDocker, Inc.
 
The History of Pets vs. Cattle ... And Using It Properly
The History of Pets vs. Cattle ... And Using It ProperlyThe History of Pets vs. Cattle ... And Using It Properly
The History of Pets vs. Cattle ... And Using It ProperlyRandy Bias
 

Andere mochten auch (11)

oVirt and OpenStack integration
oVirt and OpenStack integrationoVirt and OpenStack integration
oVirt and OpenStack integration
 
Pets versus Cattle: servers evolved
Pets versus Cattle: servers evolvedPets versus Cattle: servers evolved
Pets versus Cattle: servers evolved
 
Servers as Pets v. Servers as Cattle
Servers as Pets v. Servers as CattleServers as Pets v. Servers as Cattle
Servers as Pets v. Servers as Cattle
 
EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...
EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...
EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...
 
EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms ...
EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms ...EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms ...
EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms ...
 
Why should i care about stateful containers?
Why should i care about stateful containers?Why should i care about stateful containers?
Why should i care about stateful containers?
 
Born in the Cloud; Build it Like a Startup
Born in the Cloud; Build it Like a StartupBorn in the Cloud; Build it Like a Startup
Born in the Cloud; Build it Like a Startup
 
DCOS Presentation
DCOS PresentationDCOS Presentation
DCOS Presentation
 
Pets vs. Cattle: The Elastic Cloud Story
Pets vs. Cattle: The Elastic Cloud StoryPets vs. Cattle: The Elastic Cloud Story
Pets vs. Cattle: The Elastic Cloud Story
 
Containers: Life Beyond Microservices? by Sushil Kumar, Robin Systems
Containers: Life Beyond Microservices? by Sushil Kumar, Robin SystemsContainers: Life Beyond Microservices? by Sushil Kumar, Robin Systems
Containers: Life Beyond Microservices? by Sushil Kumar, Robin Systems
 
The History of Pets vs. Cattle ... And Using It Properly
The History of Pets vs. Cattle ... And Using It ProperlyThe History of Pets vs. Cattle ... And Using It Properly
The History of Pets vs. Cattle ... And Using It Properly
 

Ähnlich wie Puppet – Make stateful apps easier than stateless

Meteor Revolution: From DDP to Blaze Reactive Rendering
Meteor Revolution: From DDP to Blaze Reactive Rendering Meteor Revolution: From DDP to Blaze Reactive Rendering
Meteor Revolution: From DDP to Blaze Reactive Rendering Massimo Sgrelli
 
Advanced web application architecture Way2Web
Advanced web application architecture Way2WebAdvanced web application architecture Way2Web
Advanced web application architecture Way2WebMatthias Noback
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - TalkMatthias Noback
 
Thin client SPAs. Stream UI using web standards
Thin client SPAs. Stream UI using web standardsThin client SPAs. Stream UI using web standards
Thin client SPAs. Stream UI using web standardsStarcounter
 
What's New in .Net 4.5
What's New in .Net 4.5What's New in .Net 4.5
What's New in .Net 4.5Malam Team
 
REST - What's It All About? (SAP TechEd 2012, CD110)
REST - What's It All About? (SAP TechEd 2012, CD110)REST - What's It All About? (SAP TechEd 2012, CD110)
REST - What's It All About? (SAP TechEd 2012, CD110)Sascha Wenninger
 
How to – wrap soap web service around a database
How to – wrap soap web service around a databaseHow to – wrap soap web service around a database
How to – wrap soap web service around a databaseSon Nguyen
 
Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014Brian Cavalier
 
Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Josh Juneau
 
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...Edward Burns
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Bluegrass Digital
 
RESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel MardjanRESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel MardjanJexia
 
Building and Scaling a WebSockets Pubsub System
Building and Scaling a WebSockets Pubsub SystemBuilding and Scaling a WebSockets Pubsub System
Building and Scaling a WebSockets Pubsub SystemKapil Reddy
 
IBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClassIBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClassPaul Withers
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkFabio Tiriticco
 
Real-Time with Flowdock
Real-Time with FlowdockReal-Time with Flowdock
Real-Time with FlowdockFlowdock
 

Ähnlich wie Puppet – Make stateful apps easier than stateless (20)

Meteor Revolution: From DDP to Blaze Reactive Rendering
Meteor Revolution: From DDP to Blaze Reactive Rendering Meteor Revolution: From DDP to Blaze Reactive Rendering
Meteor Revolution: From DDP to Blaze Reactive Rendering
 
Advanced web application architecture Way2Web
Advanced web application architecture Way2WebAdvanced web application architecture Way2Web
Advanced web application architecture Way2Web
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - Talk
 
Thin client SPAs. Stream UI using web standards
Thin client SPAs. Stream UI using web standardsThin client SPAs. Stream UI using web standards
Thin client SPAs. Stream UI using web standards
 
What's New in .Net 4.5
What's New in .Net 4.5What's New in .Net 4.5
What's New in .Net 4.5
 
REST - What's It All About? (SAP TechEd 2012, CD110)
REST - What's It All About? (SAP TechEd 2012, CD110)REST - What's It All About? (SAP TechEd 2012, CD110)
REST - What's It All About? (SAP TechEd 2012, CD110)
 
Meteor + React
Meteor + ReactMeteor + React
Meteor + React
 
How to – wrap soap web service around a database
How to – wrap soap web service around a databaseHow to – wrap soap web service around a database
How to – wrap soap web service around a database
 
Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014
 
Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Migrating to Jakarta EE 10
Migrating to Jakarta EE 10
 
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015
 
RESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel MardjanRESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel Mardjan
 
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
 
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
 
Building and Scaling a WebSockets Pubsub System
Building and Scaling a WebSockets Pubsub SystemBuilding and Scaling a WebSockets Pubsub System
Building and Scaling a WebSockets Pubsub System
 
IBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClassIBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClass
 
Switch to Backend 2023
Switch to Backend 2023Switch to Backend 2023
Switch to Backend 2023
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! Framework
 
Real-Time with Flowdock
Real-Time with FlowdockReal-Time with Flowdock
Real-Time with Flowdock
 

Kürzlich hochgeladen

SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profileakrivarotava
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Anthony Dahanne
 

Kürzlich hochgeladen (20)

SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profile
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024
 

Puppet – Make stateful apps easier than stateless

  • 1. Puppet MAKE STATEFUL APPS EASIER THAN STATELESS Marcin Warpechowski
 Starcounter - Sep 2015
  • 2. What is Puppet Protocol for remote JSON data synchronization. Uses JSON-Patch over HTTP or WebSocket, with optional Operational Transformation.
  • 3. What do we use it for? UI server-driven view-models SPOILER ALERT
  • 4. What is Puppet Pattern Protocol for remote JSON data synchronization. Uses JSON-Patch over HTTP or WebSocket, with optional Operational Transformation.
  • 5. What is Puppet Pattern Standards Protocol for remote JSON data synchronization. Uses JSON-Patch over HTTP or WebSocket, with optional Operational Transformation.
  • 6. What is Puppet Pattern Standards OK, that’s ours but based on a well-researched principle Protocol for remote JSON data synchronization. Uses JSON-Patch over HTTP or WebSocket, with optional Operational Transformation.
  • 7. Why JSON • ECMA and IETF standard (ECMA-404, RFC 7159) • 7 kinds of values: string, number, object, array, true, false, null • this simplicity encourages thin client • ubiquitous (every platform supported)
  • 8. Why JSON • ECMA and IETF standard (ECMA-404, RFC 7159) • 7 kinds of values: string, number, object, array, true, false, null • this simplicity encourages thin client • ubiquitous (every platform supported)
  • 9. Why JSON-Patch • IETF standard (RFC 6902) • 3 major operations: add, replace, remove • 3 helper operations: copy, move, test • a JSON-Patch is a JSON document itself • reduces traffic
  • 10. Why JSON-Patch • 3 major operations: add, replace, remove • 3 helper operations: copy, move, test • a JSON-Patch is a JSON document itself • reduces traffic
  • 11. Puppet flow 1. Get HTML representation of the page 2. Get JSON representation of the page 3. Send any change as JSON-Patch (WebSocket or HTTP) 4. Send clicks on links as HTTP GET type JSON-Patch Elements in italic are not on the diagram
  • 12. Puppet solves problems • communicating changes to tree-structured data between two peers • in our case: synchronizing UI state between the server and the client • removes the need for glue code (a real data object is synced) • going out of sync (Operational Transformation)
  • 13. Benefits of Puppet for the UI SECURITY No hackable code in the client COMPOSABILITY JSON trees can be nested MITIGATING NETWORK LATENCY Client sends the data as you type. Server already has the data when you press OK TEMPLATING SYSTEMS Polymer, Angular, Handlebars, etc bind JSON nicely to HTML MORPHABILITY UI can respond to changes by replacing parts of the tree DEEP URLS Links morph the state if opened in the same tab. They reload the page only if you open a new tab
  • 14. Triggering changes • when the client sends a change, this is just an intent • it is up to the server to accept, process and react to this intent • ...or to reject it
  • 15. Triggering changes • Altering FirstName$ or LastName$ on the client 
 can cause the server to change the FullName • Altering Price$ or Quantity$ on the client 
 can cause the server to change the Total • Pressing a button can be sent as incrementation of a number 
 or change from false -> true • Any change can result in morphing of the view 
 (alteration of small or big part of JSON tree)
  • 16. Why HTTP • W3C and IETF standard (multiple RFC) • ability to ask for representation as JSON and HTML • ability to send changes as JSON-Patch or JSON • ability to morph documents
  • 20. Why WebSocket • W3C and IETF standard (RFC 6455) • messages don’t have headers • important when message is smaller than the header • messages delivered in order • ability to push
  • 22. Why Operational Transformation • web reality: the client and the server are doing concurrent changes asynchronously (most of the time out-of-sync) • goal: apply patches correctly without freezing UI or disallowing server push • how does it work: transforms any remote operation over operations that were generated locally
  • 23. Without Operational Transformation CLIENT SERVER “ABCDE” “ABCDE” “ABCE” “ACDE” “ACD”“ACE” C = Del 4 S = Del 2 S = Del 2 C = Del 4 TIME
  • 24. With Operational Transformation CLIENT SERVER TIME “ABCDE” “ABCDE” “ABCE” “ACDE” “ACD”“ACE” C = Del 4 S = Del 2 S’ = Del 2 C’ = Del 3
  • 25. What Puppet is not • RPC • Collaboration tool
  • 26. What Puppet is not • RPC • Collaboration tool But can be used as such
  • 27. Puppet implementations JavaScript:
 PuppetJS Framework agnostic (tested with Polymer, Angular and plain JS) Oriented for the role of the client (server usage samples in development) Web Components:
 puppet-client Native Web Component API Plays well with Polymer C#:
 Starcounter Oriented for the role of the server Working on releasing it as NuGet package that can be used as a server or as a client
  • 28. Demo • Procurement • trigger server change of InvoiceRow Total in Chrome console:
 
 var  o  =  document.querySelector('puppet-­‐client').obj.workspaces[0]
 o.Procurement.CurrentPage.Procurement.PurchaseOrderItems[0].Price$++ • Chatter • push new Chat message from Chrome console:
 
 o.Chatter.CurrentPage.Chatter.ChatMessage.Text$  =  "Hi  from  console!”
 o.Chatter.CurrentPage.Chatter.Send$++
  • 29. Future topics • Puppet does not replace REST, it enhances it • Puppet shares some mindset with DDP, Falcor, ShareJS • Detailed view into OT
  • 30. GitHub: https://github.com/puppetjs/puppetjs (see Wiki) Twitter: @starcounterdb, @warpech Thanks! More info on .io