SlideShare una empresa de Scribd logo
1 de 50
Descargar para leer sin conexión
I S O M O R P H I C R E A LT I M E
A P P S W I T H
FA C E B O O K - Q U A L I T Y A P P S W I T H O U T FA C E B O O K ’ S M O N E Y
METE R
Stephan Hochhaus
@yauh
T H E R O A D S O FA R
• Applications in the browser
• JavaScript everywhere
• Overwhelming tools
A P P S I N T H E B R O W S E R
U S E R S E X P E C T M O R E
J AVA S C R I P T C O N Q U E R E D T H E S E R V E R
N O D E . J S
J AVA S C R I P T C O N Q U E R E D T H E S E R V E R
N O D E . J S
J AVA S C R I P T C O N Q U E R E D T H E S E R V E R
N O D E . J S
J AVA S C R I P T C O N Q U E R E D T H E S E R V E R
N O D E . J S
J AVA S C R I P T C O N Q U E R E D T H E S E R V E R
N O D E . J S
J AVA S C R I P T C O N Q U E R E D T H E S E R V E R
N O D E . J S
J AVA S C R I P T C O N Q U E R E D T H E S E R V E R
N O D E . J S
W E B D E V I S R O C K E T S C I E N C E
L A R G E T E A M S B U I L D L A R G E A P P S
A M E T E O R A P P E A R E D
N O W
A M E T E O R A P P E A R E D
N O W
– N I C K M A R T I N
At Meteor, we hope to democratize web app development by
empowering anyone, anywhere to create apps.
T H E M E T E O R S TA C K
N O T O N LY F O R R O C K S TA R S
T H E M E T E O R S TA C K
N O T O N LY F O R R O C K S TA R S
The Database
The Server Engine
Bunch of Libs
T H E M E T E O R S TA C K
N O T O N LY F O R R O C K S TA R S
The CLI Tool
The Database
The Server Engine
Bunch of Libs
T H E M E T E O R S TA C K
N O T O N LY F O R R O C K S TA R S
The CLI Tool
The Database
The Server Engine
Bunch of Libs
1. I S O M O R P H I S M
2. S Y N C H R O N I C I T Y
3. R E A C T I V I T Y
4. S M A R T C L I E N T S
W H Y I S I T E A S Y T O L E A R N ?
D O C U M E N T- B A S E D D ATA B A S E S
M O N G O D B - T H E K E Y T O I S O M O R P H I S M
D O C U M E N T- B A S E D D ATA B A S E S
M O N G O D B - T H E K E Y T O I S O M O R P H I S M
A collection
D O C U M E N T- B A S E D D ATA B A S E S
M O N G O D B - T H E K E Y T O I S O M O R P H I S M
A collection
A document
Lots of fields
DB Server Client
SELECT name
FROM users
WHERE id = 12345
GET
http://server/users/

name/12345
var name =
response.name;
A C C E S S I N G D A TA T H R O U G H O U T T H E S TA C K
I S O M O R P H I C A P P L I C AT I O N S
DB Server Client
SELECT name
FROM users
WHERE id = 12345
GET
http://server/users/

