SlideShare una empresa de Scribd logo
1 de 29
METEOR
Robert Dickert
@rdickert
robertdickert.com
Build high quality real-time apps quickly
PART I: WHY METEOR?
What is Meteor?
• Full-stack JavaScript Framework
• Build tool
• Package system
• Real-time protocol - DDP
• Built on Node.js
• Currently integrates with Mongodb (others to follow)
DEMO
What we saw
• Instant dev environment
• A working base app
• Smart packages
• Hot code push
• Code can run on client, server, or both
• Mongo api can be used locally to access server
• Reactive templates
• Data kept updated to all connected browsers
• Session store local – maintained through hot code pushes
• easy deployment to meteor.com
• bundle for deployment to any node.js environment
So Why Meteor?
• Real-time (chat, dashboard, games, etc.)
• Rapid prototyping
• Productive
• Declarative
• All JavaScript
Further resources
• docs.meteor.com and blog.meteor.com
• Discover Meteor (book) – highly recommended
• Meteor Weekly (newsletter)
• Meteor 101 screencast (Naomi Seyfer)
• www.eventedmind.com
• IRC
• Google Groups
• Github
• win.meteor.com – for Windows users
Questions?
PART II: REACTIVITY
How does Meteor achieve live client-side updates?
Meteor Advanced Topics
• Goal: useful for both beginners and advanced users
• A lot of “magic” in Meteor
• Is Meteor the jQuery of web app development?
Abstraction debt?
• Meteor’s hidden parts are in plain view – just go look
• Great chance to pick something to research and share
with the group
What is Reactivity?
• Reactivity describes a declarative data flow through
which changes propagate automatically.
• i.e., Data/variables update automatically when their upstream
dependencies change.
• Spreadsheet is the typical example
Lamest Demo Ever: Excel
Meteor Computations
A computation contains a stored function to be rerun
whenever required. A function running inside a
computation is said to be running in a reactive context.
_func:
function () {
return Session.get(“a1”)+ 1;
} .stop()
.invalidate()
a Deps.Computation:
Step 1: Put functions in computations
To place any function fn in a computation:
Templates and template helpers are automatically put in
a computation by Meteor.
Code in fn is said to be running in a reactive context. In a
reactive context,
Deps.active===true
handle = Deps.autorun(fn);
Demo: computations
Reactivity Requirements
Meteor Reactivity requires two things:
1. Run your code in a reactive context (e.g., with
Deps.autorun()).
2. Use a reactive data source inside the computation.
Other data sources will not update reactively.
Built-in Reactive Data Sources
• Session.get(“key”)
• Collection.find({sel})
• Meteor.user()
• Meteor.userId()
• Meteor.status()
• <subscription>.ready()
• Meteor.loggingIn()
Or use one from an outside module
e.g. Iron Router’s Router.current()
Making a reactive data source
Why?
• Control what to reactively respond to
• Create a package with reactive API
• Better code organization (Session === global?)
• To really understand what you are doing
Reactive Data Source is In Charge
• <data source>.get(): Data source stores the current
computation in a list of dependencies.
• <data source>.set(): Data source calls the .invalidate()
method on each computation in its list.
Comp id=1
Comp id=2
Comp id=3
id=1
Id=2
Id=3
Reactive
Data Source
source.get()
Comp id=1
Comp id=2
Comp id=3
id=1
Id=2
Id=3
Reactive
Data Source
invalidate()
Registering dependencies Invalidating dependencies on change
Deps.Dependency object
To create a reactive data source:
• Create a new Deps.Dependency()
• Call its .depend() method to register a computation
• Call its .changed() method to invalidate all dependencies
_dependentsById:
.changed()
Computation {_id:1}
Computation {_id:2}
Computation {_id:3}
.depend()
Demo – make a reactive data source
Quiz: Will this update reactively?
Session.set('a', 1);
var x = Session.get('a')
Deps.autorun(function () {
console.log(x); //console logs 1
});
Session.set ('a', 2); //console logs ???
What we didn’t cover
• Cascading dependencies and Deps.flush()
• Cleanup and other implementation details.
• Other Meteor packages that play a part in full-stack
reactivity
• Spark/UI
• Publish/subscribe
• Events
• Observe and other callback-based mechanisms
• Remember, Deps works on the client only!
Resources
• robertdickert.com: Why Is My Meteor App Not Updating
Reactively?
• https://github.com/meteor/meteor/tree/devel/packages/de
ps
• www.eventedmind.com
Questions?
Other possible surprises
• Computations run the whole function
• You need to .stop() unneeded computations
• Deps does not run on the server
• Know the difference between this and other Meteor
packages that playa part in “full-stack reactivity”
• Spark/UI
• Publish/subscribe
• Events
• Observe and other callback-based mechanisms
The data source is in charge
1. Stores computations in Deps.Dependency instance
2. Decides when to register a dependency
(dependency.depend())
3. Triggers the .invalidate() method of every dependent
computation (dependency.changed()).
• B1 needs to be rerun over and over
• It needs to be rerun when A1 changes
 B1 is dependent on A1
