Toronto node js_meetup

Shubhra Kar
Shubhra KarVice President - Product & Digital Marketing at Joyent, a Samsung Company
Enterprise Node.js to Power the
API Economy
Shubhra Kar | Products & Education
twitter:@shubhrakar mail:skar@strongloop.com
Wake up to the API economy
Explosion of channels
(browsers, mobile, sensors,
wearable, real-time
communication)
u Sheer number of
clients has increased
u Clients are increasingly
sophisticated
u Node.js is the platform
of choice for these API
StrongLoop Confidential and Proprietary Information – © 2015
Latency demands are uncompromising
10
25
50
100100
50
10
15
40
100
25
Web SaaS Mobile IoT
The new curve
Concurrent Users Latency Adoption
StrongLoop Confidential and Proprietary Information – © 2015
Not all APIs are built equal
The image cannot
be displayed. Your
computer may not
have enough
memory to open the
image, or the image
may have been
corrupted. Restart
your computer, and
then open the file
again. If the red x
still appears, you
may have to delete
the image and then
insert it again.
Relational Database Clustered Database Security Gateway Cloud Firewall SOA Bus ( not sure on this one)
Laptop ( not requested but useful)
Connections
Tablet Phone IoT SDK API SERVER Items for ACL
Quick Example of Use
App Server
Add On
App Server
Relational Database Clustered Database Security Gateway Cl
Laptop ( not requested but useful)
Connections
Tablet Phone IoT SDK AP
Quick Examp
App Server
X – Backend ?
X - Channel
X - Platform
API Neutrality
Mainframe to Mobile ?
StrongLoop Confidential and Proprietary Information – © 2014
API “Re-Composition” is good…but not good enough
Relational Database Clustered Database Security Gateway Cloud
Laptop ( not requested but useful)
Connections
Tablet Phone IoT SDK API SERVER
Quick Example of Use
App Server
Relational Database Clustered Database Security Gateway
Laptop ( not requested but useful)
Connections
Tablet Phone IoT SDK
Quick E
App Server
Auth
Routing
Rate-Limit
Proxy
Mediation
Orchestration
Analytics
StrongLoop Confidential and Proprietary Information – © 2014
The need is “DE-COMPOSITION”
SaaS Mobile IoTWeb
App Server API Server
HTML JSON
{JSON}
{JSON}
{JSON}<SOAP/XML>
<TABLE>
StrongLoop Confidential and Proprietary Information – © 2014
Micro-services has arrived
StrongLoop Confidential and Proprietary Information – © 2014
Now I know !!!
So who is propelling this transformation ?
Why Node?
10
Node is FAST…er
Node is perfect for APIs
Node is JavaScript & JSON
…and highly concurrent!
StrongLoop Confidential and Proprietary Information – © 2015
Node is much lighter
  LinkedIn moved from Rails to Node.js
–  Cut down servers by 90% (30 à 3)
–  Lower memory overhead and up to 20X faster
  PayPal migrated to Node.js from Java:
–  Reduce development time by >50%
–  2X speed of delivery with less than existing resources
–  33% lesser lines of code
–  40% fewer files
  Groupon displaced Ruby and Java with Node.js across the board:
–  50% improvement in page response times
–  Agile builds and deploys
Any use-cases ?
Behind the Curtain
Node Bindings C/C++
(socket, http, etc.)
V8
Libuv
Libeio
(thread pool)
Libev
(event loop)
IOCP
(IO
completion
ports)
Node Standard Library (JavaScript)
epoll/kqueue/poll (event
ports)
Linux Kernel
Windows
Kernel
Yes, it’s C back there
StrongLoop Confidential and Proprietary Information – © 2015
{“..”} JSON is the new first class citizen
StrongLoop Confidential and Proprietary Information – © 2014
Full Stack JavaScript is powering mobility
Angular
Bootstrap
Ionic
Cordova
Gartner predicts by 2016 more than 50% of the
apps deployed will be Hybrid apps.
LoopBack
API Server
Node.js
StrongLoop Confidential and Proprietary Information – © 2014
Nodies are not just Silicon Valley hipsters !
StrongLoop Confidential and Proprietary Information – © 2014
s
Node is de-facto for the backend API now
•  67K Developers
•  Fastest Growing (120K+ > Java, Ruby, PHP…)
StrongLoop Confidential and Proprietary Information – © 2014
Really, But isn’t it the wild west ?
Toronto node js_meetup
These guys sent me !
Bert
Belder
Ben
Noordhuis
Node Core
Raymond
Feng
Ritchie
Martori
LoopBack / Express Core
Sam
Roberts
Miroslav
Bajtos
Ryan
Graham
Plus 15 other full-time open source
developers working on Node.js core,
modules and tools.
Contributing to over 100 open source
modules.
Supporting banks, retail, IoT companies,
startups and internet companies on
Node.js
The only product company dedicated only to Node
Jason Pressman Kiran Prasad
Neil Day
Nick Sturiale
Paul Ambrose
Marten Mickos
StrongLoop Confidential and Proprietary Information – © 2014
StrongLoop iPaaS for APIs
Compose
Integrate
Test &
Build
Deploy &
Scale
Secure &
Manage
Monitor &
Analyze
•  Loopback
•  Express
•  Node Code Generators
•  Data Connectors
•  Service Connectors
•  Client/Mobile SDKs
•  Mobile Services
•  Debugger
•  Build Utilities
•  Private Registry
•  Bootstrap deployer
•  Runtime manager
•  Clustering, HA, Hot Deploy
•  API Gateway
•  Distributed Routing.
•  Performance Monitoring
•  Analytics
•  Metering
StrongLoop
API Platform
StrongLoop Confidential and Proprietary Information – © 2015
Toronto node js_meetup
Popular Frameworks
Toronto node js_meetup
Sample Code (Router using express 4.x)
Pros
Great starting point
Low learning curve
Nearly a standard for Node.js web
middleware
Fully customizable
Targeted at browser, hence templating
and rendering OOB
Cons
All endpoints need to be created
manually
Developers may end up creating their
own non-optimized libraries
Every end point needs to be tested
Refactoring is painful, update
everything everywhere
No standards or prescription, DIY
26
Express
Toronto node js_meetup
Sample Code (Router using restify)
Pros
Very stable and actively developed.
Automatic DTrace support for all
handlers on enabled platforms
Built in throttling
SPDY support
Borrows from express but without
unnecessary templating/rendering
Strict API with full control over HTTP
interactions
Visibility into latency and app
characteristics
Cons
All endpoints need to be created
manually
Developers may end up creating their
own non-optimized libraries
Every end point needs to be tested
Refactoring is painful, update
everything everywhere
No standards or prescription, DIY
Less documentation
Restify
Toronto node js_meetup
Sample Code (Router using hapi)
Sample Code (Router using hapi)
Pros
Supported by Walmart labs. Less known
but getting momentum
Very granular control over request
handling
Detailed API reference with support for
document generation
Significantly more functionality for
building web servers
Pseudo prescriptive with configuration
centric approach
Caching, Authentication and input
validation available
Plugin based architecture for scaling
Cons
Good construction blocks but left to your
own devices to figure out design patterns
Binds you to specific modules and tool chains
(catbox, joi, tv, boom, good, travelogue, yar)
All endpoints need to be created
manually
Developers may end up creating their
own non-optimized libraries
Every end point needs to be tested
Refactoring is painful, update everything
everywhere
33
Toronto node js_meetup
Sample Code (Router using Loopback)
Code needed
Endpoints automatically created
Sample Code (API explorer and test)
Code needed
API explorer automatically created
Sample Code (RPC)
Code needed
Remotable calls
Pros
Very quick RESTful API development
Convention over configuration (extends express)
Built in models ready to use (ORM)
RPC support, Web and Mobile SDKs
Data Connectors
Fully configurable when needed
Extensive documentation
Commercial support and full time team working on project
(Loopback)
Mobile Services (Push, Geo, Storage, Sync, Offline, File,
Device, User) - Loopback
Authentication, validation and Authorization
Cons
Higher learning curve
Opinionated
REST
API
PUSH
GEO
OFF
SYNC
DEVICE
USER FILE
Relational Database Clustered Database Security Gateway Cloud
Laptop ( not requested but useful)
Connections
Tablet Phone IoT SDK API SERVER
Quick Example of Use
App S
Add
App Server
Storage
Relational Database Clustered Database Security Gateway Cloud Firewall SOA Bus ( not sure on this one)
Laptop ( not requested but useful)
Connections
Tablet Phone IoT SDK API SERVER Items for ACL
Quick Example of Use
App Server
Add On
App Server
REST
API
GATEWAY
Channel SDKs
API ENGINE
C
O
N
N
E
C
T
O
R
s
A
P
I
S
D
K
s
Loopback framework – ORM and Mobile connect in Node.js
REST API
atabase Security Gateway Cloud Firewall SOA Bus ( not sure on this one)
Phone IoT SDK API SERVER Items for ACL
Quick Example of Use
App Server
Add On
App Server
API
Explorer
Magical Features
u  Discovery
u  Migration / Replication
u  Relationship Mapping
u  Mixins - Aggregation
u  Access Control
u  User Management
u  Isomorphic JS / Remoting
u  Routing
StrongLoop Confidential and Proprietary Information – © 2014
Data & Services Integration
Services
Relational Database Clustered Database Security Gateway Cloud Firewall SOA Bus ( no
Laptop ( not requested but useful)
Connections
Tablet Phone IoT SDK API SERVER Items for A
Quick Example of Use
App Server
Add On
App Server
Storage
y Cloud Firewall SOA Bus ( not sure on this one)
API SERVER Items for ACL
Quick Example of Use
App Server
Add On
REST
Messaging
Database
NoSQL
Marquee - Discovery & Migration !
StrongLoop Confidential and Proprietary Information – © 2014
User Experience
  Arc UI – architect view
–  Widget driven
–  Visual composition,
management & operations
–  Marquee featured, evolving
platform
  StrongLoop Console (slc) -
developer view
–  Command Line Interface
–  Full featured
–  Greater customization support
StrongLoop Confidential and Proprietary Information – © 2014
API Explorer (Swagger) – Iterative build and test w/o frontend
StrongLoop Confidential and Proprietary Information – © 2014
API Gateway *
Security & Social Logins
* Evolving. Please do not share without written
consent from StrongLoop
Marquee – Auth, Routing, Throttling, Proxy, Mediation, Aggregation, Virtualization
StrongLoop Confidential and Proprietary Information – © 2014
API Gateway*
u  Security (AAA)
u  Mediation and Transformation
u  Infrastructure QoS (pagination, throttling, caching, delivery
guarantee, firewall)
u  Analytics and health monitoring
u  Aggregation and Microservices Routing
u  Virtualization and Reverse Proxy
StrongLoop Confidential and Proprietary Information – © 2014
* Evolving. Please do not share without written
consent from StrongLoop
Node vs Java for REST routing *
46
StrongLoop Confidential and Proprietary Information – © 2014
* Highly Confidential. Please do not share without written consent from StrongLoop
Some Numbers – Top 3 US Bank *
StrongLoop Confidential and Proprietary Information – © 2014
* Highly Confidential. Please do not share without written consent from StrongLoop
Developer SDKs
Omni-channel Client SDKs
JS
client
JS
Server
Remoting
JS
client
Marquee – Isomorphic JS, Mobile Integration
StrongLoop Confidential and Proprietary Information – © 2014
Mobile Services
mBaaS Capabilities
Marquee – Push, Geo, Offline Sync, Storage
StrongLoop Confidential and Proprietary Information – © 2014
Push Notification
StrongLoop Confidential and Proprietary Information – © 2014
GeoLocation
Storage Service
52
StrongLoop Confidential and Proprietary Information – © 2014
Offline Sync
StrongLoop Confidential and Proprietary Information – © 2014
Platform support &
DevOps Tool-chains
Node.js support (Sample modules set)
55
Node.js Core
strong-
module-loader
strong-cluster-
connect-store
strong-cluster-
control
SL-Config
Loopback
 Strong-mq
strong-task-
emitter
Engine.io
 Mongoose
Strong-agent
 strong-cluster-
socket.io-store
strong-config-
loader
Request
Node-
heapdump
Asynch
node-
inspector

Passport
Strong-
remoting
Q
EJS
Express
Connect
Socket.IO
Reggie
 Postgres
Connector
Oracle
Connector
SQL Server
Connector
MongoDB
Connector
REST
Connector
In-Memory
connector
LIBUV
V8 Profiler
①  Multi-platform (Windows, Unix, Solaris, Mac) support
②  On-premises, private or public cloud support
③  Certified Node.js curated modules and ecosystem
④  Commercial Enterprise supported, security updates
StrongLoop Confidential and Proprietary Information – © 2014
Private Registry
Debugging
Marquee – Chrome Dev Tools, Remote
StrongLoop Confidential and Proprietary Information – © 2014
Debugging server side clustered apps
slc debug app.js
Debugging single process
slc debug app.js
http://localhost:8080/debug?port=<5858+ID-of-process>
Debugging clustered process in V11
%node debug –p <PID>
connecting…ok
…
debug>quit
%node-inspector
http://127.0.0.1:8080/debug?port =5858
Or
process._debugPort = 5858 + cluster.worker.id
Debugging clustered process in V10
Profilers
StrongLoop Confidential and Proprietary Information – © 2014
Does Node have memory leaks ?
StrongLoop OSS - HeapSnapshots
slc runctl heap-snapshot ID
Sudden leaks
heapdump for V8 snapshots
npm install heapdump
  Add to app : var heapdump = require(‘heapdump’)
  Method 1 : writeSnapshot
  Method 2 : SIGUSR2 (Unix only)
  Make sure your directory is writable
var heapdump = require('heapdump')
...
heapdump.writeSnapshot()
kill –USR2 <pid>
process.chdir('/path/to/writeable/dir’)
Heap Snapshot strategies
  Programmatic heap snapshots (timer based)
  Programmatic heap snapshots (threshold based)
var heapdump = require('heapdump')
...
setInterval(function () {
heapdump.writeSnapshot()
}, 6000 * 30) <strong>(1)</strong>
var heapdump = require('heapdump')
var nextMBThreshold = 0 <strong>(1)</strong>
setInterval(function () {
var memMB = process.memoryUsage().rss / 1048576 <strong>(2)</
strong>
if (memMB &gt; nextMBThreshold) { <strong>(3)</strong>
heapdump.writeSnapshot()
nextMBThreshold += 100
}
}, 6000 * 2) <strong>(4)</strong>
How we fixed a real production
problem
Don’t Block the EventLoop
StrongLoop Confidential and Proprietary Information – © 2015
Blocked event loop in Meteor atmosphere
  node-fibers implements co-routines. Meteor uses this to hack local thread storage allowing V8
to run multiple execution contexts each mapped to a co-routine.
FindOrAllocatePerThreadDataForThisThread() used in switching context between co-
routines
  Co-routines are cooperative; the current coroutine has to yield control before another one can
run and that is what Meteor does in its process.nextTick() callback; it essentially builds
concurrent (but not parallel) green threads on a round-robin scheduler
  Too many tiny tasks and not one long running one was blocking the event loop
process.nextTick() has a failsafe mechanism where it will process “x” tick callbacks before
deferring the remaining ones to the next event loop tick.
  Native MongoDB driver disabled the failsafe to silence a warning message in node v0.10 about
maxtickDepth being reached
ticks parent name
2274 7.3% v8::internal::Isolate::FindOrAllocatePerThreadDataForThisThread()
1325 58.3% LazyCompile: ~<anonymous> packages/meteor.js:683
1325 100.0% LazyCompile: _tickCallback node.js:399
The solution
  The workaround: switch fromprocess.nextTick() to setImmediate()
Performance Monitoring
Production Monitoring & 3rd Party integration
•  Local / Hosted
•  Graphite
•  Splunk
•  Datadog
•  CA Introscope
StrongLoop Confidential and Proprietary Information – © 2014
Dynamic Instrumentation
Agent App
Monkey
Patching
Agent App
Dynamic
Instrument
•  Live Edit
•  Line Level
Instrumentation
•  Any package, any
framework, any code
•  Custom logic
•  Counters, Gauges and
Timers
•  HA rollback
StrongLoop Confidential and Proprietary Information – © 2015
Can Errors be stitched into a trace and recovered ?
Enter StrongLoop / Zones
Long error traces
Runtime Mgmt. & Scaling
Build & Deploy
StrongLoop Confidential and Proprietary Information – © 2014
Cluster and runtime scaling
Marquee – HA, Auto-scale, Hot Deploy
StrongLoop Confidential and Proprietary Information – © 2014
MESH – Micro-services Deploy on Scale
StrongLoop Confidential and Proprietary Information – © 2014
First there was Node
Thank you!
JUST WIN,
BABY!
1 of 77

Recommended

Node.js Frameworks & Design Patterns Webinar by
Node.js Frameworks & Design Patterns WebinarNode.js Frameworks & Design Patterns Webinar
Node.js Frameworks & Design Patterns WebinarShubhra Kar
8.1K views40 slides
Connect js nodejs_devops_shubhra by
Connect js nodejs_devops_shubhraConnect js nodejs_devops_shubhra
Connect js nodejs_devops_shubhraShubhra Kar
887 views26 slides
Connect js nodejs_api_shubhra by
Connect js nodejs_api_shubhraConnect js nodejs_api_shubhra
Connect js nodejs_api_shubhraShubhra Kar
1.4K views26 slides
OpenSource Node.js API Framework and Server for Enterprise by
OpenSource Node.js API Framework and Server for EnterpriseOpenSource Node.js API Framework and Server for Enterprise
OpenSource Node.js API Framework and Server for EnterpriseShubhra Kar
3K views24 slides
Triangle Node Meetup : APIs in Minutes with Node.js by
Triangle Node Meetup :  APIs in Minutes with Node.jsTriangle Node Meetup :  APIs in Minutes with Node.js
Triangle Node Meetup : APIs in Minutes with Node.jsShubhra Kar
1.7K views30 slides
Design patterns talk_node_summit by
Design patterns talk_node_summitDesign patterns talk_node_summit
Design patterns talk_node_summitShubhra Kar
1.6K views31 slides

More Related Content

What's hot

Node Interactive : 7 years, 7 design patterns, will node continue to outshine by
Node Interactive : 7 years, 7 design patterns, will node continue to outshineNode Interactive : 7 years, 7 design patterns, will node continue to outshine
Node Interactive : 7 years, 7 design patterns, will node continue to outshineShubhra Kar
991 views29 slides
Getting Started with the Node.js LoopBack APi Framework by
Getting Started with the Node.js LoopBack APi FrameworkGetting Started with the Node.js LoopBack APi Framework
Getting Started with the Node.js LoopBack APi FrameworkJimmy Guerrero
3.5K views16 slides
Ibm_interconnect_restapi_workshop by
Ibm_interconnect_restapi_workshopIbm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshopShubhra Kar
673 views18 slides
API Description Languages: Which is the Right One for Me? by
API Description Languages: Which is the Right One for Me?API Description Languages: Which is the Right One for Me?
API Description Languages: Which is the Right One for Me?Akana
2.9K views32 slides
LoopBack: a productivity booster for MEAN by
LoopBack: a productivity booster for MEANLoopBack: a productivity booster for MEAN
LoopBack: a productivity booster for MEANMiroslav Bajtoš
2.3K views23 slides
Webcast: API-Centric Architecture for Building Context-Aware Apps by
Webcast: API-Centric Architecture for Building Context-Aware AppsWebcast: API-Centric Architecture for Building Context-Aware Apps
Webcast: API-Centric Architecture for Building Context-Aware AppsApigee | Google Cloud
9K views32 slides

What's hot(20)

Node Interactive : 7 years, 7 design patterns, will node continue to outshine by Shubhra Kar
Node Interactive : 7 years, 7 design patterns, will node continue to outshineNode Interactive : 7 years, 7 design patterns, will node continue to outshine
Node Interactive : 7 years, 7 design patterns, will node continue to outshine
Shubhra Kar991 views
Getting Started with the Node.js LoopBack APi Framework by Jimmy Guerrero
Getting Started with the Node.js LoopBack APi FrameworkGetting Started with the Node.js LoopBack APi Framework
Getting Started with the Node.js LoopBack APi Framework
Jimmy Guerrero3.5K views
Ibm_interconnect_restapi_workshop by Shubhra Kar
Ibm_interconnect_restapi_workshopIbm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshop
Shubhra Kar673 views
API Description Languages: Which is the Right One for Me? by Akana
API Description Languages: Which is the Right One for Me?API Description Languages: Which is the Right One for Me?
API Description Languages: Which is the Right One for Me?
Akana2.9K views
LoopBack: a productivity booster for MEAN by Miroslav Bajtoš
LoopBack: a productivity booster for MEANLoopBack: a productivity booster for MEAN
LoopBack: a productivity booster for MEAN
Miroslav Bajtoš2.3K views
Webcast: API-Centric Architecture for Building Context-Aware Apps by Apigee | Google Cloud
Webcast: API-Centric Architecture for Building Context-Aware AppsWebcast: API-Centric Architecture for Building Context-Aware Apps
Webcast: API-Centric Architecture for Building Context-Aware Apps
Ultimate Guide to 30+ API Documentation Solutions by Bill Doerrfeld
Ultimate Guide to 30+ API Documentation SolutionsUltimate Guide to 30+ API Documentation Solutions
Ultimate Guide to 30+ API Documentation Solutions
Bill Doerrfeld99.3K views
API Description Languages by Akana
API Description LanguagesAPI Description Languages
API Description Languages
Akana7.5K views
StrongLoop DevOps Overview by jguerrero999
StrongLoop DevOps OverviewStrongLoop DevOps Overview
StrongLoop DevOps Overview
jguerrero999796 views
Another API-Blueprint, RAML and Swagger Comparison by SmartBear
Another API-Blueprint, RAML and Swagger ComparisonAnother API-Blueprint, RAML and Swagger Comparison
Another API-Blueprint, RAML and Swagger Comparison
SmartBear26.1K views
Building a Node.js API backend with LoopBack in 5 Minutes by Raymond Feng
Building a Node.js API backend with LoopBack in 5 MinutesBuilding a Node.js API backend with LoopBack in 5 Minutes
Building a Node.js API backend with LoopBack in 5 Minutes
Raymond Feng18.9K views
API Athens Meetup - API standards 25-6-2014 by Michael Petychakis
API Athens Meetup - API standards   25-6-2014API Athens Meetup - API standards   25-6-2014
API Athens Meetup - API standards 25-6-2014
Michael Petychakis3.4K views
Ben Kehoe - Serverless Architecture for the Internet of Things by ServerlessConf
Ben Kehoe - Serverless Architecture for the Internet of ThingsBen Kehoe - Serverless Architecture for the Internet of Things
Ben Kehoe - Serverless Architecture for the Internet of Things
ServerlessConf3.1K views
apidays LIVE Paris - The Business of APIs by Jed Ng by apidays
apidays LIVE Paris - The Business of APIs by Jed Ngapidays LIVE Paris - The Business of APIs by Jed Ng
apidays LIVE Paris - The Business of APIs by Jed Ng
apidays100 views
REST API Doc Best Practices by Marta Rauch
REST API Doc Best PracticesREST API Doc Best Practices
REST API Doc Best Practices
Marta Rauch6.8K views
Maintainable API Docs and Other Rainbow Colored Unicorns by Neil Mansilla
Maintainable API Docs and Other Rainbow Colored UnicornsMaintainable API Docs and Other Rainbow Colored Unicorns
Maintainable API Docs and Other Rainbow Colored Unicorns
Neil Mansilla16.5K views
Serverless Architecture by Saul Caganoff
Serverless ArchitectureServerless Architecture
Serverless Architecture
Saul Caganoff1.2K views

Viewers also liked

StrongLoop Node.js API Security & Customization by
StrongLoop Node.js API Security & CustomizationStrongLoop Node.js API Security & Customization
StrongLoop Node.js API Security & Customizationjguerrero999
9.6K views67 slides
Loopback presentation by tineco by
Loopback presentation by tinecoLoopback presentation by tineco
Loopback presentation by tinecoStéphane Guilly
919 views67 slides
Authenticating and Securing Node.js APIs by
Authenticating and Securing Node.js APIsAuthenticating and Securing Node.js APIs
Authenticating and Securing Node.js APIsJimmy Guerrero
5.2K views29 slides
Micro Gateways are a Big Deal by
Micro Gateways are a Big DealMicro Gateways are a Big Deal
Micro Gateways are a Big DealJoe Sepi
221 views81 slides
Loopback by
LoopbackLoopback
LoopbackNetProtocol Xpert
829 views5 slides
Picking the Right Node.js Framework for Your Use Case by
Picking the Right Node.js Framework for Your Use CasePicking the Right Node.js Framework for Your Use Case
Picking the Right Node.js Framework for Your Use CaseJimmy Guerrero
4.1K views40 slides

Viewers also liked(20)

StrongLoop Node.js API Security & Customization by jguerrero999
StrongLoop Node.js API Security & CustomizationStrongLoop Node.js API Security & Customization
StrongLoop Node.js API Security & Customization
jguerrero9999.6K views
Authenticating and Securing Node.js APIs by Jimmy Guerrero
Authenticating and Securing Node.js APIsAuthenticating and Securing Node.js APIs
Authenticating and Securing Node.js APIs
Jimmy Guerrero5.2K views
Micro Gateways are a Big Deal by Joe Sepi
Micro Gateways are a Big DealMicro Gateways are a Big Deal
Micro Gateways are a Big Deal
Joe Sepi221 views
Picking the Right Node.js Framework for Your Use Case by Jimmy Guerrero
Picking the Right Node.js Framework for Your Use CasePicking the Right Node.js Framework for Your Use Case
Picking the Right Node.js Framework for Your Use Case
Jimmy Guerrero4.1K views
Soluciones tecnológicas para REA by Ricardo Corai
Soluciones tecnológicas para REASoluciones tecnológicas para REA
Soluciones tecnológicas para REA
Ricardo Corai947 views
Implementación Repositorio De Objetos De Aprendizajes Basado En by f.cabrera1
Implementación Repositorio De Objetos De Aprendizajes Basado EnImplementación Repositorio De Objetos De Aprendizajes Basado En
Implementación Repositorio De Objetos De Aprendizajes Basado En
f.cabrera1497 views
What is Node.js used for: The 2015 Node.js Overview Report by Gabor Nagy
What is Node.js used for: The 2015 Node.js Overview ReportWhat is Node.js used for: The 2015 Node.js Overview Report
What is Node.js used for: The 2015 Node.js Overview Report
Gabor Nagy1.1K views
Presentacion MoodleMoot 2014 Colombia - Integración Moodle con un Repositorio... by Paola Amadeo
Presentacion MoodleMoot 2014 Colombia - Integración Moodle con un Repositorio...Presentacion MoodleMoot 2014 Colombia - Integración Moodle con un Repositorio...
Presentacion MoodleMoot 2014 Colombia - Integración Moodle con un Repositorio...
Paola Amadeo1.1K views
Responsive Design by MRMtech
Responsive DesignResponsive Design
Responsive Design
MRMtech3.2K views
Stack Overflow - It's all about performance / Marco Cecconi (Stack Overflow) by Ontico
Stack Overflow - It's all about performance / Marco Cecconi (Stack Overflow)Stack Overflow - It's all about performance / Marco Cecconi (Stack Overflow)
Stack Overflow - It's all about performance / Marco Cecconi (Stack Overflow)
Ontico4.3K views
Modern HTML & CSS Coding: Speed, Semantics & Structure by Raven Tools
Modern HTML & CSS Coding: Speed, Semantics & StructureModern HTML & CSS Coding: Speed, Semantics & Structure
Modern HTML & CSS Coding: Speed, Semantics & Structure
Raven Tools4.4K views
Rapid API Development with LoopBack/StrongLoop by Raymond Camden
Rapid API Development with LoopBack/StrongLoopRapid API Development with LoopBack/StrongLoop
Rapid API Development with LoopBack/StrongLoop
Raymond Camden5.6K views
StrongLoop Overview by Shubhra Kar
StrongLoop OverviewStrongLoop Overview
StrongLoop Overview
Shubhra Kar2.3K views
Why Scala for Web 2.0? by Alex Payne
Why Scala for Web 2.0?Why Scala for Web 2.0?
Why Scala for Web 2.0?
Alex Payne24.4K views

Similar to Toronto node js_meetup

Seattle StrongLoop Node.js Workshop by
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopJimmy Guerrero
1.9K views81 slides
Overview of azure microservices and the impact on integration by
Overview of azure microservices and the impact on integrationOverview of azure microservices and the impact on integration
Overview of azure microservices and the impact on integrationBizTalk360
4.7K views43 slides
Introducing ONAP for OpenStack St Louis Meetup by
Introducing ONAP for OpenStack St Louis MeetupIntroducing ONAP for OpenStack St Louis Meetup
Introducing ONAP for OpenStack St Louis Meetupdjzook
1.2K views23 slides
AWS Webcast - Splunk and Autodesk by
AWS Webcast - Splunk and AutodeskAWS Webcast - Splunk and Autodesk
AWS Webcast - Splunk and AutodeskAmazon Web Services
2K views44 slides
MuleSoft London Community October 2017 - Hybrid and SAP Integration by
MuleSoft London Community October 2017 - Hybrid and SAP IntegrationMuleSoft London Community October 2017 - Hybrid and SAP Integration
MuleSoft London Community October 2017 - Hybrid and SAP IntegrationPace Integration
754 views22 slides
Soa12c launch 1 overview cr by
Soa12c launch 1 overview crSoa12c launch 1 overview cr
Soa12c launch 1 overview crVasily Demin
351 views31 slides

Similar to Toronto node js_meetup(20)

Seattle StrongLoop Node.js Workshop by Jimmy Guerrero
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js Workshop
Jimmy Guerrero1.9K views
Overview of azure microservices and the impact on integration by BizTalk360
Overview of azure microservices and the impact on integrationOverview of azure microservices and the impact on integration
Overview of azure microservices and the impact on integration
BizTalk3604.7K views
Introducing ONAP for OpenStack St Louis Meetup by djzook
Introducing ONAP for OpenStack St Louis MeetupIntroducing ONAP for OpenStack St Louis Meetup
Introducing ONAP for OpenStack St Louis Meetup
djzook1.2K views
MuleSoft London Community October 2017 - Hybrid and SAP Integration by Pace Integration
MuleSoft London Community October 2017 - Hybrid and SAP IntegrationMuleSoft London Community October 2017 - Hybrid and SAP Integration
MuleSoft London Community October 2017 - Hybrid and SAP Integration
Pace Integration754 views
Soa12c launch 1 overview cr by Vasily Demin
Soa12c launch 1 overview crSoa12c launch 1 overview cr
Soa12c launch 1 overview cr
Vasily Demin351 views
Go Cloud Native with IBM Bluemix Developer Console - GIDS17 by Vidyasagar Machupalli
Go Cloud Native with IBM Bluemix Developer Console - GIDS17Go Cloud Native with IBM Bluemix Developer Console - GIDS17
Go Cloud Native with IBM Bluemix Developer Console - GIDS17
REST - What's It All About? (SAP TechEd 2012, CD110) by Sascha Wenninger
REST - What's It All About? (SAP TechEd 2012, CD110)REST - What's It All About? (SAP TechEd 2012, CD110)
REST - What's It All About? (SAP TechEd 2012, CD110)
Sascha Wenninger1.8K views
2014 q3-platform-update-v1.06.johnmathon by aaronwso2
2014 q3-platform-update-v1.06.johnmathon2014 q3-platform-update-v1.06.johnmathon
2014 q3-platform-update-v1.06.johnmathon
aaronwso2417 views
Teched India Vijay Interop Track by vijayrvr
Teched India Vijay Interop TrackTeched India Vijay Interop Track
Teched India Vijay Interop Track
vijayrvr337 views
Business model driven cloud adoption - what NI is doing in the cloud by Ernest Mueller
Business model driven cloud adoption -  what  NI is doing in the cloudBusiness model driven cloud adoption -  what  NI is doing in the cloud
Business model driven cloud adoption - what NI is doing in the cloud
Ernest Mueller1.8K views
Pivoting Spring XD to Spring Cloud Data Flow with Sabby Anandan by PivotalOpenSourceHub
Pivoting Spring XD to Spring Cloud Data Flow with Sabby AnandanPivoting Spring XD to Spring Cloud Data Flow with Sabby Anandan
Pivoting Spring XD to Spring Cloud Data Flow with Sabby Anandan
WSO2Con Asia 2014 - Building the API-Centric Enterprise by WSO2
WSO2Con Asia 2014 - Building the API-Centric EnterpriseWSO2Con Asia 2014 - Building the API-Centric Enterprise
WSO2Con Asia 2014 - Building the API-Centric Enterprise
WSO2618 views
Cloud Computing & Sun Vision 03262009 by guest829442
Cloud Computing & Sun Vision 03262009Cloud Computing & Sun Vision 03262009
Cloud Computing & Sun Vision 03262009
guest829442811 views

Recently uploaded

Bootstrapping vs Venture Capital.pptx by
Bootstrapping vs Venture Capital.pptxBootstrapping vs Venture Capital.pptx
Bootstrapping vs Venture Capital.pptxZeljko Svedic
17 views17 slides
What is API by
What is APIWhat is API
What is APIartembondar5
16 views15 slides
tecnologia18.docx by
tecnologia18.docxtecnologia18.docx
tecnologia18.docxnosi6702
6 views5 slides
Advanced API Mocking Techniques Using Wiremock by
Advanced API Mocking Techniques Using WiremockAdvanced API Mocking Techniques Using Wiremock
Advanced API Mocking Techniques Using WiremockDimpy Adhikary
5 views11 slides
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile... by
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...Stefan Wolpers
49 views38 slides
predicting-m3-devopsconMunich-2023.pptx by
predicting-m3-devopsconMunich-2023.pptxpredicting-m3-devopsconMunich-2023.pptx
predicting-m3-devopsconMunich-2023.pptxTier1 app
10 views24 slides

Recently uploaded(20)

Bootstrapping vs Venture Capital.pptx by Zeljko Svedic
Bootstrapping vs Venture Capital.pptxBootstrapping vs Venture Capital.pptx
Bootstrapping vs Venture Capital.pptx
Zeljko Svedic17 views
tecnologia18.docx by nosi6702
tecnologia18.docxtecnologia18.docx
tecnologia18.docx
nosi67026 views
Advanced API Mocking Techniques Using Wiremock by Dimpy Adhikary
Advanced API Mocking Techniques Using WiremockAdvanced API Mocking Techniques Using Wiremock
Advanced API Mocking Techniques Using Wiremock
Dimpy Adhikary5 views
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile... by Stefan Wolpers
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...
Stefan Wolpers49 views
predicting-m3-devopsconMunich-2023.pptx by Tier1 app
predicting-m3-devopsconMunich-2023.pptxpredicting-m3-devopsconMunich-2023.pptx
predicting-m3-devopsconMunich-2023.pptx
Tier1 app10 views
Mobile App Development Company by Richestsoft
Mobile App Development CompanyMobile App Development Company
Mobile App Development Company
Richestsoft 6 views
Supercharging your Python Development Environment with VS Code and Dev Contai... by Dawn Wages
Supercharging your Python Development Environment with VS Code and Dev Contai...Supercharging your Python Development Environment with VS Code and Dev Contai...
Supercharging your Python Development Environment with VS Code and Dev Contai...
Dawn Wages9 views
Understanding HTML terminology by artembondar5
Understanding HTML terminologyUnderstanding HTML terminology
Understanding HTML terminology
artembondar59 views
Electronic AWB - Electronic Air Waybill by Freightoscope
Electronic AWB - Electronic Air Waybill Electronic AWB - Electronic Air Waybill
Electronic AWB - Electronic Air Waybill
Freightoscope 7 views
Streamlining Your Business Operations with Enterprise Application Integration... by Flexsin
Streamlining Your Business Operations with Enterprise Application Integration...Streamlining Your Business Operations with Enterprise Application Integration...
Streamlining Your Business Operations with Enterprise Application Integration...
Flexsin 5 views
Top-5-production-devconMunich-2023.pptx by Tier1 app
Top-5-production-devconMunich-2023.pptxTop-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptx
Tier1 app10 views
How to build dyanmic dashboards and ensure they always work by Wiiisdom
How to build dyanmic dashboards and ensure they always workHow to build dyanmic dashboards and ensure they always work
How to build dyanmic dashboards and ensure they always work
Wiiisdom18 views

Toronto node js_meetup

  • 1. Enterprise Node.js to Power the API Economy Shubhra Kar | Products & Education twitter:@shubhrakar mail:skar@strongloop.com
  • 2. Wake up to the API economy Explosion of channels (browsers, mobile, sensors, wearable, real-time communication) u Sheer number of clients has increased u Clients are increasingly sophisticated u Node.js is the platform of choice for these API StrongLoop Confidential and Proprietary Information – © 2015
  • 3. Latency demands are uncompromising 10 25 50 100100 50 10 15 40 100 25 Web SaaS Mobile IoT The new curve Concurrent Users Latency Adoption StrongLoop Confidential and Proprietary Information – © 2015
  • 4. Not all APIs are built equal The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again. Relational Database Clustered Database Security Gateway Cloud Firewall SOA Bus ( not sure on this one) Laptop ( not requested but useful) Connections Tablet Phone IoT SDK API SERVER Items for ACL Quick Example of Use App Server Add On App Server Relational Database Clustered Database Security Gateway Cl Laptop ( not requested but useful) Connections Tablet Phone IoT SDK AP Quick Examp App Server X – Backend ? X - Channel X - Platform API Neutrality Mainframe to Mobile ? StrongLoop Confidential and Proprietary Information – © 2014
  • 5. API “Re-Composition” is good…but not good enough Relational Database Clustered Database Security Gateway Cloud Laptop ( not requested but useful) Connections Tablet Phone IoT SDK API SERVER Quick Example of Use App Server Relational Database Clustered Database Security Gateway Laptop ( not requested but useful) Connections Tablet Phone IoT SDK Quick E App Server Auth Routing Rate-Limit Proxy Mediation Orchestration Analytics StrongLoop Confidential and Proprietary Information – © 2014
  • 6. The need is “DE-COMPOSITION” SaaS Mobile IoTWeb App Server API Server HTML JSON {JSON} {JSON} {JSON}<SOAP/XML> <TABLE> StrongLoop Confidential and Proprietary Information – © 2014
  • 7. Micro-services has arrived StrongLoop Confidential and Proprietary Information – © 2014
  • 9. So who is propelling this transformation ?
  • 10. Why Node? 10 Node is FAST…er Node is perfect for APIs Node is JavaScript & JSON …and highly concurrent! StrongLoop Confidential and Proprietary Information – © 2015 Node is much lighter
  • 11.   LinkedIn moved from Rails to Node.js –  Cut down servers by 90% (30 à 3) –  Lower memory overhead and up to 20X faster   PayPal migrated to Node.js from Java: –  Reduce development time by >50% –  2X speed of delivery with less than existing resources –  33% lesser lines of code –  40% fewer files   Groupon displaced Ruby and Java with Node.js across the board: –  50% improvement in page response times –  Agile builds and deploys Any use-cases ?
  • 12. Behind the Curtain Node Bindings C/C++ (socket, http, etc.) V8 Libuv Libeio (thread pool) Libev (event loop) IOCP (IO completion ports) Node Standard Library (JavaScript) epoll/kqueue/poll (event ports) Linux Kernel Windows Kernel Yes, it’s C back there StrongLoop Confidential and Proprietary Information – © 2015
  • 13. {“..”} JSON is the new first class citizen StrongLoop Confidential and Proprietary Information – © 2014
  • 14. Full Stack JavaScript is powering mobility Angular Bootstrap Ionic Cordova Gartner predicts by 2016 more than 50% of the apps deployed will be Hybrid apps. LoopBack API Server Node.js StrongLoop Confidential and Proprietary Information – © 2014
  • 15. Nodies are not just Silicon Valley hipsters ! StrongLoop Confidential and Proprietary Information – © 2014
  • 16. s Node is de-facto for the backend API now •  67K Developers •  Fastest Growing (120K+ > Java, Ruby, PHP…) StrongLoop Confidential and Proprietary Information – © 2014
  • 17. Really, But isn’t it the wild west ?
  • 19. These guys sent me ! Bert Belder Ben Noordhuis Node Core Raymond Feng Ritchie Martori LoopBack / Express Core Sam Roberts Miroslav Bajtos Ryan Graham Plus 15 other full-time open source developers working on Node.js core, modules and tools. Contributing to over 100 open source modules. Supporting banks, retail, IoT companies, startups and internet companies on Node.js
  • 20. The only product company dedicated only to Node Jason Pressman Kiran Prasad Neil Day Nick Sturiale Paul Ambrose Marten Mickos StrongLoop Confidential and Proprietary Information – © 2014
  • 21. StrongLoop iPaaS for APIs Compose Integrate Test & Build Deploy & Scale Secure & Manage Monitor & Analyze •  Loopback •  Express •  Node Code Generators •  Data Connectors •  Service Connectors •  Client/Mobile SDKs •  Mobile Services •  Debugger •  Build Utilities •  Private Registry •  Bootstrap deployer •  Runtime manager •  Clustering, HA, Hot Deploy •  API Gateway •  Distributed Routing. •  Performance Monitoring •  Analytics •  Metering StrongLoop API Platform StrongLoop Confidential and Proprietary Information – © 2015
  • 25. Sample Code (Router using express 4.x)
  • 26. Pros Great starting point Low learning curve Nearly a standard for Node.js web middleware Fully customizable Targeted at browser, hence templating and rendering OOB Cons All endpoints need to be created manually Developers may end up creating their own non-optimized libraries Every end point needs to be tested Refactoring is painful, update everything everywhere No standards or prescription, DIY 26 Express
  • 28. Sample Code (Router using restify)
  • 29. Pros Very stable and actively developed. Automatic DTrace support for all handlers on enabled platforms Built in throttling SPDY support Borrows from express but without unnecessary templating/rendering Strict API with full control over HTTP interactions Visibility into latency and app characteristics Cons All endpoints need to be created manually Developers may end up creating their own non-optimized libraries Every end point needs to be tested Refactoring is painful, update everything everywhere No standards or prescription, DIY Less documentation Restify
  • 31. Sample Code (Router using hapi)
  • 32. Sample Code (Router using hapi)
  • 33. Pros Supported by Walmart labs. Less known but getting momentum Very granular control over request handling Detailed API reference with support for document generation Significantly more functionality for building web servers Pseudo prescriptive with configuration centric approach Caching, Authentication and input validation available Plugin based architecture for scaling Cons Good construction blocks but left to your own devices to figure out design patterns Binds you to specific modules and tool chains (catbox, joi, tv, boom, good, travelogue, yar) All endpoints need to be created manually Developers may end up creating their own non-optimized libraries Every end point needs to be tested Refactoring is painful, update everything everywhere 33
  • 35. Sample Code (Router using Loopback) Code needed Endpoints automatically created
  • 36. Sample Code (API explorer and test) Code needed API explorer automatically created
  • 37. Sample Code (RPC) Code needed Remotable calls
  • 38. Pros Very quick RESTful API development Convention over configuration (extends express) Built in models ready to use (ORM) RPC support, Web and Mobile SDKs Data Connectors Fully configurable when needed Extensive documentation Commercial support and full time team working on project (Loopback) Mobile Services (Push, Geo, Storage, Sync, Offline, File, Device, User) - Loopback Authentication, validation and Authorization Cons Higher learning curve Opinionated
  • 39. REST API PUSH GEO OFF SYNC DEVICE USER FILE Relational Database Clustered Database Security Gateway Cloud Laptop ( not requested but useful) Connections Tablet Phone IoT SDK API SERVER Quick Example of Use App S Add App Server Storage Relational Database Clustered Database Security Gateway Cloud Firewall SOA Bus ( not sure on this one) Laptop ( not requested but useful) Connections Tablet Phone IoT SDK API SERVER Items for ACL Quick Example of Use App Server Add On App Server REST API GATEWAY Channel SDKs API ENGINE C O N N E C T O R s A P I S D K s Loopback framework – ORM and Mobile connect in Node.js REST API atabase Security Gateway Cloud Firewall SOA Bus ( not sure on this one) Phone IoT SDK API SERVER Items for ACL Quick Example of Use App Server Add On App Server API Explorer
  • 40. Magical Features u  Discovery u  Migration / Replication u  Relationship Mapping u  Mixins - Aggregation u  Access Control u  User Management u  Isomorphic JS / Remoting u  Routing StrongLoop Confidential and Proprietary Information – © 2014
  • 41. Data & Services Integration Services Relational Database Clustered Database Security Gateway Cloud Firewall SOA Bus ( no Laptop ( not requested but useful) Connections Tablet Phone IoT SDK API SERVER Items for A Quick Example of Use App Server Add On App Server Storage y Cloud Firewall SOA Bus ( not sure on this one) API SERVER Items for ACL Quick Example of Use App Server Add On REST Messaging Database NoSQL Marquee - Discovery & Migration ! StrongLoop Confidential and Proprietary Information – © 2014
  • 42. User Experience   Arc UI – architect view –  Widget driven –  Visual composition, management & operations –  Marquee featured, evolving platform   StrongLoop Console (slc) - developer view –  Command Line Interface –  Full featured –  Greater customization support StrongLoop Confidential and Proprietary Information – © 2014
  • 43. API Explorer (Swagger) – Iterative build and test w/o frontend StrongLoop Confidential and Proprietary Information – © 2014
  • 44. API Gateway * Security & Social Logins * Evolving. Please do not share without written consent from StrongLoop Marquee – Auth, Routing, Throttling, Proxy, Mediation, Aggregation, Virtualization StrongLoop Confidential and Proprietary Information – © 2014
  • 45. API Gateway* u  Security (AAA) u  Mediation and Transformation u  Infrastructure QoS (pagination, throttling, caching, delivery guarantee, firewall) u  Analytics and health monitoring u  Aggregation and Microservices Routing u  Virtualization and Reverse Proxy StrongLoop Confidential and Proprietary Information – © 2014 * Evolving. Please do not share without written consent from StrongLoop
  • 46. Node vs Java for REST routing * 46 StrongLoop Confidential and Proprietary Information – © 2014 * Highly Confidential. Please do not share without written consent from StrongLoop
  • 47. Some Numbers – Top 3 US Bank * StrongLoop Confidential and Proprietary Information – © 2014 * Highly Confidential. Please do not share without written consent from StrongLoop
  • 48. Developer SDKs Omni-channel Client SDKs JS client JS Server Remoting JS client Marquee – Isomorphic JS, Mobile Integration StrongLoop Confidential and Proprietary Information – © 2014
  • 49. Mobile Services mBaaS Capabilities Marquee – Push, Geo, Offline Sync, Storage StrongLoop Confidential and Proprietary Information – © 2014
  • 50. Push Notification StrongLoop Confidential and Proprietary Information – © 2014
  • 52. Storage Service 52 StrongLoop Confidential and Proprietary Information – © 2014
  • 53. Offline Sync StrongLoop Confidential and Proprietary Information – © 2014
  • 55. Node.js support (Sample modules set) 55 Node.js Core strong- module-loader strong-cluster- connect-store strong-cluster- control SL-Config Loopback Strong-mq strong-task- emitter Engine.io Mongoose Strong-agent strong-cluster- socket.io-store strong-config- loader Request Node- heapdump Asynch node- inspector Passport Strong- remoting Q EJS Express Connect Socket.IO Reggie Postgres Connector Oracle Connector SQL Server Connector MongoDB Connector REST Connector In-Memory connector LIBUV V8 Profiler ①  Multi-platform (Windows, Unix, Solaris, Mac) support ②  On-premises, private or public cloud support ③  Certified Node.js curated modules and ecosystem ④  Commercial Enterprise supported, security updates StrongLoop Confidential and Proprietary Information – © 2014
  • 57. Debugging Marquee – Chrome Dev Tools, Remote StrongLoop Confidential and Proprietary Information – © 2014
  • 58. Debugging server side clustered apps slc debug app.js Debugging single process slc debug app.js http://localhost:8080/debug?port=<5858+ID-of-process> Debugging clustered process in V11 %node debug –p <PID> connecting…ok … debug>quit %node-inspector http://127.0.0.1:8080/debug?port =5858 Or process._debugPort = 5858 + cluster.worker.id Debugging clustered process in V10
  • 59. Profilers StrongLoop Confidential and Proprietary Information – © 2014
  • 60. Does Node have memory leaks ? StrongLoop OSS - HeapSnapshots slc runctl heap-snapshot ID
  • 62. heapdump for V8 snapshots npm install heapdump   Add to app : var heapdump = require(‘heapdump’)   Method 1 : writeSnapshot   Method 2 : SIGUSR2 (Unix only)   Make sure your directory is writable var heapdump = require('heapdump') ... heapdump.writeSnapshot() kill –USR2 <pid> process.chdir('/path/to/writeable/dir’)
  • 63. Heap Snapshot strategies   Programmatic heap snapshots (timer based)   Programmatic heap snapshots (threshold based) var heapdump = require('heapdump') ... setInterval(function () { heapdump.writeSnapshot() }, 6000 * 30) <strong>(1)</strong> var heapdump = require('heapdump') var nextMBThreshold = 0 <strong>(1)</strong> setInterval(function () { var memMB = process.memoryUsage().rss / 1048576 <strong>(2)</ strong> if (memMB &gt; nextMBThreshold) { <strong>(3)</strong> heapdump.writeSnapshot() nextMBThreshold += 100 } }, 6000 * 2) <strong>(4)</strong>
  • 64. How we fixed a real production problem
  • 65. Don’t Block the EventLoop StrongLoop Confidential and Proprietary Information – © 2015
  • 66. Blocked event loop in Meteor atmosphere   node-fibers implements co-routines. Meteor uses this to hack local thread storage allowing V8 to run multiple execution contexts each mapped to a co-routine. FindOrAllocatePerThreadDataForThisThread() used in switching context between co- routines   Co-routines are cooperative; the current coroutine has to yield control before another one can run and that is what Meteor does in its process.nextTick() callback; it essentially builds concurrent (but not parallel) green threads on a round-robin scheduler   Too many tiny tasks and not one long running one was blocking the event loop process.nextTick() has a failsafe mechanism where it will process “x” tick callbacks before deferring the remaining ones to the next event loop tick.   Native MongoDB driver disabled the failsafe to silence a warning message in node v0.10 about maxtickDepth being reached ticks parent name 2274 7.3% v8::internal::Isolate::FindOrAllocatePerThreadDataForThisThread() 1325 58.3% LazyCompile: ~<anonymous> packages/meteor.js:683 1325 100.0% LazyCompile: _tickCallback node.js:399
  • 67. The solution   The workaround: switch fromprocess.nextTick() to setImmediate()
  • 69. Production Monitoring & 3rd Party integration •  Local / Hosted •  Graphite •  Splunk •  Datadog •  CA Introscope StrongLoop Confidential and Proprietary Information – © 2014
  • 70. Dynamic Instrumentation Agent App Monkey Patching Agent App Dynamic Instrument •  Live Edit •  Line Level Instrumentation •  Any package, any framework, any code •  Custom logic •  Counters, Gauges and Timers •  HA rollback StrongLoop Confidential and Proprietary Information – © 2015
  • 71. Can Errors be stitched into a trace and recovered ? Enter StrongLoop / Zones
  • 73. Runtime Mgmt. & Scaling
  • 74. Build & Deploy StrongLoop Confidential and Proprietary Information – © 2014
  • 75. Cluster and runtime scaling Marquee – HA, Auto-scale, Hot Deploy StrongLoop Confidential and Proprietary Information – © 2014
  • 76. MESH – Micro-services Deploy on Scale StrongLoop Confidential and Proprietary Information – © 2014
  • 77. First there was Node Thank you! JUST WIN, BABY!