name/12345
var name =
response.name;
A C C E S S I N G D A TA T H R O U G H O U T T H E S TA C K
Users.find(
{_id: 12345},
{fields:
{name : 1}
}
)
Users.find(
{_id: 12345},
{fields:
{name : 1}
}
)
Users.find(
{_id: 12345},
{fields:
{name : 1}
}
)
E V E N T E D A P P L I C AT I O N S N E E D C A L L B A C K S
N O D E . J S A N D T H E E V E N T L O O P
Event
queue
Event
Event
Event
Event
…
Node.js
Event Loop
Thread
pool
Disk
Network
Process
…
Single threaded
processing
Callback
split off to a
child process
C A L L B A C K H E L L
T H E D O W N S I D E O F N O D E J S
DB.connect(options, function(err, connection){
connection.query(something, function(err, document){
ExternalAPI.makeCall(document, function(err, apiResult){
connection.save(apiResult, function(err, saveResult){
request.end(saveResult);
});
});
});
});
S Y N C H R O N I C I T Y W I T H M E T E O R
T H E P O W E R O F F I B E R S
DB.connect(options, function (err, con) {
connection = con;
});
connection.query(something, function (err, doc) {
document = doc;
});
ExternalAPI.makeCall(document, function (err, res) {
apiResult = res;
});
connection.save(apiResult, function (err, res) {
saveResult = res;
});
request.end(saveResult);
Fiber #1
0 10 20 30 40
milliseconds
By default Meteor
creates one fiber
per client
DB.connect
Wait
(idle CPU time)
Event Loop
connection.query
ExternalAPI.makeCall
connection.save
request.end
S Y N C H R O N I C I T Y W I T H M E T E O R
T H E P O W E R O F F I B E R S
N O M O R E E V E N T- S PA G H E T T I S
R E A C T I V I T Y
R E A C T I V I T Y
R E A C T I V I T Y
Traditional programming
•var a = 2;
var b = 5;
var c = a + b;
console.log(c);
# c is 7
R E A C T I V I T Y
Traditional programming
•var a = 2;
var b = 5;
var c = a + b;
console.log(c);
# c is 7
•a = 5;
console.log(c);
# c is still 7
R E A C T I V I T Y
Traditional programming
•var a = 2;
var b = 5;
var c = a + b;
console.log(c);
# c is 7
•a = 5;
console.log(c);
# c is still 7
•c = a + b;
console.log(c);
# c is finally 10
R E A C T I V I T Y
Traditional programming
•var a = 2;
var b = 5;
var c = a + b;
console.log(c);
# c is 7
•a = 5;
console.log(c);
# c is still 7
•c = a + b;
console.log(c);
# c is finally 10
Reactive programming
•var a = 2;
var b = 5;
var c = a + b;
console.log(c);
# c is 7
R E A C T I V I T Y
Traditional programming
•var a = 2;
var b = 5;
var c = a + b;
console.log(c);
# c is 7
•a = 5;
console.log(c);
# c is still 7
•c = a + b;
console.log(c);
# c is finally 10
Reactive programming
•var a = 2;
var b = 5;
var c = a + b;
console.log(c);
# c is 7
•a = 5;
console.log(c);
# c is magically 10
S M A R T C L I E N T S
R E M O T E A P P S W I T H B I - D I R E C T I O N A L C O M M U N I C A T I O N
M E T E O R C O M M U N I C AT E S
R E M O T E A P P S W I T H B I - D I R E C T I O N A L C O M M U N I C A T I O N
App
Database
Server
Livequery
App
MiniDB
Client
Blaze
Tracker
HTTP
M E T E O R C O M M U N I C AT E S
R E M O T E A P P S W I T H B I - D I R E C T I O N A L C O M M U N I C A T I O N
App
Database
Server
Livequery
App
MiniDB
Client
Blaze
Tracker
HTTP
Static assets
HTML, JS, CSS, JPG, PNG, etc
The initial request and all static resources are transferred via HTTP
M E T E O R C O M M U N I C AT E S
R E M O T E A P P S W I T H B I - D I R E C T I O N A L C O M M U N I C A T I O N
App
Database
Server
Livequery
App
MiniDB
Client
Blaze
Tracker
HTTP
Remote Procedure Calls
Data subscriptions
DDP via WebSocket
Clients call server functions remotely via DDP
and the server returns data as JSON objects
M E T E O R C O M M U N I C AT E S
R E M O T E A P P S W I T H B I - D I R E C T I O N A L C O M M U N I C A T I O N
App
Database
Server
Livequery
App
MiniDB
Client
Blaze
Tracker
HTTP
Remote Procedure Calls
Data subscriptions
DDP via WebSocket
Clients call server functions remotely via DDP
and the server returns data as JSON objects
LiveQuery watches for
changes and pushes
data to all subscribed
clients
M E T E O R C O M M U N I C AT E S
R E M O T E A P P S W I T H B I - D I R E C T I O N A L C O M M U N I C A T I O N
App
Database
Server
Livequery
App
MiniDB
Client
Blaze
Tracker
HTTP
Remote Procedure Calls
Data subscriptions
DDP via WebSocket
Clients call server functions remotely via DDP
and the server returns data as JSON objects
LiveQuery watches for
changes and pushes
data to all subscribed
clients
Tracker triggers reactive
updates, e.g. in the UI
powered by Blaze
C O D E & PA C K A G E S
E X T E N D I N G M E T E O R
C O D E & PA C K A G E S
E X T E N D I N G M E T E O R
Our code
C O D E & PA C K A G E S
E X T E N D I N G M E T E O R
Packages
Our code
I N S TA L L M E T E O R
L E T ’ S B U I L D
Linux, Mac:
$ curl https://install.meteor.com/ | sh
Windows:
https://www.meteor.com/install
TA L K I N G T O T H E T W I T T E R A P I
E X T E N D I N G M E T E O R W I T H O A U T H
External API
Using a
package
M U LT I P L E P L AT F O R M S
A S I N G L E C O D E B A S E - M A N Y D E P L O Y M E N T S
M U LT I P L E P L AT F O R M S
A S I N G L E C O D E B A S E - M A N Y D E P L O Y M E N T S
Server/
Client
M U LT I P L E P L AT F O R M S
A S I N G L E C O D E B A S E - M A N Y D E P L O Y M E N T S
Mobile
Server/
Client