• B1 is a computation (aka “reactive context”)
• A1 is a reactive data source
Meteor Features
• One language
• Database everywhere
• Latency compensation
• Full stack reactivity
• Hot code pushes
• Low-friction prototyping and deployment

Más contenido relacionado

La actualidad más candente

Reactive java - Reactive Programming + RxJava
Reactive java - Reactive Programming + RxJavaReactive java - Reactive Programming + RxJava
Reactive java - Reactive Programming + RxJavaNexThoughts Technologies
 
Deploying Microservice on Docker
Deploying Microservice on DockerDeploying Microservice on Docker
Deploying Microservice on DockerKnoldus Inc.
 
Prometheus Training
Prometheus TrainingPrometheus Training
Prometheus TrainingTim Tyler
 
Azure Function Workflow
Azure Function WorkflowAzure Function Workflow
Azure Function WorkflowAndrea Tosato
 
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark - Demi Be...
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark  - Demi Be...S3, Cassandra or Outer Space? Dumping Time Series Data using Spark  - Demi Be...
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark - Demi Be...Codemotion
 
QTP Automation Testing Tutorial 7
QTP Automation Testing Tutorial 7QTP Automation Testing Tutorial 7
QTP Automation Testing Tutorial 7Akash Tyagi
 
Matthew Treinish, HP - subunit2sql: Tracking 1 Test Result in Millions, OpenS...
Matthew Treinish, HP - subunit2sql: Tracking 1 Test Result in Millions, OpenS...Matthew Treinish, HP - subunit2sql: Tracking 1 Test Result in Millions, OpenS...
Matthew Treinish, HP - subunit2sql: Tracking 1 Test Result in Millions, OpenS...Cloud Native Day Tel Aviv
 
Prometheus (Microsoft, 2016)
Prometheus (Microsoft, 2016)Prometheus (Microsoft, 2016)
Prometheus (Microsoft, 2016)Brian Brazil
 
Real time operating systems (rtos) concepts 7
Real time operating systems (rtos) concepts 7Real time operating systems (rtos) concepts 7
Real time operating systems (rtos) concepts 7Abu Bakr Ramadan
 
QTP Automation Testing Tutorial 5
QTP Automation Testing Tutorial 5QTP Automation Testing Tutorial 5
QTP Automation Testing Tutorial 5Akash Tyagi
 
MeetUp Monitoring with Prometheus and Grafana (September 2018)
MeetUp Monitoring with Prometheus and Grafana (September 2018)MeetUp Monitoring with Prometheus and Grafana (September 2018)
MeetUp Monitoring with Prometheus and Grafana (September 2018)Lucas Jellema
 
Addressing data plane performance measurement on OpenStack clouds using VMTP
Addressing data plane performance measurement on OpenStack clouds using VMTPAddressing data plane performance measurement on OpenStack clouds using VMTP
Addressing data plane performance measurement on OpenStack clouds using VMTPSuhail Syed
 
Continuous Kernel Integration
Continuous Kernel IntegrationContinuous Kernel Integration
Continuous Kernel IntegrationMajor Hayden
 
Real time operating systems (rtos) concepts 3
Real time operating systems (rtos) concepts 3Real time operating systems (rtos) concepts 3
Real time operating systems (rtos) concepts 3Abu Bakr Ramadan
 
