SlideShare une entreprise Scribd logo
1  sur  89
Télécharger pour lire hors ligne
HOW TO BE PREPARED
FOR NODE-POCALYPSE
@tomekcejner
THE PRESENTER
TOMEK CEJNER
@tomekcejner
APOCALYPSE?
JavaScript
Any application that can be written in JavaScript,
will eventually be written in JavaScript.
http://blog.codinghorror.com/the-principle-of-least-power/
Jeff Atwood, 2007
CREATED IN 10 DAYS
DIFFICULT CHILDHOOD
FUNCTIONAL
DYNAMIC
IN 90’S EVERYBODY NEED A WEBSITE
http://www.amazon.com/
http://www.lego.com/
NOW ITS 2010’S
EVERYBODY NEEDS MOBILE APP
THAT’S ALL
THANK YOU!
BUT, IF…
API
NO API
NO PUBLIC API
NO MOBILE PUBLIC API
ARE YOU PREPARED?
WHAT MAKES API MOBILE?
LOW BANDWIDTH
HIGH LATENCY
NETWORK CONDITIONS VARY
Mobile device is
SEND ONLY WHAT IS NEEDED
SCREEN-ORIENTED
NO CRUD-OVER-AIR
AVOID MULTIPLE ROUNDTRIPS
CAUSED BY LAZY DESIGN
EVERY REQUEST COUNTS
VERSIONING
OR KEEP STABLE CONTRACT
SECURITY
AUTHENTICATION
TRANSIT
API ABUSE
ANALYTICS
Our approach
PLATFORM APIs
MOBILE API
INTRODUCING
Mobster
OAUTH 2.0
AUTHORIZATION
API KEYS
Access control
DATA AGGREGATION
DATA FILTERING
ANTI-CORRUPTION LAYER
Translation
PUSH NOTIFICATIONS GATEWAY
Mobile features
ENTER
EVENT-DRIVEN
NETWORK PROGRAMS
JAVASCRIPT
Node.js is
V8
LIBUV HTTP-PARSER
JS STANDARD LIBRARY
WHY NODE.JS?
DB
SERVICE
REQUEST
REQUEST
REQUEST
REQUEST
TRADITIONAL WAY
WHAT WEB SERVERS DO MOST THE TIME?
THEY WAIT
WHAT THREADS DO MOST THE TIME?
THEY SUCK
EVENT
LOOP
I/O
REGISTER CALLBACK
OPERATION COMPLETE
YOUR
CODE
YOUR
CODE
LESS THREADS
LESS MEMORY OVERHEAD
LESS COMPUTATION (!)
NODE.JS SURVIVAL KIT
Editors
UNIT TESTING
NodeUnit
NodeUnit + Expect.js
NodeUnit
NodeUnit
Mocha
Mocha
PACKAGE MANAGEMENT
pom.xml
CHECK NODE_MODULES TO SCM
WEB FRAMEWORKS
MIDDLEWARE
tomek@dev_laptop$ git push
appuser@server$ git pull
appuser@server$ kill process_num
appuser@server$ node myapp.js
DEPLOYMENT
MANAGEMENT
WITH PM2
https://github.com/unitech/pm2
RUN
RESTART
PROCESS LIST
MONITORING
ZERO-DOWNTIME RELOAD
HEALTH CHECK API ENDPOINT
LOG BROWSING
LINUX STARTUP SCRIPTS
Fluff
Automate
ANSIBLE
SPEAKS YOUR LANGUAGE
AGENTLESS
Ansible
CODE
GOOGLE: JAVASCRIPT GARDEN
http://bonsaiden.github.io/JavaScript-Garden/
JAVASCRIPT QUIRKS
JSLINT & JSHINT TO RESCUE
ASYNCHRONOUS PROGRAMMING,
M**********R
ASYNC TO RESCUE
https://github.com/caolan/async
https://github.com/caolan/async
TO NODE OR NOT TO NODE
DEVELOP FAST
DEPLOY FAST
IT’S JAVASCRIPT
IT’S JAVASCRIPT
NOT SO MATURE
NOT FOR CPU-INTENSIVE JOBS
THANK YOU

Contenu connexe

Tendances

Progressive Web Apps: The Breakdown
Progressive Web Apps: The BreakdownProgressive Web Apps: The Breakdown
Progressive Web Apps: The BreakdownUXDXConf
 
PhoneGap: a brief history and apologia
PhoneGap: a brief history and apologiaPhoneGap: a brief history and apologia
PhoneGap: a brief history and apologialorinbeer
 
The Fine Print of iOS Development
The Fine Print of iOS DevelopmentThe Fine Print of iOS Development
The Fine Print of iOS DevelopmentCory Wiles
 
