SlideShare a Scribd company logo
1 of 16
Download to read offline
Schedule
7:00 - Pizza and Networking
7:25 - Introduction
7:30 - Talk by Juha
7:50 - Q&A for Juha
8:00 - Talk by Yuan Feng
8:20 - Q&A for Yuan Feng
8:30 - Talk by Remi Robert
8:50 - Q&A for Remi
9:00- Lightning Talks
Introduction to
Falcor
What	is	Falcor	and	how	to	use	it?	
-	by	Juha	Suomalainen
What is falcor? (1)
• Framework to replace the traditional RESTful JSON
API
• Developed by Netflix, released last year
• Uses their JSONGraph spec to define routes:
{
todosById: {
"44": {
name: "get milk from corner store",
done: false,
}},
todos: [
{ $type: "ref", value: ["todosById", 44] },
{ $type: "ref", value: ["todosById", 54] }
]
}
What is falcor? (2)
• Similar to GraphQL and relay
• Gives transparent graph construction
• Does browser-side caching
• Has clean client side and backend libraries
Dig deeper: Backend
• RESTful API has url handlers <> Falcor API has JSON
path handlers
• Each handler defines the route and handler function:
{
route: "greeting",
get: function() {
return {path:["greeting"], value: "Hello World"};
}
},
• Add them to express.js app:
app.use('/model.json', FalcorServer.dataSourceRoute(function(req,
res) {
return new Router(falcorRoutes);
}));
Dig deeper: Frontend
• Create model object:
var model = new falcor.Model({
source: new falcor.HttpDataSource('/model.json')
});
• Query the data using JSON paths
model.get(“greeting”).then(function(data){
console.log(data);
})
Why did we consider
Falcor?
• We had:
• Browser app with a lot of independent widgets on page
• Fairly straightforward data structure
• Data in Redis
• We wanted to:
• Avoid making lots API requests when page loads
• Have clean way to request data from backend.
• Have something that we can use with Redux.
• Have a simple backend.
What worked for us?
• Very low amount of backend code, just
concentrating on data transformation (as it should)
Drawbacks?
• Exposing filtered lists
• Fetching all the items on a list
• Not as “standard” as RESTful
What else can Falcor do?
• Support for references ($ref)
• Not just gets, writes are supported too
• Authentication management
• Support for other backend languages
• Use static JSON structure as a source
Questions?
Find me in twitter: @JuhaFinn
curl 'http://localhost:9090/model.json?paths=[[%22greeting%22],
[%22countries%22,%22FI%22,[%22name%22,%22region%22]]]&method=get' |
python -m json.tool
{
"jsonGraph": {
"countries": {
"FI": {
"name": {
"$type": "atom",
"value": "Finland"
},
"region": {
"$type": "atom",
"value": "Z7"
}
}
},
"greeting": "Hello World"
}
}
model.get("countries['FI']['name','region']", 'greeting').then(jlog,
jerror)
model.get('greeting').then(jlog, jerror)
model.get('greeting', 'wishes').then(jlog, jerror)
model.get(‘genrelist[0..5].titles[0..5].name')
http://netflix.github.io/falcor/
https://github.com/Netflix/falcor-express-demo
How and When to Use FalcorJS

More Related Content

What's hot

Rupy2012 ArangoDB Workshop Part2
Rupy2012 ArangoDB Workshop Part2Rupy2012 ArangoDB Workshop Part2
Rupy2012 ArangoDB Workshop Part2
ArangoDB Database
 

What's hot (20)

Meet MariaDB
Meet MariaDBMeet MariaDB
Meet MariaDB
 
Integrating Alfresco with Portals
Integrating Alfresco with PortalsIntegrating Alfresco with Portals
Integrating Alfresco with Portals
 
Gizzard, DAL and more
Gizzard, DAL and moreGizzard, DAL and more
Gizzard, DAL and more
 
Exploring the JIRA 5 REST API - AtlasCamp 2011
Exploring the JIRA 5 REST API - AtlasCamp 2011Exploring the JIRA 5 REST API - AtlasCamp 2011
Exploring the JIRA 5 REST API - AtlasCamp 2011
 
Meet MariaDB 10.2/10.3
Meet MariaDB 10.2/10.3Meet MariaDB 10.2/10.3
Meet MariaDB 10.2/10.3
 
Building a spa_in_30min
Building a spa_in_30minBuilding a spa_in_30min
Building a spa_in_30min
 
Alfresco WebScript Connector for Apache ManifoldCF
Alfresco WebScript Connector for Apache ManifoldCFAlfresco WebScript Connector for Apache ManifoldCF
Alfresco WebScript Connector for Apache ManifoldCF
 
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...
 
RetroFit by Square - GDG Dallas 06/09/16
RetroFit by Square - GDG Dallas 06/09/16RetroFit by Square - GDG Dallas 06/09/16
RetroFit by Square - GDG Dallas 06/09/16
 
SharePoint 2013 Javascript Object Model
SharePoint 2013 Javascript Object ModelSharePoint 2013 Javascript Object Model
SharePoint 2013 Javascript Object Model
 
Rupy2012 ArangoDB Workshop Part2
Rupy2012 ArangoDB Workshop Part2Rupy2012 ArangoDB Workshop Part2
Rupy2012 ArangoDB Workshop Part2
 
Yii 2.0 overview - 1 of 2
Yii 2.0 overview - 1 of 2Yii 2.0 overview - 1 of 2
Yii 2.0 overview - 1 of 2
 
C# 9 - What's the cool stuff? - BASTA! Spring 2021
C# 9 - What's the cool stuff? - BASTA! Spring 2021C# 9 - What's the cool stuff? - BASTA! Spring 2021
C# 9 - What's the cool stuff? - BASTA! Spring 2021
 
Sinatra Introduction
Sinatra IntroductionSinatra Introduction
Sinatra Introduction
 
WebCamp 2016: Front-end. Виталий Бобров: JavaScript для мобильной разработки.
WebCamp 2016: Front-end. Виталий Бобров: JavaScript для мобильной разработки.WebCamp 2016: Front-end. Виталий Бобров: JavaScript для мобильной разработки.
WebCamp 2016: Front-end. Виталий Бобров: JavaScript для мобильной разработки.
 
Austin Day of Rest - Introduction
Austin Day of Rest - IntroductionAustin Day of Rest - Introduction
Austin Day of Rest - Introduction
 
サーバーサイドから見るGraphQL Serverless Meetup #19
サーバーサイドから見るGraphQL Serverless Meetup #19サーバーサイドから見るGraphQL Serverless Meetup #19
サーバーサイドから見るGraphQL Serverless Meetup #19
 
Realm Presentation
Realm PresentationRealm Presentation
Realm Presentation
 
SOA Latam 2015
SOA Latam 2015SOA Latam 2015
SOA Latam 2015
 
Translate word press to your language
Translate word press to your languageTranslate word press to your language
Translate word press to your language
 

Similar to How and When to Use FalcorJS

Coral-and-Transport_Portable-SQL-and-UDFs-for-the-Interoperability-of-Spark-a...
Coral-and-Transport_Portable-SQL-and-UDFs-for-the-Interoperability-of-Spark-a...Coral-and-Transport_Portable-SQL-and-UDFs-for-the-Interoperability-of-Spark-a...
Coral-and-Transport_Portable-SQL-and-UDFs-for-the-Interoperability-of-Spark-a...
aiuy
 
Rapid API Development ArangoDB Foxx
Rapid API Development ArangoDB FoxxRapid API Development ArangoDB Foxx
Rapid API Development ArangoDB Foxx
Michael Hackstein
 
Web Application Frameworks (WAF)
Web Application Frameworks (WAF)Web Application Frameworks (WAF)
Web Application Frameworks (WAF)
Ako Kaman
 
Library Mashups & APIs
Library Mashups & APIsLibrary Mashups & APIs
Library Mashups & APIs
librarywebchic
 

Similar to How and When to Use FalcorJS (20)

Introduction to Flask Micro Framework
Introduction to Flask Micro FrameworkIntroduction to Flask Micro Framework
Introduction to Flask Micro Framework
 
Coral-and-Transport_Portable-SQL-and-UDFs-for-the-Interoperability-of-Spark-a...
Coral-and-Transport_Portable-SQL-and-UDFs-for-the-Interoperability-of-Spark-a...Coral-and-Transport_Portable-SQL-and-UDFs-for-the-Interoperability-of-Spark-a...
Coral-and-Transport_Portable-SQL-and-UDFs-for-the-Interoperability-of-Spark-a...
 
Introduction to Restful Web Services
Introduction to Restful Web ServicesIntroduction to Restful Web Services
Introduction to Restful Web Services
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API Platform
 
Rapid API Development ArangoDB Foxx
Rapid API Development ArangoDB FoxxRapid API Development ArangoDB Foxx
Rapid API Development ArangoDB Foxx
 
Web architecture - overview of techniques.
Web architecture - overview of  techniques.Web architecture - overview of  techniques.
Web architecture - overview of techniques.
 
Building Software Backend (Web API)
Building Software Backend (Web API)Building Software Backend (Web API)
Building Software Backend (Web API)
 
Coding 100-session-slides
Coding 100-session-slidesCoding 100-session-slides
Coding 100-session-slides
 
Introduction to Google APIs
Introduction to Google APIsIntroduction to Google APIs
Introduction to Google APIs
 
Arabidopsis Information Portal, Developer Workshop 2014, Introduction
Arabidopsis Information Portal, Developer Workshop 2014, IntroductionArabidopsis Information Portal, Developer Workshop 2014, Introduction
Arabidopsis Information Portal, Developer Workshop 2014, Introduction
 
Web Application Frameworks (WAF)
Web Application Frameworks (WAF)Web Application Frameworks (WAF)
Web Application Frameworks (WAF)
 
Rest API with Swagger and NodeJS
Rest API with Swagger and NodeJSRest API with Swagger and NodeJS
Rest API with Swagger and NodeJS
 
Webservices: The RESTful Approach
Webservices: The RESTful ApproachWebservices: The RESTful Approach
Webservices: The RESTful Approach
 
Library Mashups & APIs
Library Mashups & APIsLibrary Mashups & APIs
Library Mashups & APIs
 
Vonk fhir facade (christiaan)
Vonk fhir facade (christiaan)Vonk fhir facade (christiaan)
Vonk fhir facade (christiaan)
 
Apigility-Powered APIs on IBM i
Apigility-Powered APIs on IBM iApigility-Powered APIs on IBM i
Apigility-Powered APIs on IBM i
 
PLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfPLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring Surf
 
PLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfPLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring Surf
 
PHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLitePHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLite
 
Soap and Rest
Soap and RestSoap and Rest
Soap and Rest
 

More from Wiredcraft

More from Wiredcraft (20)

Untold Stories - June 2016 UI/UX Meetup Berlin
Untold Stories - June 2016 UI/UX Meetup BerlinUntold Stories - June 2016 UI/UX Meetup Berlin
Untold Stories - June 2016 UI/UX Meetup Berlin
 
Practical Advice for the Confused Designer - Dec 2015 UI/UX Meetup Shanghai
Practical Advice for the Confused Designer - Dec 2015 UI/UX Meetup ShanghaiPractical Advice for the Confused Designer - Dec 2015 UI/UX Meetup Shanghai
Practical Advice for the Confused Designer - Dec 2015 UI/UX Meetup Shanghai
 
How to Survive your Boring Day job by starting a personal design project - De...
How to Survive your Boring Day job by starting a personal design project - De...How to Survive your Boring Day job by starting a personal design project - De...
How to Survive your Boring Day job by starting a personal design project - De...
 
Designing with Empathy - January 2016 UI/UX Meetup Shanghai
Designing with Empathy - January 2016 UI/UX Meetup ShanghaiDesigning with Empathy - January 2016 UI/UX Meetup Shanghai
Designing with Empathy - January 2016 UI/UX Meetup Shanghai
 
The Difference Between Chinese and American Apps - February 2016 UI/UX Meetup...
The Difference Between Chinese and American Apps - February 2016 UI/UX Meetup...The Difference Between Chinese and American Apps - February 2016 UI/UX Meetup...
The Difference Between Chinese and American Apps - February 2016 UI/UX Meetup...
 
Product Design at Wiredcraft - May 2016 UI/UX Meetup Shanghai
Product Design at Wiredcraft - May 2016 UI/UX Meetup ShanghaiProduct Design at Wiredcraft - May 2016 UI/UX Meetup Shanghai
Product Design at Wiredcraft - May 2016 UI/UX Meetup Shanghai
 
UX in Industrial Internet Solutions - May 2016 UI/UX Meetup Shanghai
UX in Industrial Internet Solutions - May 2016 UI/UX Meetup ShanghaiUX in Industrial Internet Solutions - May 2016 UI/UX Meetup Shanghai
UX in Industrial Internet Solutions - May 2016 UI/UX Meetup Shanghai
 
JavaScript & Hardware - April 2016 JavaScript Shanghai Meetup
JavaScript & Hardware - April 2016 JavaScript Shanghai MeetupJavaScript & Hardware - April 2016 JavaScript Shanghai Meetup
JavaScript & Hardware - April 2016 JavaScript Shanghai Meetup
 
Distribute Development Environment by docker-compose - May 2016 Docker Meetup...
Distribute Development Environment by docker-compose - May 2016 Docker Meetup...Distribute Development Environment by docker-compose - May 2016 Docker Meetup...
Distribute Development Environment by docker-compose - May 2016 Docker Meetup...
 
Code Splitting in Practice - Shanghai JS Meetup May 2016
Code Splitting in Practice - Shanghai JS Meetup May 2016Code Splitting in Practice - Shanghai JS Meetup May 2016
Code Splitting in Practice - Shanghai JS Meetup May 2016
 
Wander in the Dockershop - May Docker Meetup Shanghai
Wander in the Dockershop - May Docker Meetup ShanghaiWander in the Dockershop - May Docker Meetup Shanghai
Wander in the Dockershop - May Docker Meetup Shanghai
 
Open source based container solution in Azure - May Docker Meetup
Open source based container solution in Azure - May Docker MeetupOpen source based container solution in Azure - May Docker Meetup
Open source based container solution in Azure - May Docker Meetup
 
How meditating ten minutes per day can improve your design workflow by Floria...
How meditating ten minutes per day can improve your design workflow by Floria...How meditating ten minutes per day can improve your design workflow by Floria...
How meditating ten minutes per day can improve your design workflow by Floria...
 
UI/UX: Where do you draw the line? by Muhammad Elmelegy
UI/UX: Where do you draw the line? by Muhammad ElmelegyUI/UX: Where do you draw the line? by Muhammad Elmelegy
UI/UX: Where do you draw the line? by Muhammad Elmelegy
 
Realtime Apps with JavaScript
Realtime Apps with JavaScriptRealtime Apps with JavaScript
Realtime Apps with JavaScript
 
Pm2 remi-robert
Pm2 remi-robertPm2 remi-robert
Pm2 remi-robert
 
Applying empirical research on videogame player types to inform UI/UX design
Applying empirical research on videogame player types to inform UI/UX designApplying empirical research on videogame player types to inform UI/UX design
Applying empirical research on videogame player types to inform UI/UX design
 
Reason vs Rationalisation
Reason vs RationalisationReason vs Rationalisation
Reason vs Rationalisation
 
Questioning Smart in Design
Questioning Smart in DesignQuestioning Smart in Design
Questioning Smart in Design
 
Getting Started with User Interviews
Getting Started with User Interviews Getting Started with User Interviews
Getting Started with User Interviews
 

Recently uploaded

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Recently uploaded (20)

Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 

How and When to Use FalcorJS