Más contenido relacionado

La actualidad más candente

La actualidad más candente (18)

Smart Contracts Technical Overview - Meetup Roma - 17/09/19
Smart Contracts Technical Overview - Meetup Roma - 17/09/19Smart Contracts Technical Overview - Meetup Roma - 17/09/19
Smart Contracts Technical Overview - Meetup Roma - 17/09/19
 
The Case for Competitive Mobile Gaming - Peter Heinrich
The Case for Competitive Mobile Gaming - Peter HeinrichThe Case for Competitive Mobile Gaming - Peter Heinrich
The Case for Competitive Mobile Gaming - Peter Heinrich
 
Getting Started with the Amazon GameOn API - Peter Heinrich
Getting Started with the Amazon GameOn API - Peter HeinrichGetting Started with the Amazon GameOn API - Peter Heinrich
Getting Started with the Amazon GameOn API - Peter Heinrich
 
톰캣 #02-설치환경
톰캣 #02-설치환경톰캣 #02-설치환경
톰캣 #02-설치환경
 
Svelte (adjective): Attractively thin, graceful, and stylish
Svelte (adjective): Attractively thin, graceful, and stylishSvelte (adjective): Attractively thin, graceful, and stylish
Svelte (adjective): Attractively thin, graceful, and stylish
 
Xcode Survival Guide
Xcode Survival GuideXcode Survival Guide
Xcode Survival Guide
 
wreewrer
wreewrerwreewrer
wreewrer
 
Consistency, Availability, Partition: Make Your Choice
Consistency, Availability, Partition: Make Your ChoiceConsistency, Availability, Partition: Make Your Choice
Consistency, Availability, Partition: Make Your Choice
 
A Prettier Printer
A Prettier PrinterA Prettier Printer
A Prettier Printer
 
Asynchronous data processing
Asynchronous data processingAsynchronous data processing
Asynchronous data processing
 
Productivity tips for developers
Productivity tips for developersProductivity tips for developers
Productivity tips for developers
 
Call Execute For Everyone
Call Execute For EveryoneCall Execute For Everyone
Call Execute For Everyone
 
Crack.ba
Crack.baCrack.ba
Crack.ba
 
Put Down That Mouse
Put Down That MousePut Down That Mouse
Put Down That Mouse
 
Plone ♥︎ Python 3
Plone ♥︎ Python 3Plone ♥︎ Python 3
Plone ♥︎ Python 3
 