Using HTML5 to Build Mobile Apps
Using HTML5 to Build Mobile AppsUsing HTML5 to Build Mobile Apps
Using HTML5 to Build Mobile AppsTodd Anglin
 
Of innovation and impatience - Future Decoded 2015
Of innovation and impatience - Future Decoded 2015Of innovation and impatience - Future Decoded 2015
Of innovation and impatience - Future Decoded 2015Christian Heilmann
 
アプリ開発支援サービス「アプリカン」 - HTML5 Experts Night 2013年8月23日
アプリ開発支援サービス「アプリカン」 - HTML5 Experts Night 2013年8月23日アプリ開発支援サービス「アプリカン」 - HTML5 Experts Night 2013年8月23日
アプリ開発支援サービス「アプリカン」 - HTML5 Experts Night 2013年8月23日Futomi Hatano
 
Business of APIs - Introduction
Business of APIs - IntroductionBusiness of APIs - Introduction
Business of APIs - Introductionaubs
 
Workshop: the mobile web and the future of your council's website #BPCW11
Workshop: the mobile web and the future of your council's website #BPCW11Workshop: the mobile web and the future of your council's website #BPCW11
Workshop: the mobile web and the future of your council's website #BPCW11Headstar
 
Voice interfaces
Voice interfacesVoice interfaces
Voice interfacesSam Machin
 
Your Browser is Your SDK
Your Browser is Your SDKYour Browser is Your SDK
Your Browser is Your SDKmwbrooks
 
Developing for Wearables with Xamarin
Developing for Wearables with XamarinDeveloping for Wearables with Xamarin
Developing for Wearables with XamarinGert Cominotto
 
Android Wear Applications in C# with Xamarin
Android Wear Applications in C# with XamarinAndroid Wear Applications in C# with Xamarin
Android Wear Applications in C# with XamarinJames Montemagno
 
Dawn of the Devices
Dawn of the DevicesDawn of the Devices
Dawn of the Devicesmwbrooks
 
MOBILE DEVELOPMENT with HTML, CSS and JS
MOBILE DEVELOPMENT with HTML, CSS and JSMOBILE DEVELOPMENT with HTML, CSS and JS
MOBILE DEVELOPMENT with HTML, CSS and JSSperasoft
 

Tendances (20)

Building mobile apps using Phonegap
Building mobile apps using PhonegapBuilding mobile apps using Phonegap
Building mobile apps using Phonegap
 
Progressive Web Apps: The Breakdown
Progressive Web Apps: The BreakdownProgressive Web Apps: The Breakdown
Progressive Web Apps: The Breakdown
 
PhoneGap: a brief history and apologia
PhoneGap: a brief history and apologiaPhoneGap: a brief history and apologia
PhoneGap: a brief history and apologia
 
The Fine Print of iOS Development
The Fine Print of iOS DevelopmentThe Fine Print of iOS Development
The Fine Print of iOS Development
 
AppStrom
AppStromAppStrom
AppStrom
 
Using HTML5 to Build Mobile Apps
Using HTML5 to Build Mobile AppsUsing HTML5 to Build Mobile Apps
Using HTML5 to Build Mobile Apps
 
Of innovation and impatience - Future Decoded 2015
Of innovation and impatience - Future Decoded 2015Of innovation and impatience - Future Decoded 2015
Of innovation and impatience - Future Decoded 2015
 
Mobile twin cities
Mobile twin citiesMobile twin cities
Mobile twin cities
 
アプリ開発支援サービス「アプリカン」 - HTML5 Experts Night 2013年8月23日
アプリ開発支援サービス「アプリカン」 - HTML5 Experts Night 2013年8月23日アプリ開発支援サービス「アプリカン」 - HTML5 Experts Night 2013年8月23日
アプリ開発支援サービス「アプリカン」 - HTML5 Experts Night 2013年8月23日
 
Business of APIs - Introduction
Business of APIs - IntroductionBusiness of APIs - Introduction
Business of APIs - Introduction
 
Introduction to Xamarin
Introduction to XamarinIntroduction to Xamarin
Introduction to Xamarin
 
Why we choose Skype ?
Why we choose Skype ?Why we choose Skype ?
Why we choose Skype ?
 
Workshop: the mobile web and the future of your council's website #BPCW11
Workshop: the mobile web and the future of your council's website #BPCW11Workshop: the mobile web and the future of your council's website #BPCW11
Workshop: the mobile web and the future of your council's website #BPCW11
 
The modern PWA Cheat Sheet
The modern PWA Cheat SheetThe modern PWA Cheat Sheet
The modern PWA Cheat Sheet
 