Reactive Extensions
Reactive ExtensionsReactive Extensions
Reactive ExtensionsRTigger
 
Игорь Фесенко "Direction of C# as a High-Performance Language"
Игорь Фесенко "Direction of C# as a High-Performance Language"Игорь Фесенко "Direction of C# as a High-Performance Language"
Игорь Фесенко "Direction of C# as a High-Performance Language"Fwdays
 
Write code that writes code!
Write code that writes code!Write code that writes code!
Write code that writes code!Jason Feinstein
 

La actualidad más candente (20)

Reactive java - Reactive Programming + RxJava
Reactive java - Reactive Programming + RxJavaReactive java - Reactive Programming + RxJava
Reactive java - Reactive Programming + RxJava
 
Lecture: MetaLinks
Lecture: MetaLinksLecture: MetaLinks
Lecture: MetaLinks
 
Deploying Microservice on Docker
Deploying Microservice on DockerDeploying Microservice on Docker
Deploying Microservice on Docker
 
Prometheus Training
Prometheus TrainingPrometheus Training
Prometheus Training
 
Azure Function Workflow
Azure Function WorkflowAzure Function Workflow
Azure Function Workflow
 
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark - Demi Be...
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark  - Demi Be...S3, Cassandra or Outer Space? Dumping Time Series Data using Spark  - Demi Be...
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark - Demi Be...
 
QTP Automation Testing Tutorial 7
QTP Automation Testing Tutorial 7QTP Automation Testing Tutorial 7
QTP Automation Testing Tutorial 7
 
Matthew Treinish, HP - subunit2sql: Tracking 1 Test Result in Millions, OpenS...
Matthew Treinish, HP - subunit2sql: Tracking 1 Test Result in Millions, OpenS...Matthew Treinish, HP - subunit2sql: Tracking 1 Test Result in Millions, OpenS...
Matthew Treinish, HP - subunit2sql: Tracking 1 Test Result in Millions, OpenS...
 
Prometheus (Microsoft, 2016)
Prometheus (Microsoft, 2016)Prometheus (Microsoft, 2016)
Prometheus (Microsoft, 2016)
 
Real time operating systems (rtos) concepts 7
Real time operating systems (rtos) concepts 7Real time operating systems (rtos) concepts 7
Real time operating systems (rtos) concepts 7
 
Prometheus workshop
Prometheus workshopPrometheus workshop
Prometheus workshop
 
QTP Automation Testing Tutorial 5
QTP Automation Testing Tutorial 5QTP Automation Testing Tutorial 5
QTP Automation Testing Tutorial 5
 
MeetUp Monitoring with Prometheus and Grafana (September 2018)
MeetUp Monitoring with Prometheus and Grafana (September 2018)MeetUp Monitoring with Prometheus and Grafana (September 2018)
MeetUp Monitoring with Prometheus and Grafana (September 2018)
 
Addressing data plane performance measurement on OpenStack clouds using VMTP
Addressing data plane performance measurement on OpenStack clouds using VMTPAddressing data plane performance measurement on OpenStack clouds using VMTP
Addressing data plane performance measurement on OpenStack clouds using VMTP
 
Continuous Kernel Integration
Continuous Kernel IntegrationContinuous Kernel Integration
Continuous Kernel Integration
 
Real time operating systems (rtos) concepts 3
Real time operating systems (rtos) concepts 3Real time operating systems (rtos) concepts 3
Real time operating systems (rtos) concepts 3
 
Reactive Extensions
Reactive ExtensionsReactive Extensions
Reactive Extensions
 
Игорь Фесенко "Direction of C# as a High-Performance Language"
Игорь Фесенко "Direction of C# as a High-Performance Language"Игорь Фесенко "Direction of C# as a High-Performance Language"
Игорь Фесенко "Direction of C# as a High-Performance Language"
 
Write code that writes code!
Write code that writes code!Write code that writes code!
Write code that writes code!
 
Apache airflow
Apache airflowApache airflow
Apache airflow
 

Destacado (20)

Research
ResearchResearch
Research
 