Easy HTML Tables in RStudio with Tabyl and kableExtra
Easy HTML Tables in RStudio with Tabyl and kableExtraEasy HTML Tables in RStudio with Tabyl and kableExtra
Easy HTML Tables in RStudio with Tabyl and kableExtra
 
Demystifying Unicode - Longhorn PHP 2021
Demystifying Unicode - Longhorn PHP 2021Demystifying Unicode - Longhorn PHP 2021
Demystifying Unicode - Longhorn PHP 2021
 
Whitepaper - Spinbackup Overview
Whitepaper - Spinbackup OverviewWhitepaper - Spinbackup Overview
Whitepaper - Spinbackup Overview
 

Similar a Meteor - not just for rockstars

SharePoint Saturday Redmond - Building solutions with the future in mind
SharePoint Saturday Redmond - Building solutions with the future in mindSharePoint Saturday Redmond - Building solutions with the future in mind
SharePoint Saturday Redmond - Building solutions with the future in mind
Chris Johnson
 

Similar a Meteor - not just for rockstars (20)

Vb & asp
Vb & aspVb & asp
Vb & asp
 
Angular server side rendering with NodeJS - In Pursuit Of Speed
Angular server side rendering with NodeJS - In Pursuit Of SpeedAngular server side rendering with NodeJS - In Pursuit Of Speed
Angular server side rendering with NodeJS - In Pursuit Of Speed
 
Monitoring and Logging in Wonderland
Monitoring and Logging in WonderlandMonitoring and Logging in Wonderland
Monitoring and Logging in Wonderland
 
AWS SEMINAR SERIES 2015 Perth
AWS SEMINAR SERIES 2015 PerthAWS SEMINAR SERIES 2015 Perth
AWS SEMINAR SERIES 2015 Perth
 
Fast api
Fast apiFast api
Fast api
 
Azure: Finding Success Beyond Test/Dev
Azure: Finding Success Beyond Test/DevAzure: Finding Success Beyond Test/Dev
Azure: Finding Success Beyond Test/Dev
 
Web Development for Managers
Web Development for ManagersWeb Development for Managers
Web Development for Managers
 
Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016 Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016
 
AWS Seminar Series 2015 Melbourne
AWS Seminar Series 2015 MelbourneAWS Seminar Series 2015 Melbourne
AWS Seminar Series 2015 Melbourne
 
Simple Crossplatform REST-Service with .NET, Vagrant and Docker
Simple Crossplatform REST-Service with .NET, Vagrant and DockerSimple Crossplatform REST-Service with .NET, Vagrant and Docker
Simple Crossplatform REST-Service with .NET, Vagrant and Docker
 
AWS SeMINAR SERIES 2015 Sydney
AWS SeMINAR SERIES 2015 SydneyAWS SeMINAR SERIES 2015 Sydney
AWS SeMINAR SERIES 2015 Sydney
 
Auckland AWS Seminar Series
Auckland AWS Seminar SeriesAuckland AWS Seminar Series
Auckland AWS Seminar Series
 
AWS Seminar Series 2015 Brisbane
AWS Seminar Series 2015 BrisbaneAWS Seminar Series 2015 Brisbane
AWS Seminar Series 2015 Brisbane
 
SharePoint Saturday Redmond - Building solutions with the future in mind
SharePoint Saturday Redmond - Building solutions with the future in mindSharePoint Saturday Redmond - Building solutions with the future in mind
SharePoint Saturday Redmond - Building solutions with the future in mind
 
Zend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHPZend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHP
 
Puppet Camp Sydney 2014 - Evolving Design Patterns in AWS
Puppet Camp Sydney 2014 - Evolving Design Patterns in AWSPuppet Camp Sydney 2014 - Evolving Design Patterns in AWS
Puppet Camp Sydney 2014 - Evolving Design Patterns in AWS
 
Microservices With Spring Boot and Spring Cloud Netflix
Microservices With Spring Boot and Spring Cloud NetflixMicroservices With Spring Boot and Spring Cloud Netflix
Microservices With Spring Boot and Spring Cloud Netflix
 