Voice interfaces
Voice interfacesVoice interfaces
Voice interfaces
 
Your Browser is Your SDK
Your Browser is Your SDKYour Browser is Your SDK
Your Browser is Your SDK
 
Developing for Wearables with Xamarin
Developing for Wearables with XamarinDeveloping for Wearables with Xamarin
Developing for Wearables with Xamarin
 
Android Wear Applications in C# with Xamarin
Android Wear Applications in C# with XamarinAndroid Wear Applications in C# with Xamarin
Android Wear Applications in C# with Xamarin
 
Dawn of the Devices
Dawn of the DevicesDawn of the Devices
Dawn of the Devices
 
MOBILE DEVELOPMENT with HTML, CSS and JS
MOBILE DEVELOPMENT with HTML, CSS and JSMOBILE DEVELOPMENT with HTML, CSS and JS
MOBILE DEVELOPMENT with HTML, CSS and JS
 

En vedette

Jordi Romero Api for-the-mobile-era
Jordi Romero Api for-the-mobile-eraJordi Romero Api for-the-mobile-era
Jordi Romero Api for-the-mobile-era.toster
 
Develop and Deploy your Mobile API with Rails, Nginx, Unicorn and Capistrano
Develop and Deploy your Mobile API with Rails, Nginx, Unicorn and CapistranoDevelop and Deploy your Mobile API with Rails, Nginx, Unicorn and Capistrano
Develop and Deploy your Mobile API with Rails, Nginx, Unicorn and CapistranoErrazudin Ishak
 
Mobile API Design Techniques
Mobile API Design TechniquesMobile API Design Techniques
Mobile API Design TechniquesTrieu Nguyen
 
Pragmatic Git workflow
Pragmatic Git workflowPragmatic Git workflow
Pragmatic Git workflowTomek Cejner
 
Creating an Effective Mobile API
Creating an Effective Mobile API Creating an Effective Mobile API
Creating an Effective Mobile API Nick DeNardis
 
Data To Go: Mobile API Design (Lightning Talk)
Data To Go: Mobile API Design (Lightning Talk)Data To Go: Mobile API Design (Lightning Talk)
Data To Go: Mobile API Design (Lightning Talk)Chuck Greb
 
Designing an API for Mobile
Designing an API for MobileDesigning an API for Mobile
Designing an API for MobileSocialRadar
 
Api mobile first
Api mobile firstApi mobile first
Api mobile firstChris Saez
 
Mobile API: Design & Techniques
Mobile API: Design & TechniquesMobile API: Design & Techniques
Mobile API: Design & TechniquesFred Brunel
 
Mobile Api and Caching
Mobile Api and CachingMobile Api and Caching
Mobile Api and CachingNew Relic
 
Data to Go: Mobile API Design (SXSW)
Data to Go: Mobile API Design (SXSW)Data to Go: Mobile API Design (SXSW)
Data to Go: Mobile API Design (SXSW)Chuck Greb
 
Data to Go: Mobile API Design
Data to Go: Mobile API DesignData to Go: Mobile API Design
Data to Go: Mobile API DesignChuck Greb
 
Build a REST API for your Mobile Apps using Node.js
Build a REST API for your Mobile Apps using Node.jsBuild a REST API for your Mobile Apps using Node.js
Build a REST API for your Mobile Apps using Node.jsStormpath
 
We we should be Mobile API - First, by Brad Hipps
We we should be Mobile API - First, by Brad HippsWe we should be Mobile API - First, by Brad Hipps
We we should be Mobile API - First, by Brad HippsPuerto Rico Tech Summit
 
Designing API for mobile apps (MobileWarsaw 19.01.2015)
Designing API for mobile apps (MobileWarsaw 19.01.2015)Designing API for mobile apps (MobileWarsaw 19.01.2015)
Designing API for mobile apps (MobileWarsaw 19.01.2015)Wojtek Erbetowski
 

En vedette (16)

Jordi Romero Api for-the-mobile-era
Jordi Romero Api for-the-mobile-eraJordi Romero Api for-the-mobile-era
Jordi Romero Api for-the-mobile-era
 
Develop and Deploy your Mobile API with Rails, Nginx, Unicorn and Capistrano
Develop and Deploy your Mobile API with Rails, Nginx, Unicorn and CapistranoDevelop and Deploy your Mobile API with Rails, Nginx, Unicorn and Capistrano
Develop and Deploy your Mobile API with Rails, Nginx, Unicorn and Capistrano
 
Mobile API Design Techniques
Mobile API Design TechniquesMobile API Design Techniques
Mobile API Design Techniques
 