Question 3
Question 3Question 3
Question 3
 
Basında Bugün Göztepe
Basında Bugün GöztepeBasında Bugün Göztepe
Basında Bugün Göztepe
 
Basında Bugün Göztepe
Basında Bugün GöztepeBasında Bugün Göztepe
Basında Bugün Göztepe
 
العمليات الجبرية2
العمليات الجبرية2العمليات الجبرية2
العمليات الجبرية2
 
Basında Bugün Göztepe
Basında Bugün GöztepeBasında Bugün Göztepe
Basında Bugün Göztepe
 
нуклемновые кислоты
нуклемновые кислотынуклемновые кислоты
нуклемновые кислоты
 
Basında Bugün Göztepe
Basında Bugün GöztepeBasında Bugün Göztepe
Basında Bugün Göztepe
 
Basında Bugün Göztepe
Basında Bugün GöztepeBasında Bugün Göztepe
Basında Bugün Göztepe
 
Deliberazioni esposte 1
Deliberazioni esposte 1Deliberazioni esposte 1
Deliberazioni esposte 1
 
Basında Bugün Göztepe
Basında Bugün GöztepeBasında Bugün Göztepe
Basında Bugün Göztepe
 
Bulan+dygo
Bulan+dygoBulan+dygo
Bulan+dygo
 
Basında Bugün Göztepe
Basında Bugün GöztepeBasında Bugün Göztepe
Basında Bugün Göztepe
 
Latihan4 michael 5133331019
Latihan4 michael 5133331019Latihan4 michael 5133331019
Latihan4 michael 5133331019
 
Panopoly - Boulder DBUG 13 Nov 2013
Panopoly - Boulder DBUG 13 Nov 2013Panopoly - Boulder DBUG 13 Nov 2013
Panopoly - Boulder DBUG 13 Nov 2013
 
Basında Bugün Göztepe
Basında Bugün GöztepeBasında Bugün Göztepe
Basında Bugün Göztepe
 
գարեգին նժդեհ
գարեգին նժդեհգարեգին նժդեհ
գարեգին նժդեհ
 
皮飾配件
皮飾配件皮飾配件
皮飾配件
 
Kc common household consumption
Kc common household consumptionKc common household consumption
Kc common household consumption
 
computer memory
computer memorycomputer memory
computer memory
 

Similar a Meteor Boulder meetup #1

The Meteor Framework
The Meteor FrameworkThe Meteor Framework
The Meteor FrameworkDamien Magoni
 
React state management with Redux and MobX
React state management with Redux and MobXReact state management with Redux and MobX
React state management with Redux and MobXDarko Kukovec
 
Apache Spark™ + IBM Watson + Twitter DataPalooza SF 2015
Apache Spark™ + IBM Watson + Twitter DataPalooza SF 2015Apache Spark™ + IBM Watson + Twitter DataPalooza SF 2015
Apache Spark™ + IBM Watson + Twitter DataPalooza SF 2015Mike Broberg
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disquszeeg
 
Hot to build continuously processing for 24/7 real-time data streaming platform?
Hot to build continuously processing for 24/7 real-time data streaming platform?Hot to build continuously processing for 24/7 real-time data streaming platform?
Hot to build continuously processing for 24/7 real-time data streaming platform?GetInData
 
react-slides.pdf gives information about react library
react-slides.pdf gives information about react libraryreact-slides.pdf gives information about react library
react-slides.pdf gives information about react libraryjanet736113
 
C++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroC++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroMohammad Shaker
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialThomas Daly
 
Treasure Data Summer Internship 2016
Treasure Data Summer Internship 2016Treasure Data Summer Internship 2016
Treasure Data Summer Internship 2016Yuta Iwama
 
Integration-Monday-Stateful-Programming-Models-Serverless-Functions
Integration-Monday-Stateful-Programming-Models-Serverless-FunctionsIntegration-Monday-Stateful-Programming-Models-Serverless-Functions
Integration-Monday-Stateful-Programming-Models-Serverless-FunctionsBizTalk360
 
Server-side JS with NodeJS
Server-side JS with NodeJSServer-side JS with NodeJS
Server-side JS with NodeJSLilia Sfaxi
 
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on KubernetesApache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on KubernetesDataWorks Summit
 