Nuno Job - what's next for software - ANDdigital tech summit
Nuno Job - what's next for software - ANDdigital tech summitNuno Job - what's next for software - ANDdigital tech summit
Nuno Job - what's next for software - ANDdigital tech summit
 
Keynote - AWS Summit Milano 2018
Keynote - AWS Summit Milano 2018Keynote - AWS Summit Milano 2018
Keynote - AWS Summit Milano 2018
 
GraphQL, l'avenir du REST ?
GraphQL, l'avenir du REST ?GraphQL, l'avenir du REST ?
GraphQL, l'avenir du REST ?
 

Más de Stephan Hochhaus

Más de Stephan Hochhaus (8)

Erfolgreich trotz Daten - Wie datengetriebene Unternehmen funktionieren
Erfolgreich trotz Daten - Wie datengetriebene Unternehmen funktionierenErfolgreich trotz Daten - Wie datengetriebene Unternehmen funktionieren
Erfolgreich trotz Daten - Wie datengetriebene Unternehmen funktionieren
 
Weltvermessen mit OpenDataCam - Wie ich einmal eine Viertelmillionen Autos ge...
Weltvermessen mit OpenDataCam - Wie ich einmal eine Viertelmillionen Autos ge...Weltvermessen mit OpenDataCam - Wie ich einmal eine Viertelmillionen Autos ge...
Weltvermessen mit OpenDataCam - Wie ich einmal eine Viertelmillionen Autos ge...
 
Business Value - Stop working for the trash can
Business Value - Stop working for the trash canBusiness Value - Stop working for the trash can
Business Value - Stop working for the trash can
 
Walk of Claim - A Meteor Meetup presentation
Walk of Claim - A Meteor Meetup presentationWalk of Claim - A Meteor Meetup presentation
Walk of Claim - A Meteor Meetup presentation
 
Introduction to Meteor - revised edition
Introduction to Meteor - revised editionIntroduction to Meteor - revised edition
Introduction to Meteor - revised edition
 
Automatisierte infrastruktur mit ansible
Automatisierte infrastruktur mit ansibleAutomatisierte infrastruktur mit ansible
Automatisierte infrastruktur mit ansible
 
Testing MeteorJS using CasperJS
Testing MeteorJS using CasperJSTesting MeteorJS using CasperJS
Testing MeteorJS using CasperJS
 
LaTeX für Geisteswissenschaftler
LaTeX für GeisteswissenschaftlerLaTeX für Geisteswissenschaftler
LaTeX für Geisteswissenschaftler
 

Último