Pragmatic Git workflow
Pragmatic Git workflowPragmatic Git workflow
Pragmatic Git workflow
 
Creating an Effective Mobile API
Creating an Effective Mobile API Creating an Effective Mobile API
Creating an Effective Mobile API
 
Data To Go: Mobile API Design (Lightning Talk)
Data To Go: Mobile API Design (Lightning Talk)Data To Go: Mobile API Design (Lightning Talk)
Data To Go: Mobile API Design (Lightning Talk)
 
Designing an API for Mobile
Designing an API for MobileDesigning an API for Mobile
Designing an API for Mobile
 
Api mobile first
Api mobile firstApi mobile first
Api mobile first
 
Mobile API: Design & Techniques
Mobile API: Design & TechniquesMobile API: Design & Techniques
Mobile API: Design & Techniques
 
Mobile Api and Caching
Mobile Api and CachingMobile Api and Caching
Mobile Api and Caching
 
Data to Go: Mobile API Design (SXSW)
Data to Go: Mobile API Design (SXSW)Data to Go: Mobile API Design (SXSW)
Data to Go: Mobile API Design (SXSW)
 
Data to Go: Mobile API Design
Data to Go: Mobile API DesignData to Go: Mobile API Design
Data to Go: Mobile API Design
 
Build a REST API for your Mobile Apps using Node.js
Build a REST API for your Mobile Apps using Node.jsBuild a REST API for your Mobile Apps using Node.js
Build a REST API for your Mobile Apps using Node.js
 
We we should be Mobile API - First, by Brad Hipps
We we should be Mobile API - First, by Brad HippsWe we should be Mobile API - First, by Brad Hipps
We we should be Mobile API - First, by Brad Hipps
 
Designing API for mobile apps (MobileWarsaw 19.01.2015)
Designing API for mobile apps (MobileWarsaw 19.01.2015)Designing API for mobile apps (MobileWarsaw 19.01.2015)
Designing API for mobile apps (MobileWarsaw 19.01.2015)
 
Build Features, Not Apps
Build Features, Not AppsBuild Features, Not Apps
Build Features, Not Apps
 

Similaire à Prepare for Node-pocalypse with Mobile APIs and Async Code

JanusCon - Building Native Mobile Apps with WebRTC
JanusCon - Building Native Mobile Apps with WebRTCJanusCon - Building Native Mobile Apps with WebRTC
JanusCon - Building Native Mobile Apps with WebRTCDan Jenkins
 
Optimizing for Change (Henrik Joreteg)
Optimizing for Change (Henrik Joreteg)Optimizing for Change (Henrik Joreteg)
Optimizing for Change (Henrik Joreteg)Future Insights
 
Brian Le Roux Presentation Introducing Phone Gap
Brian Le Roux Presentation Introducing Phone GapBrian Le Roux Presentation Introducing Phone Gap
Brian Le Roux Presentation Introducing Phone GapAjax Experience 2009
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGapQuang Minh Dao
 
Mobile Web Mega Trend 2010
Mobile Web Mega Trend 2010Mobile Web Mega Trend 2010
Mobile Web Mega Trend 2010Manyoung Cho
 
Beyond Squishy: The Principles of Adaptive Design
Beyond Squishy: The Principles of Adaptive DesignBeyond Squishy: The Principles of Adaptive Design
Beyond Squishy: The Principles of Adaptive DesignBrad Frost
 
Georges Chitiga - Introduction to Phonegap - HTML5 & JS to native mobile app
Georges Chitiga - Introduction to Phonegap - HTML5 & JS to native mobile appGeorges Chitiga - Introduction to Phonegap - HTML5 & JS to native mobile app
Georges Chitiga - Introduction to Phonegap - HTML5 & JS to native mobile appCodecamp Romania
 
HTML5 for mobile - DiGi Challenge for Change
HTML5 for mobile - DiGi Challenge for ChangeHTML5 for mobile - DiGi Challenge for Change
HTML5 for mobile - DiGi Challenge for ChangeJan Jongboom
 
Aleksandar Vacić - iOS App Development iz Srbije
Aleksandar Vacić - iOS App Development iz SrbijeAleksandar Vacić - iOS App Development iz Srbije
Aleksandar Vacić - iOS App Development iz SrbijeMobile Monday Srbija
 
Philly ete-2011
Philly ete-2011Philly ete-2011
Philly ete-2011davyjones
 
Cordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirstCordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirstRaymond Camden
 