Plone FSR
Plone FSRPlone FSR
Plone FSRfulv
 
Develop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverlessDevelop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverlessLalit Kale
 
Os7 2
Os7 2Os7 2
Os7 2issbp
 
Exploring Twitter's Finagle technology stack for microservices
Exploring Twitter's Finagle technology stack for microservicesExploring Twitter's Finagle technology stack for microservices
Exploring Twitter's Finagle technology stack for microservices💡 Tomasz Kogut
 

Similar a Meteor Boulder meetup #1 (20)

The Meteor Framework
The Meteor FrameworkThe Meteor Framework
The Meteor Framework
 
React state management with Redux and MobX
React state management with Redux and MobXReact state management with Redux and MobX
React state management with Redux and MobX
 
Why meteor
Why meteorWhy meteor
Why meteor
 
Apache Spark™ + IBM Watson + Twitter DataPalooza SF 2015
Apache Spark™ + IBM Watson + Twitter DataPalooza SF 2015Apache Spark™ + IBM Watson + Twitter DataPalooza SF 2015
Apache Spark™ + IBM Watson + Twitter DataPalooza SF 2015
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disqus
 
Hot to build continuously processing for 24/7 real-time data streaming platform?
Hot to build continuously processing for 24/7 real-time data streaming platform?Hot to build continuously processing for 24/7 real-time data streaming platform?
Hot to build continuously processing for 24/7 real-time data streaming platform?
 
react-slides.pdf
react-slides.pdfreact-slides.pdf
react-slides.pdf
 
react-slides.pdf gives information about react library
react-slides.pdf gives information about react libraryreact-slides.pdf gives information about react library
react-slides.pdf gives information about react library
 
C++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroC++ Windows Forms L01 - Intro
C++ Windows Forms L01 - Intro
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - Material
 
Treasure Data Summer Internship 2016
Treasure Data Summer Internship 2016Treasure Data Summer Internship 2016
Treasure Data Summer Internship 2016
 
Integration-Monday-Stateful-Programming-Models-Serverless-Functions
Integration-Monday-Stateful-Programming-Models-Serverless-FunctionsIntegration-Monday-Stateful-Programming-Models-Serverless-Functions
Integration-Monday-Stateful-Programming-Models-Serverless-Functions
 
Server-side JS with NodeJS
Server-side JS with NodeJSServer-side JS with NodeJS
Server-side JS with NodeJS
 
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on KubernetesApache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
 
react-slides.pptx
react-slides.pptxreact-slides.pptx
react-slides.pptx
 
Plone FSR
Plone FSRPlone FSR
Plone FSR
 
Develop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverlessDevelop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverless
 
Meteor Angular
Meteor AngularMeteor Angular
Meteor Angular
 
Os7 2
Os7 2Os7 2
Os7 2
 
Exploring Twitter's Finagle technology stack for microservices
Exploring Twitter's Finagle technology stack for microservicesExploring Twitter's Finagle technology stack for microservices
Exploring Twitter's Finagle technology stack for microservices
 

Último

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 educationjfdjdjcjdnsjd
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
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 productivityPrincipled Technologies
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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...Neo4j
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 

Último (20)

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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

