SlideShare a Scribd company logo
1 of 25
Download to read offline
N U R T U R E V E N T U R E
METEORThe Meteor Revolution
Massimo Sgrelli @ NURTURE VENTURE
meteorlog.com
Towards Connected Clients
•Model View Controller (MVC)
• Changed in the last 5 years
•How?
• Most modern applications moved the Model on the client and access
the server through API
• Many Javascript frameworks pop up to address this need
• Some frameworks like Rails still keep most of the login on the server
•Why move things on the client?
• To reduce latency and provide responsive applications
meteorlog.com
What’s Meteor
Meteor is a platform to build web and mobile
applications using just Javascript.
It’s been built on top of Nodejs.
•What’s a platform?
•Why is it different from a framework?
meteorlog.com
A Platform
•A framework
• Simplifies app creation
• Solves part of the problem
•A platform
• Provides you the building block to build a complete application
• It’s all-in-one solution for a broad range of problems
Meteor is a modular platform. It provides its own solutions, but it’s
open to integration with other frameworks like Angular and React.
meteorlog.com
How We Got Here
•’70 Mainframe era
• DB, network, dumb terminals
• 3270
•’80 Client-Server era
• DBDB, network, fat client applications
• Corba, DCOM, structure data sent
•’90 Web era
• DB, LAMP, HTTP/TCP, browsers
• HTML, data
•NOW
• DB
• Mobile = a whole computer again
APP
SCREENS
APP
RPC, CORBA, DCOM
LAMP
HTTP/TCP
DATA, WHY HTTP !?!
API
meteorlog.com
No Refresh Button
•2015 ~ ’80
• We need to move data
• Different users using iOS, Android, HTML …
• You don’t push the refresh button anymore. It just happen that
your data get updated when needed
APP
APP
APP
APP
meteorlog.com
Applications: What Changed
•They use (massively)
• Live updating
• Collaborative techniques
• Mobile
•They move data in real time, back and forth,
between server and client(s)
meteorlog.com
Meteor Architecture
APP
HOW HTTP WORKS
GET/POST
200OK ….
• It was designed to get documents
• Pretty simple
meteorlog.com
Meteor Architecture
APP
DDP (Distributed Data Protocol)
• DDP runs over web sockets (not HTTP)
• DDP is a simple protocol for fetching structured data
from a server and receiving live updates when those
data change.
web socket APP
meteorlog.com
Just in Case You Don’t Know…
•Socket
• 2 end points can talk to each other over a wire/pipe
• Data are sent in order, reliably and with no changes
•Web Socket
• You can do the same between a web browser and a point in the
cloud
meteorlog.com
How DDP Works
•Publication
• Client subscribe a Publication from the server
• Server starts exchanging data and messages (added, changed, remove)
• Ex. Subscribe Leaderboard publications: scores —> clients
•RPCs
• Client and server can call remote “methods”
• Ex. addToScore() <—
• Ex. result() —>
•JSON data are exchanged
feedthefounders
N U R T U R E V E N T U R E
DDP is like "REST for websockets"
It standardizes how real time
applications should talk to each other.
… or let’s say it’s just a few JSON
messages over a websocket.
meteorlog.com
Data
•How does data move?
•Where does it come from?
APP DDP APP
PUBLISH SUBSCRIBE
meteorlog.com
Respond To Changes Real Time
•The usual way it’s a lot of code to create a pub/sub mechanism using
some web socket library
•Reactive data
• As soon as data changes at the server, they are sent to clients subscribing those data
• HOW: Observable queries
DATA CHANGESPUBLISH SUBSCRIBE
meteorlog.com
Watch for data changes
{
name : “Max”,
score : 10
}
{
name : “Alex”,
score : 20
}
• MongoDB doesn’t do that
• How to change a traditional database in a real time database?
meteorlog.com
Observing DB Changes
•Poll & Diff —> Expensive
• Computation and cost on the wire
• Latency
•OpLog Tailing
• Mongo admits a log for every
update it makes to the db
MASTER
SECONDARY SECONDARY
MONGO OPLOG
meteorlog.com
Latency is Still a Problem
MONGO
SECONDARY SECONDARY
METEOR HOOKS
UP HERE
100-200ms
APPAPP
CHANGE {name:”Max, score:15}
DATA CHANGED {name:”Max, score:15}
How do we solve
this?
meteorlog.com
How Meteor Solves This
MONGO
SECONDARY SECONDARY
METEOR HOOKS
UP HERE
100-200ms
APPAPP
LOCAL CACHE
(MINI MONGO)
The query language on the
client is the same API you
have at the server – Mongo
syntax :)
LIVEQUERY
meteorlog.com
Some Advantages of This Approach
•Code sharing
• This mechanism allows to share code between client and server
• Javascript both on client and server
• Mongo syntax between client and server
•Livequery
• Turns your database into a reactive database, with streaming
queries
• Mongo, Redis (experimental) + more on the way
meteorlog.com
Some Advantages of This Approach
•Latency compensation
• On the client first (fork), than server
• If the server fails, the client rolls back
Mini Mongo
SpeculationTruth
MONGO
Fork
meteorlog.com
Reactive Templating
•Blaze
• Make your templates reactive thanks to Tracker (1K library for transparent
reactive programming)
• Same purpose as Angular, Backbone, Ember, React, Polymer …
• Spacebar: Handlebar dialect + reactivity
• Great separation between UI and code
<template name="messages">
{{#if Template.subscriptionsReady}}
{{#each messages}}
{{> message}}
{{/each}}
{{/if}}
</template>
meteorlog.com
Transparent Reactive Programming?
•Reactive data binding
• Blaze to automatically set up callbacks to detect changes to the
template's data sources, recompute any values affected by the
change, and patch the DOM in place with the update.
•Template
• HTML file with Spacebar syntax
• Template manager file for event management and callbacks
(helpers) invoked every time a reactive data source changes
meteorlog.com
Application Directory Structure
./client
./server
./public
./private
./tests
everything else is loaded with on the client and the server:
./lib
meteorlog.com
A Sample <template name="messages">
{{#if Template.subscriptionsReady}}
{{#each messages}}
{{> message}}
{{/each}}
{{/if}}
</template>
<template name="message">
<div class="message">
<span id =“{{_id}}">{{{messageBody}}}</span>
</div>
</template>
Template.messages.onCreated(function() {
this.subscribe(‘messages’)
});
Template.messages.helpers({
‘messages’ : function() {
return Messages.find();
}
});
Template.message.helpers({
‘messageBody’ : function() {
return this.messageBody;
}
});
Messages = new Mongo.Collection(‘messages’);
Messages.publish(‘messages’, function() {
if (! this.userId) return this.ready();
return Message.find();
});
//SERVER
//CLIENT
//CLIENT AND SERVER
N U R T U R E V E N T U R E
INSTALL METEOR & START
HAVING FUN
Send me your questions to massimo.sgrelli@gmail.com
www.meteorlog.com
www.nurtureventure.com

More Related Content

What's hot

Building a Web Application with Kafka as your Database
Building a Web Application with Kafka as your DatabaseBuilding a Web Application with Kafka as your Database
Building a Web Application with Kafka as your Databaseconfluent
 
React + Flux = Joy
React + Flux = JoyReact + Flux = Joy
React + Flux = JoyJohn Need
 
Reactive Integrations - Caveats and bumps in the road explained
Reactive Integrations - Caveats and bumps in the road explained  Reactive Integrations - Caveats and bumps in the road explained
Reactive Integrations - Caveats and bumps in the road explained Markus Eisele
 
NYLI & The Cloud: Leveraging SaaS for Disaster Recovery, Cost Savings, and An...
NYLI & The Cloud: Leveraging SaaS for Disaster Recovery, Cost Savings, and An...NYLI & The Cloud: Leveraging SaaS for Disaster Recovery, Cost Savings, and An...
NYLI & The Cloud: Leveraging SaaS for Disaster Recovery, Cost Savings, and An...Ralph Monaco
 
Top 15 Exchange Questions that Senior Admin ask - Jaap Wesselius
Top 15 Exchange Questions that Senior Admin ask - Jaap WesseliusTop 15 Exchange Questions that Senior Admin ask - Jaap Wesselius
Top 15 Exchange Questions that Senior Admin ask - Jaap WesseliusKemp
 
R2DBC - Good Enough for Production?
R2DBC - Good Enough for Production?R2DBC - Good Enough for Production?
R2DBC - Good Enough for Production?Olexandra Dmytrenko
 
«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NET«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NETAlessandro Giorgetti
 
URP? Excuse You! The Three Metrics You Have to Know
URP? Excuse You! The Three Metrics You Have to Know URP? Excuse You! The Three Metrics You Have to Know
URP? Excuse You! The Three Metrics You Have to Know confluent
 
Stateful, Stateless and Serverless - Running Apache Kafka® on Kubernetes
Stateful, Stateless and Serverless - Running Apache Kafka® on KubernetesStateful, Stateless and Serverless - Running Apache Kafka® on Kubernetes
Stateful, Stateless and Serverless - Running Apache Kafka® on Kubernetesconfluent
 
Building a company-wide data pipeline on Apache Kafka - engineering for 150 b...
Building a company-wide data pipeline on Apache Kafka - engineering for 150 b...Building a company-wide data pipeline on Apache Kafka - engineering for 150 b...
Building a company-wide data pipeline on Apache Kafka - engineering for 150 b...LINE Corporation
 
Internet without internet
Internet without internetInternet without internet
Internet without internetXavier Coureau
 
Kyle Kingsbury Talks about the Jepsen Test: What VoltDB Learned About Data Ac...
Kyle Kingsbury Talks about the Jepsen Test: What VoltDB Learned About Data Ac...Kyle Kingsbury Talks about the Jepsen Test: What VoltDB Learned About Data Ac...
Kyle Kingsbury Talks about the Jepsen Test: What VoltDB Learned About Data Ac...VoltDB
 
Transformation During a Global Pandemic | Ashish Pandit and Scott Lee, Univer...
Transformation During a Global Pandemic | Ashish Pandit and Scott Lee, Univer...Transformation During a Global Pandemic | Ashish Pandit and Scott Lee, Univer...
Transformation During a Global Pandemic | Ashish Pandit and Scott Lee, Univer...HostedbyConfluent
 
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)Bill Condo
 
MongoDB and Machine Learning with Flowable
MongoDB and Machine Learning with FlowableMongoDB and Machine Learning with Flowable
MongoDB and Machine Learning with FlowableFlowable
 
Schemas Beyond The Edge
Schemas Beyond The EdgeSchemas Beyond The Edge
Schemas Beyond The Edgeconfluent
 
Websocket vs SSE - Paris.js - 24/06/15
Websocket vs SSE - Paris.js - 24/06/15Websocket vs SSE - Paris.js - 24/06/15
Websocket vs SSE - Paris.js - 24/06/15streamdata.io
 
Web-centric application architectures
Web-centric application architecturesWeb-centric application architectures
Web-centric application architecturesKosala Nuwan Perera
 
Can you build a Intranet with Modern SharePoint
Can you build a Intranet with Modern SharePointCan you build a Intranet with Modern SharePoint
Can you build a Intranet with Modern SharePointKnut Relbe-Moe [MVP, MCT]
 
Multi-DC Kafka
Multi-DC KafkaMulti-DC Kafka
Multi-DC Kafkaconfluent
 

What's hot (20)

Building a Web Application with Kafka as your Database
Building a Web Application with Kafka as your DatabaseBuilding a Web Application with Kafka as your Database
Building a Web Application with Kafka as your Database
 
React + Flux = Joy
React + Flux = JoyReact + Flux = Joy
React + Flux = Joy
 
Reactive Integrations - Caveats and bumps in the road explained
Reactive Integrations - Caveats and bumps in the road explained  Reactive Integrations - Caveats and bumps in the road explained
Reactive Integrations - Caveats and bumps in the road explained
 
NYLI & The Cloud: Leveraging SaaS for Disaster Recovery, Cost Savings, and An...
NYLI & The Cloud: Leveraging SaaS for Disaster Recovery, Cost Savings, and An...NYLI & The Cloud: Leveraging SaaS for Disaster Recovery, Cost Savings, and An...
NYLI & The Cloud: Leveraging SaaS for Disaster Recovery, Cost Savings, and An...
 
Top 15 Exchange Questions that Senior Admin ask - Jaap Wesselius
Top 15 Exchange Questions that Senior Admin ask - Jaap WesseliusTop 15 Exchange Questions that Senior Admin ask - Jaap Wesselius
Top 15 Exchange Questions that Senior Admin ask - Jaap Wesselius
 
R2DBC - Good Enough for Production?
R2DBC - Good Enough for Production?R2DBC - Good Enough for Production?
R2DBC - Good Enough for Production?
 
«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NET«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NET
 
URP? Excuse You! The Three Metrics You Have to Know
URP? Excuse You! The Three Metrics You Have to Know URP? Excuse You! The Three Metrics You Have to Know
URP? Excuse You! The Three Metrics You Have to Know
 
Stateful, Stateless and Serverless - Running Apache Kafka® on Kubernetes
Stateful, Stateless and Serverless - Running Apache Kafka® on KubernetesStateful, Stateless and Serverless - Running Apache Kafka® on Kubernetes
Stateful, Stateless and Serverless - Running Apache Kafka® on Kubernetes
 
Building a company-wide data pipeline on Apache Kafka - engineering for 150 b...
Building a company-wide data pipeline on Apache Kafka - engineering for 150 b...Building a company-wide data pipeline on Apache Kafka - engineering for 150 b...
Building a company-wide data pipeline on Apache Kafka - engineering for 150 b...
 
Internet without internet
Internet without internetInternet without internet
Internet without internet
 
Kyle Kingsbury Talks about the Jepsen Test: What VoltDB Learned About Data Ac...
Kyle Kingsbury Talks about the Jepsen Test: What VoltDB Learned About Data Ac...Kyle Kingsbury Talks about the Jepsen Test: What VoltDB Learned About Data Ac...
Kyle Kingsbury Talks about the Jepsen Test: What VoltDB Learned About Data Ac...
 
Transformation During a Global Pandemic | Ashish Pandit and Scott Lee, Univer...
Transformation During a Global Pandemic | Ashish Pandit and Scott Lee, Univer...Transformation During a Global Pandemic | Ashish Pandit and Scott Lee, Univer...
Transformation During a Global Pandemic | Ashish Pandit and Scott Lee, Univer...
 
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
 
MongoDB and Machine Learning with Flowable
MongoDB and Machine Learning with FlowableMongoDB and Machine Learning with Flowable
MongoDB and Machine Learning with Flowable
 
Schemas Beyond The Edge
Schemas Beyond The EdgeSchemas Beyond The Edge
Schemas Beyond The Edge
 
Websocket vs SSE - Paris.js - 24/06/15
Websocket vs SSE - Paris.js - 24/06/15Websocket vs SSE - Paris.js - 24/06/15
Websocket vs SSE - Paris.js - 24/06/15
 
Web-centric application architectures
Web-centric application architecturesWeb-centric application architectures
Web-centric application architectures
 
Can you build a Intranet with Modern SharePoint
Can you build a Intranet with Modern SharePointCan you build a Intranet with Modern SharePoint
Can you build a Intranet with Modern SharePoint
 
Multi-DC Kafka
Multi-DC KafkaMulti-DC Kafka
Multi-DC Kafka
 

Similar to Meteor Revolution: From DDP to Blaze Reactive Rendering

Puppet – Make stateful apps easier than stateless
Puppet – Make stateful apps easier than statelessPuppet – Make stateful apps easier than stateless
Puppet – Make stateful apps easier than statelessStarcounter
 
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
 
Architectural peripherals of react by Vadym Zhiltsov
Architectural peripherals of react by Vadym ZhiltsovArchitectural peripherals of react by Vadym Zhiltsov
Architectural peripherals of react by Vadym ZhiltsovLohika_Odessa_TechTalks
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Jeremy Likness
 
Is It Fast? : Measuring MongoDB Performance
Is It Fast? : Measuring MongoDB PerformanceIs It Fast? : Measuring MongoDB Performance
Is It Fast? : Measuring MongoDB PerformanceTim Callaghan
 
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularEscaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularMark Leusink
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - TalkMatthias Noback
 
Plone FSR
Plone FSRPlone FSR
Plone FSRfulv
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to MicroservicesMahmoudZidan41
 
Microservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problemsMicroservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problemsŁukasz Sowa
 
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern AppsMeteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern AppsSashko Stubailo
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...Mark Leusink
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...Mark Roden
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkFabio Tiriticco
 

Similar to Meteor Revolution: From DDP to Blaze Reactive Rendering (20)

Meteor + React
Meteor + ReactMeteor + React
Meteor + React
 
Puppet – Make stateful apps easier than stateless
Puppet – Make stateful apps easier than statelessPuppet – Make stateful apps easier than stateless
Puppet – Make stateful apps easier than stateless
 
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
 
React Tech Salon
React Tech SalonReact Tech Salon
React Tech Salon
 
Architectural peripherals of react by Vadym Zhiltsov
Architectural peripherals of react by Vadym ZhiltsovArchitectural peripherals of react by Vadym Zhiltsov
Architectural peripherals of react by Vadym Zhiltsov
 
React js
React jsReact js
React js
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!
 
Is It Fast? : Measuring MongoDB Performance
Is It Fast? : Measuring MongoDB PerformanceIs It Fast? : Measuring MongoDB Performance
Is It Fast? : Measuring MongoDB Performance
 
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularEscaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - Talk
 
Plone FSR
Plone FSRPlone FSR
Plone FSR
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Real time web apps
Real time web appsReal time web apps
Real time web apps
 
Microservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problemsMicroservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problems
 
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern AppsMeteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
 
Meteor meetup
Meteor meetupMeteor meetup
Meteor meetup
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
 
Reactive Spring 5
Reactive Spring 5Reactive Spring 5
Reactive Spring 5
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! Framework
 

More from Massimo Sgrelli

Start Small Get Big Night partendo da Brescia
Start Small Get Big Night partendo da BresciaStart Small Get Big Night partendo da Brescia
Start Small Get Big Night partendo da BresciaMassimo Sgrelli
 
Presentazione al meeting Web De BS
Presentazione al meeting Web De BSPresentazione al meeting Web De BS
Presentazione al meeting Web De BSMassimo Sgrelli
 
Startupweekend 2011 brescia
Startupweekend 2011 bresciaStartupweekend 2011 brescia
Startupweekend 2011 bresciaMassimo Sgrelli
 
Make Italian Internet startups succeed for real
Make Italian Internet startups succeed for realMake Italian Internet startups succeed for real
Make Italian Internet startups succeed for realMassimo Sgrelli
 

More from Massimo Sgrelli (6)

Start Small Get Big Night partendo da Brescia
Start Small Get Big Night partendo da BresciaStart Small Get Big Night partendo da Brescia
Start Small Get Big Night partendo da Brescia
 
Master startup brescia
Master startup bresciaMaster startup brescia
Master startup brescia
 
Presentazione al meeting Web De BS
Presentazione al meeting Web De BSPresentazione al meeting Web De BS
Presentazione al meeting Web De BS
 
Anatomy of a good pitch
Anatomy of a good pitchAnatomy of a good pitch
Anatomy of a good pitch
 
Startupweekend 2011 brescia
Startupweekend 2011 bresciaStartupweekend 2011 brescia
Startupweekend 2011 brescia
 
Make Italian Internet startups succeed for real
Make Italian Internet startups succeed for realMake Italian Internet startups succeed for real
Make Italian Internet startups succeed for real
 

Recently uploaded

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 

Recently uploaded (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

Meteor Revolution: From DDP to Blaze Reactive Rendering

  • 1. N U R T U R E V E N T U R E METEORThe Meteor Revolution Massimo Sgrelli @ NURTURE VENTURE
  • 2. meteorlog.com Towards Connected Clients •Model View Controller (MVC) • Changed in the last 5 years •How? • Most modern applications moved the Model on the client and access the server through API • Many Javascript frameworks pop up to address this need • Some frameworks like Rails still keep most of the login on the server •Why move things on the client? • To reduce latency and provide responsive applications
  • 3. meteorlog.com What’s Meteor Meteor is a platform to build web and mobile applications using just Javascript. It’s been built on top of Nodejs. •What’s a platform? •Why is it different from a framework?
  • 4. meteorlog.com A Platform •A framework • Simplifies app creation • Solves part of the problem •A platform • Provides you the building block to build a complete application • It’s all-in-one solution for a broad range of problems Meteor is a modular platform. It provides its own solutions, but it’s open to integration with other frameworks like Angular and React.
  • 5. meteorlog.com How We Got Here •’70 Mainframe era • DB, network, dumb terminals • 3270 •’80 Client-Server era • DBDB, network, fat client applications • Corba, DCOM, structure data sent •’90 Web era • DB, LAMP, HTTP/TCP, browsers • HTML, data •NOW • DB • Mobile = a whole computer again APP SCREENS APP RPC, CORBA, DCOM LAMP HTTP/TCP DATA, WHY HTTP !?! API
  • 6. meteorlog.com No Refresh Button •2015 ~ ’80 • We need to move data • Different users using iOS, Android, HTML … • You don’t push the refresh button anymore. It just happen that your data get updated when needed APP APP APP APP
  • 7. meteorlog.com Applications: What Changed •They use (massively) • Live updating • Collaborative techniques • Mobile •They move data in real time, back and forth, between server and client(s)
  • 8. meteorlog.com Meteor Architecture APP HOW HTTP WORKS GET/POST 200OK …. • It was designed to get documents • Pretty simple
  • 9. meteorlog.com Meteor Architecture APP DDP (Distributed Data Protocol) • DDP runs over web sockets (not HTTP) • DDP is a simple protocol for fetching structured data from a server and receiving live updates when those data change. web socket APP
  • 10. meteorlog.com Just in Case You Don’t Know… •Socket • 2 end points can talk to each other over a wire/pipe • Data are sent in order, reliably and with no changes •Web Socket • You can do the same between a web browser and a point in the cloud
  • 11. meteorlog.com How DDP Works •Publication • Client subscribe a Publication from the server • Server starts exchanging data and messages (added, changed, remove) • Ex. Subscribe Leaderboard publications: scores —> clients •RPCs • Client and server can call remote “methods” • Ex. addToScore() <— • Ex. result() —> •JSON data are exchanged
  • 12. feedthefounders N U R T U R E V E N T U R E DDP is like "REST for websockets" It standardizes how real time applications should talk to each other. … or let’s say it’s just a few JSON messages over a websocket.
  • 13. meteorlog.com Data •How does data move? •Where does it come from? APP DDP APP PUBLISH SUBSCRIBE
  • 14. meteorlog.com Respond To Changes Real Time •The usual way it’s a lot of code to create a pub/sub mechanism using some web socket library •Reactive data • As soon as data changes at the server, they are sent to clients subscribing those data • HOW: Observable queries DATA CHANGESPUBLISH SUBSCRIBE
  • 15. meteorlog.com Watch for data changes { name : “Max”, score : 10 } { name : “Alex”, score : 20 } • MongoDB doesn’t do that • How to change a traditional database in a real time database?
  • 16. meteorlog.com Observing DB Changes •Poll & Diff —> Expensive • Computation and cost on the wire • Latency •OpLog Tailing • Mongo admits a log for every update it makes to the db MASTER SECONDARY SECONDARY MONGO OPLOG
  • 17. meteorlog.com Latency is Still a Problem MONGO SECONDARY SECONDARY METEOR HOOKS UP HERE 100-200ms APPAPP CHANGE {name:”Max, score:15} DATA CHANGED {name:”Max, score:15} How do we solve this?
  • 18. meteorlog.com How Meteor Solves This MONGO SECONDARY SECONDARY METEOR HOOKS UP HERE 100-200ms APPAPP LOCAL CACHE (MINI MONGO) The query language on the client is the same API you have at the server – Mongo syntax :) LIVEQUERY
  • 19. meteorlog.com Some Advantages of This Approach •Code sharing • This mechanism allows to share code between client and server • Javascript both on client and server • Mongo syntax between client and server •Livequery • Turns your database into a reactive database, with streaming queries • Mongo, Redis (experimental) + more on the way
  • 20. meteorlog.com Some Advantages of This Approach •Latency compensation • On the client first (fork), than server • If the server fails, the client rolls back Mini Mongo SpeculationTruth MONGO Fork
  • 21. meteorlog.com Reactive Templating •Blaze • Make your templates reactive thanks to Tracker (1K library for transparent reactive programming) • Same purpose as Angular, Backbone, Ember, React, Polymer … • Spacebar: Handlebar dialect + reactivity • Great separation between UI and code <template name="messages"> {{#if Template.subscriptionsReady}} {{#each messages}} {{> message}} {{/each}} {{/if}} </template>
  • 22. meteorlog.com Transparent Reactive Programming? •Reactive data binding • Blaze to automatically set up callbacks to detect changes to the template's data sources, recompute any values affected by the change, and patch the DOM in place with the update. •Template • HTML file with Spacebar syntax • Template manager file for event management and callbacks (helpers) invoked every time a reactive data source changes
  • 24. meteorlog.com A Sample <template name="messages"> {{#if Template.subscriptionsReady}} {{#each messages}} {{> message}} {{/each}} {{/if}} </template> <template name="message"> <div class="message"> <span id =“{{_id}}">{{{messageBody}}}</span> </div> </template> Template.messages.onCreated(function() { this.subscribe(‘messages’) }); Template.messages.helpers({ ‘messages’ : function() { return Messages.find(); } }); Template.message.helpers({ ‘messageBody’ : function() { return this.messageBody; } }); Messages = new Mongo.Collection(‘messages’); Messages.publish(‘messages’, function() { if (! this.userId) return this.ready(); return Message.find(); }); //SERVER //CLIENT //CLIENT AND SERVER
  • 25. N U R T U R E V E N T U R E INSTALL METEOR & START HAVING FUN Send me your questions to massimo.sgrelli@gmail.com www.meteorlog.com www.nurtureventure.com