Developing cross platform mobile applications with phone gap for windows phone
Developing cross platform mobile applications with phone gap for windows phoneDeveloping cross platform mobile applications with phone gap for windows phone
Developing cross platform mobile applications with phone gap for windows phoneColin Eberhardt
 
Phonegap
PhonegapPhonegap
PhonegapTim Kim
 
Maximiliano Firtman - Разработка приложений с помощью PhoneGap
Maximiliano Firtman - Разработка приложений с помощью PhoneGap Maximiliano Firtman - Разработка приложений с помощью PhoneGap
Maximiliano Firtman - Разработка приложений с помощью PhoneGap .toster
 
Mobile Development with PhoneGap
Mobile Development with PhoneGapMobile Development with PhoneGap
Mobile Development with PhoneGapJoshua Johnson
 
AppsWorld 2015 - Cross Platform Native Applications in JavaScript
AppsWorld 2015 - Cross Platform Native Applications in JavaScriptAppsWorld 2015 - Cross Platform Native Applications in JavaScript
AppsWorld 2015 - Cross Platform Native Applications in JavaScriptJason Kneen
 

Similaire à Prepare for Node-pocalypse with Mobile APIs and Async Code (20)

JanusCon - Building Native Mobile Apps with WebRTC
JanusCon - Building Native Mobile Apps with WebRTCJanusCon - Building Native Mobile Apps with WebRTC
JanusCon - Building Native Mobile Apps with WebRTC
 
Optimizing for Change (Henrik Joreteg)
Optimizing for Change (Henrik Joreteg)Optimizing for Change (Henrik Joreteg)
Optimizing for Change (Henrik Joreteg)
 
Brian Le Roux Presentation Introducing Phone Gap
Brian Le Roux Presentation Introducing Phone GapBrian Le Roux Presentation Introducing Phone Gap
Brian Le Roux Presentation Introducing Phone Gap
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGap
 
Phonegap
PhonegapPhonegap
Phonegap
 
Mobile Web Mega Trend 2010
Mobile Web Mega Trend 2010Mobile Web Mega Trend 2010
Mobile Web Mega Trend 2010
 
Beyond Squishy: The Principles of Adaptive Design
Beyond Squishy: The Principles of Adaptive DesignBeyond Squishy: The Principles of Adaptive Design
Beyond Squishy: The Principles of Adaptive Design
 
WebKit, why it matters (PDF version)
WebKit, why it matters (PDF version)WebKit, why it matters (PDF version)
WebKit, why it matters (PDF version)
 
Georges Chitiga - Introduction to Phonegap - HTML5 & JS to native mobile app
Georges Chitiga - Introduction to Phonegap - HTML5 & JS to native mobile appGeorges Chitiga - Introduction to Phonegap - HTML5 & JS to native mobile app
Georges Chitiga - Introduction to Phonegap - HTML5 & JS to native mobile app
 
Web2013
Web2013Web2013
Web2013
 
HTML5 for mobile - DiGi Challenge for Change
HTML5 for mobile - DiGi Challenge for ChangeHTML5 for mobile - DiGi Challenge for Change
HTML5 for mobile - DiGi Challenge for Change
 
Aleksandar Vacić - iOS App Development iz Srbije
Aleksandar Vacić - iOS App Development iz SrbijeAleksandar Vacić - iOS App Development iz Srbije
Aleksandar Vacić - iOS App Development iz Srbije
 
Philly ete-2011
Philly ete-2011Philly ete-2011
Philly ete-2011
 
Cordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirstCordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirst
 
Developing cross platform mobile applications with phone gap for windows phone
Developing cross platform mobile applications with phone gap for windows phoneDeveloping cross platform mobile applications with phone gap for windows phone
Developing cross platform mobile applications with phone gap for windows phone
 
Phonegap
PhonegapPhonegap
Phonegap
 
PhoneGap mobile development
PhoneGap mobile developmentPhoneGap mobile development
PhoneGap mobile development
 
Maximiliano Firtman - Разработка приложений с помощью PhoneGap
Maximiliano Firtman - Разработка приложений с помощью PhoneGap Maximiliano Firtman - Разработка приложений с помощью PhoneGap
Maximiliano Firtman - Разработка приложений с помощью PhoneGap
 
Mobile Development with PhoneGap
Mobile Development with PhoneGapMobile Development with PhoneGap
Mobile Development with PhoneGap
 
AppsWorld 2015 - Cross Platform Native Applications in JavaScript
AppsWorld 2015 - Cross Platform Native Applications in JavaScriptAppsWorld 2015 - Cross Platform Native Applications in JavaScript
AppsWorld 2015 - Cross Platform Native Applications in JavaScript
 

Prepare for Node-pocalypse with Mobile APIs and Async Code