Último (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Meteor - not just for rockstars

  • 1. I S O M O R P H I C R E A LT I M E A P P S W I T H FA C E B O O K - Q U A L I T Y A P P S W I T H O U T FA C E B O O K ’ S M O N E Y METE R Stephan Hochhaus @yauh
  • 2. T H E R O A D S O FA R • Applications in the browser • JavaScript everywhere • Overwhelming tools
  • 3. A P P S I N T H E B R O W S E R U S E R S E X P E C T M O R E
  • 4. J AVA S C R I P T C O N Q U E R E D T H E S E R V E R N O D E . J S
  • 5. J AVA S C R I P T C O N Q U E R E D T H E S E R V E R N O D E . J S
  • 6. J AVA S C R I P T C O N Q U E R E D T H E S E R V E R N O D E . J S
  • 7. J AVA S C R I P T C O N Q U E R E D T H E S E R V E R N O D E . J S
  • 8. J AVA S C R I P T C O N Q U E R E D T H E S E R V E R N O D E . J S
  • 9. J AVA S C R I P T C O N Q U E R E D T H E S E R V E R N O D E . J S
  • 10. J AVA S C R I P T C O N Q U E R E D T H E S E R V E R N O D E . J S
  • 11. W E B D E V I S R O C K E T S C I E N C E L A R G E T E A M S B U I L D L A R G E A P P S
  • 12. A M E T E O R A P P E A R E D N O W
  • 13. A M E T E O R A P P E A R E D N O W
  • 14.
  • 15. – N I C K M A R T I N At Meteor, we hope to democratize web app development by empowering anyone, anywhere to create apps.
  • 16. T H E M E T E O R S TA C K N O T O N LY F O R R O C K S TA R S
  • 17. T H E M E T E O R S TA C K N O T O N LY F O R R O C K S TA R S The Database The Server Engine Bunch of Libs
  • 18. T H E M E T E O R S TA C K N O T O N LY F O R R O C K S TA R S The CLI Tool The Database The Server Engine Bunch of Libs
  • 19. T H E M E T E O R S TA C K N O T O N LY F O R R O C K S TA R S The CLI Tool The Database The Server Engine Bunch of Libs
  • 20. 1. I S O M O R P H I S M 2. S Y N C H R O N I C I T Y 3. R E A C T I V I T Y 4. S M A R T C L I E N T S W H Y I S I T E A S Y T O L E A R N ?
  • 21. D O C U M E N T- B A S E D D ATA B A S E S M O N G O D B - T H E K E Y T O I S O M O R P H I S M
  • 22. D O C U M E N T- B A S E D D ATA B A S E S M O N G O D B - T H E K E Y T O I S O M O R P H I S M A collection
  • 23. D O C U M E N T- B A S E D D ATA B A S E S M O N G O D B - T H E K E Y T O I S O M O R P H I S M A collection A document Lots of fields
  • 24. DB Server Client SELECT name FROM users WHERE id = 12345 GET http://server/users/
 name/12345 var name = response.name; A C C E S S I N G D A TA T H R O U G H O U T T H E S TA C K
  • 25. I S O M O R P H I C A P P L I C AT I O N S DB Server Client SELECT name FROM users WHERE id = 12345 GET http://server/users/
 name/12345 var name = response.name; A C C E S S I N G D A TA T H R O U G H O U T T H E S TA C K Users.find( {_id: 12345}, {fields: {name : 1} } ) Users.find( {_id: 12345}, {fields: {name : 1} } ) Users.find( {_id: 12345}, {fields: {name : 1} } )
  • 26. E V E N T E D A P P L I C AT I O N S N E E D C A L L B A C K S N O D E . J S A N D T H E E V E N T L O O P Event queue Event Event Event Event … Node.js Event Loop Thread pool Disk Network Process … Single threaded processing Callback split off to a child process
  • 27. C A L L B A C K H E L L T H E D O W N S I D E O F N O D E J S DB.connect(options, function(err, connection){ connection.query(something, function(err, document){ ExternalAPI.makeCall(document, function(err, apiResult){ connection.save(apiResult, function(err, saveResult){ request.end(saveResult); }); }); }); });
  • 28. S Y N C H R O N I C I T Y W I T H M E T E O R T H E P O W E R O F F I B E R S DB.connect(options, function (err, con) { connection = con; }); connection.query(something, function (err, doc) { document = doc; }); ExternalAPI.makeCall(document, function (err, res) { apiResult = res; }); connection.save(apiResult, function (err, res) { saveResult = res; }); request.end(saveResult);
  • 29. Fiber #1 0 10 20 30 40 milliseconds By default Meteor creates one fiber per client DB.connect Wait (idle CPU time) Event Loop connection.query ExternalAPI.makeCall connection.save request.end S Y N C H R O N I C I T Y W I T H M E T E O R T H E P O W E R O F F I B E R S
  • 30. N O M O R E E V E N T- S PA G H E T T I S R E A C T I V I T Y
  • 31. R E A C T I V I T Y
  • 32. R E A C T I V I T Y Traditional programming •var a = 2; var b = 5; var c = a + b; console.log(c); # c is 7
  • 33. R E A C T I V I T Y Traditional programming •var a = 2; var b = 5; var c = a + b; console.log(c); # c is 7 •a = 5; console.log(c); # c is still 7
  • 34. R E A C T I V I T Y Traditional programming •var a = 2; var b = 5; var c = a + b; console.log(c); # c is 7 •a = 5; console.log(c); # c is still 7 •c = a + b; console.log(c); # c is finally 10
  • 35. R E A C T I V I T Y Traditional programming •var a = 2; var b = 5; var c = a + b; console.log(c); # c is 7 •a = 5; console.log(c); # c is still 7 •c = a + b; console.log(c); # c is finally 10 Reactive programming •var a = 2; var b = 5; var c = a + b; console.log(c); # c is 7
  • 36. R E A C T I V I T Y Traditional programming •var a = 2; var b = 5; var c = a + b; console.log(c); # c is 7 •a = 5; console.log(c); # c is still 7 •c = a + b; console.log(c); # c is finally 10 Reactive programming •var a = 2; var b = 5; var c = a + b; console.log(c); # c is 7 •a = 5; console.log(c); # c is magically 10
  • 37. S M A R T C L I E N T S R E M O T E A P P S W I T H B I - D I R E C T I O N A L C O M M U N I C A T I O N
  • 38. M E T E O R C O M M U N I C AT E S R E M O T E A P P S W I T H B I - D I R E C T I O N A L C O M M U N I C A T I O N App Database Server Livequery App MiniDB Client Blaze Tracker HTTP
  • 39. M E T E O R C O M M U N I C AT E S R E M O T E A P P S W I T H B I - D I R E C T I O N A L C O M M U N I C A T I O N App Database Server Livequery App MiniDB Client Blaze Tracker HTTP Static assets HTML, JS, CSS, JPG, PNG, etc The initial request and all static resources are transferred via HTTP
  • 40. M E T E O R C O M M U N I C AT E S R E M O T E A P P S W I T H B I - D I R E C T I O N A L C O M M U N I C A T I O N App Database Server Livequery App MiniDB Client Blaze Tracker HTTP Remote Procedure Calls Data subscriptions DDP via WebSocket Clients call server functions remotely via DDP and the server returns data as JSON objects
  • 41. M E T E O R C O M M U N I C AT E S R E M O T E A P P S W I T H B I - D I R E C T I O N A L C O M M U N I C A T I O N App Database Server Livequery App MiniDB Client Blaze Tracker HTTP Remote Procedure Calls Data subscriptions DDP via WebSocket Clients call server functions remotely via DDP and the server returns data as JSON objects LiveQuery watches for changes and pushes data to all subscribed clients
  • 42. M E T E O R C O M M U N I C AT E S R E M O T E A P P S W I T H B I - D I R E C T I O N A L C O M M U N I C A T I O N App Database Server Livequery App MiniDB Client Blaze Tracker HTTP Remote Procedure Calls Data subscriptions DDP via WebSocket Clients call server functions remotely via DDP and the server returns data as JSON objects LiveQuery watches for changes and pushes data to all subscribed clients Tracker triggers reactive updates, e.g. in the UI powered by Blaze
  • 43. C O D E & PA C K A G E S E X T E N D I N G M E T E O R
  • 44. C O D E & PA C K A G E S E X T E N D I N G M E T E O R Our code
  • 45. C O D E & PA C K A G E S E X T E N D I N G M E T E O R Packages Our code
  • 46. I N S TA L L M E T E O R L E T ’ S B U I L D Linux, Mac: $ curl https://install.meteor.com/ | sh Windows: https://www.meteor.com/install
  • 47. TA L K I N G T O T H E T W I T T E R A P I E X T E N D I N G M E T E O R W I T H O A U T H External API Using a package
  • 48. M U LT I P L E P L AT F O R M S A S I N G L E C O D E B A S E - M A N Y D E P L O Y M E N T S
  • 49. M U LT I P L E P L AT F O R M S A S I N G L E C O D E B A S E - M A N Y D E P L O Y M E N T S Server/ Client
  • 50. M U LT I P L E P L AT F O R M S A S I N G L E C O D E B A S E - M A N Y D E P L O Y M E N T S Mobile Server/ Client