Meteor Boulder meetup #1

  • 2. PART I: WHY METEOR?
  • 3. What is Meteor? • Full-stack JavaScript Framework • Build tool • Package system • Real-time protocol - DDP • Built on Node.js • Currently integrates with Mongodb (others to follow)
  • 5. What we saw • Instant dev environment • A working base app • Smart packages • Hot code push • Code can run on client, server, or both • Mongo api can be used locally to access server • Reactive templates • Data kept updated to all connected browsers • Session store local – maintained through hot code pushes • easy deployment to meteor.com • bundle for deployment to any node.js environment
  • 6. So Why Meteor? • Real-time (chat, dashboard, games, etc.) • Rapid prototyping • Productive • Declarative • All JavaScript
  • 7. Further resources • docs.meteor.com and blog.meteor.com • Discover Meteor (book) – highly recommended • Meteor Weekly (newsletter) • Meteor 101 screencast (Naomi Seyfer) • www.eventedmind.com • IRC • Google Groups • Github • win.meteor.com – for Windows users
  • 9. PART II: REACTIVITY How does Meteor achieve live client-side updates?
  • 10. Meteor Advanced Topics • Goal: useful for both beginners and advanced users • A lot of “magic” in Meteor • Is Meteor the jQuery of web app development? Abstraction debt? • Meteor’s hidden parts are in plain view – just go look • Great chance to pick something to research and share with the group
  • 11. What is Reactivity? • Reactivity describes a declarative data flow through which changes propagate automatically. • i.e., Data/variables update automatically when their upstream dependencies change. • Spreadsheet is the typical example
  • 13. Meteor Computations A computation contains a stored function to be rerun whenever required. A function running inside a computation is said to be running in a reactive context. _func: function () { return Session.get(“a1”)+ 1; } .stop() .invalidate() a Deps.Computation:
  • 14. Step 1: Put functions in computations To place any function fn in a computation: Templates and template helpers are automatically put in a computation by Meteor. Code in fn is said to be running in a reactive context. In a reactive context, Deps.active===true handle = Deps.autorun(fn);
  • 16. Reactivity Requirements Meteor Reactivity requires two things: 1. Run your code in a reactive context (e.g., with Deps.autorun()). 2. Use a reactive data source inside the computation. Other data sources will not update reactively.
  • 17. Built-in Reactive Data Sources • Session.get(“key”) • Collection.find({sel}) • Meteor.user() • Meteor.userId() • Meteor.status() • <subscription>.ready() • Meteor.loggingIn() Or use one from an outside module e.g. Iron Router’s Router.current()
  • 18. Making a reactive data source Why? • Control what to reactively respond to • Create a package with reactive API • Better code organization (Session === global?) • To really understand what you are doing
  • 19. Reactive Data Source is In Charge • <data source>.get(): Data source stores the current computation in a list of dependencies. • <data source>.set(): Data source calls the .invalidate() method on each computation in its list. Comp id=1 Comp id=2 Comp id=3 id=1 Id=2 Id=3 Reactive Data Source source.get() Comp id=1 Comp id=2 Comp id=3 id=1 Id=2 Id=3 Reactive Data Source invalidate() Registering dependencies Invalidating dependencies on change
  • 20. Deps.Dependency object To create a reactive data source: • Create a new Deps.Dependency() • Call its .depend() method to register a computation • Call its .changed() method to invalidate all dependencies _dependentsById: .changed() Computation {_id:1} Computation {_id:2} Computation {_id:3} .depend()
  • 21. Demo – make a reactive data source
  • 22. Quiz: Will this update reactively? Session.set('a', 1); var x = Session.get('a') Deps.autorun(function () { console.log(x); //console logs 1 }); Session.set ('a', 2); //console logs ???
  • 23. What we didn’t cover • Cascading dependencies and Deps.flush() • Cleanup and other implementation details. • Other Meteor packages that play a part in full-stack reactivity • Spark/UI • Publish/subscribe • Events • Observe and other callback-based mechanisms • Remember, Deps works on the client only!
  • 24. Resources • robertdickert.com: Why Is My Meteor App Not Updating Reactively? • https://github.com/meteor/meteor/tree/devel/packages/de ps • www.eventedmind.com
  • 26. Other possible surprises • Computations run the whole function • You need to .stop() unneeded computations • Deps does not run on the server • Know the difference between this and other Meteor packages that playa part in “full-stack reactivity” • Spark/UI • Publish/subscribe • Events • Observe and other callback-based mechanisms
  • 27. The data source is in charge 1. Stores computations in Deps.Dependency instance 2. Decides when to register a dependency (dependency.depend()) 3. Triggers the .invalidate() method of every dependent computation (dependency.changed()).
  • 28. • B1 needs to be rerun over and over • It needs to be rerun when A1 changes  B1 is dependent on A1 • B1 is a computation (aka “reactive context”) • A1 is a reactive data source
  • 29. Meteor Features • One language • Database everywhere • Latency compensation • Full stack reactivity • Hot code pushes • Low-friction prototyping and deployment