Shubhra Kar | Products & Education
twitter:@shubhrakar
Frameworks or a Design Pattern ?
About me
u J2EE and SOA architect
u Performance architect
u Node, mBaaS & APIs
These guys sent me !
Bert
Belder
Ben
Noordhuis
Node/io Core
Raymond
Feng
Ritchie
Martori
LoopBack & Express Core
Sam
Roberts
Miroslav
Bajtos
Ryan
Graham
Buzzwords
Websites
Smart
Mobiles
Online
Catalog
Social
Media
Kiosks
Computers
Physical
Store
Gaming
Consoles
No IO bottlenecksHighly Concurrent
Very Fast JIT compiled
Node.js is emerging as the answer
Reduce infrastructure by 5XScalable
Lightweight, JS back and front, HeadlessFull stack
Write and maintain 50% lesser codeSimple
Suited for mobile and IoTEvented & JSON
Biggest OSS community on the planetEcosystem
Evolution is inevitable !
Thick
Web
SaaS
Mobile IoT
Frameworks evolve as well !
•  Callback
•  Reactor
•  Observer
•  Express
•  HAPI
•  Restify
•  Total
•  Partial
•  Loopback
•  Parse
•  Meteor
•  Feedhenry*
•  Loopback
•  Sails
•  Meteor
•  Geddy
•  Loopback
•  NodeRED
•  Proprietary
KISS
MVC
MBaaS
ORM/
MEAN
Micro/
loT
Pattern 0: Natal patterns
Philosophy: KISS (Keep It Simple Stupid)
u small core
u small modules
u small surface area
Patterns
u reactor
u callback
u module
u observer
Pattern 1: Convention
HTTP Server Library REST HTTP Library
Simple MVC Structure
Pros and Cons
Express
DIY
HTTP Routing, Middleware, Templating
Simple Web Apps
Github Stars – 19K
Commercial Support - StrongLoop
CLI App Generator
Export API definition with strong-remoting
Connect/Express middleware extensions
Vast Ecosystem and low learning curve
StrongLoop DevOps tooling support
Manual CRUD endpoints
Manual recursive refactoring/testing
No Data source Support
No Client SDK
No ACL (Fine Authorization)
Restify
DIY
Simplicity, Rest Routing
Simple REST API
Github Stars – 3K
Commercial Support - Joyent
Yeoman Generator
SPDY Support
Dtrace Support
No export of API definition
No Data source Support
No Extensions of significance
Manual CRUD endpoints
Manual recursive refactoring/testing
Limited Ecosystem
No ACL (Fine Authorization)
Router
in
Express
StrongLoop	
  Confiden.al	
  and	
  Proprietary	
  Informa.on	
  –	
  ©	
  2015	
  
Router
in
Restify
StrongLoop	
  Confiden.al	
  and	
  Proprietary	
  Informa.on	
  –	
  ©	
  2015	
  
Pattern 2: Configuration
HTTP Server
Framework
Hapi
Opinionated
Modularity, Security, HTTP Server control
Complex Web Apps, APIs
Github Stars – 4K
Commercial Support - None
Yeoman Generator
No export of API definition
Hapi Plugins – Joi, bell, bassmaster, etc
Limited ecosystem as compared to Express;
but does support templates with plugins
Swagger support for API documentation
Very limited Data source support – Mongo,
Postgres, leveldb
No Client SDK
No ACL (Fine Authorization)
Router
in
hapi
StrongLoop	
  Confiden.al	
  and	
  Proprietary	
  Informa.on	
  –	
  ©	
  2015	
  
Pattern 3 : Full Stack JS à lends into pattern 4
{“..”} JSON is the new first class citizen
Pattern 4: ORM & Isomorphic JS
u Model Driven Development
u Any data source
u Isomorphic JS
u Omni-Channel
u Share Models (Client/Server)
u Loopback & Meteor
u Automatic REST API
generation, routing, etc
u Common Weakness : Higher
Learning Curve
Sails
Opinionated
Web MVC framework
WebApps, API
Rails familiarity, MVC
Github Stars – 10 K (older)
Commercial Support - None
Yeoman Generator
StrongLoop DevOps tooling support
No export of API definition
Limited data sources – MySQL, Mongo, Postgresql, memory/file
No Extensions of significance
Limited Ecosystem
No ACL (Fine Authorization)
No Client SDKs
Pros and Cons
Loopback
Opinionated
API framework
Complex Web Apps and APIs
Modularity, Scaffolding, Enterprise Connectivity
Github Stars – 4 K (newer)
Commercial Support - StrongLoop
CLI Code Generator, Visual API composer, API explorer
Export API definition
Extensions like Push, File Storage, Passport, Oauth 2.0, Express Middleware
Vast Connector ecosystem and extend express
Auto CRUD
Swagger UI and Code Generator
DataSources like Mongo, mySQL, Oracle, SOAP, REST, SQLServer, Memory/File,
Postgresql, Email, ATG, Couchbase, Apache Kafka, and many more
Client SDK – Angular, Browser, IOS, Android, Node.js
Mature ACL (Fine Authorization), API Gateway
Pros and Cons
Developer SDKs
ORM & Isomorphic JS – Loopback.io
JS
client
JS
Server
Remoting
JS
client Replication
Pub Sub
Router &
Swagger
in Loopback
StrongLoop	
  Confiden.al	
  and	
  Proprietary	
  Informa.on	
  –	
  ©	
  2015	
  
Router	
  using	
  Sails	
  
Sub-pattern : Schema Discovery
mobile/web
clients
social &
analytics
JSON API
API
XML
SQL
SOAP
Etc.
mBaaS
Mobile API tier
Enterprise	
  
Pattern 5: mBaaS
mBaaS could be on cloud or premises
u Closed Source / Commercial
u Open Source
Key API
u Push Notification
u Geo Location
u Offline Sync
u Storage
u User Management
u Metering, Analytics
u Native SDK
u Isomorphic JS
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
Open Source ORM, mBaaS and API framework
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
GeoLocation in Loopback
Push Notification in Loopback
Wait …what is this API Gateway
Thing then ?
Synchronous API “Re-Composition” is an anti-pattern
Security & Social Logins
Why not an node.js API Gateway pattern ? Pattern 6
API Clients API Gateway API Server
API
Internet of Everything
The devices are taking over !!!
Microsecond latencies are the norm
API “Decomposition” is the game changer
{JSON}
{JSON}
{JSON}<SOAP/XML>
<TABLE>
Web SaaS Mobile loT
HTML JSON
App Server API Server
Is micro services a pattern too ?
Not just infrastructure virtualization !
Pattern 7: Micro-services (Design Time)
Client SDK
REST
Endpoints
Store Cache
API Micro
Services
One URL Space
SL API PaaS REST/JSON
API Gateway
Router
Remoting
Model
API Orchestrator
Cloud Services
Model
Model
Connector
Connector
Connectors
Pattern 8: Micro-services (Run Time)
Now I know !!!
A Shameless Plug…
First there was Node
Thank you!
JUST WIN,
BABY!

Node.js Frameworks & Design Patterns Webinar

  • 1.
    Shubhra Kar |Products & Education twitter:@shubhrakar Frameworks or a Design Pattern ?
  • 2.
    About me u J2EE andSOA architect u Performance architect u Node, mBaaS & APIs
  • 3.
    These guys sentme ! Bert Belder Ben Noordhuis Node/io Core Raymond Feng Ritchie Martori LoopBack & Express Core Sam Roberts Miroslav Bajtos Ryan Graham
  • 4.
  • 5.
    No IO bottlenecksHighlyConcurrent Very Fast JIT compiled Node.js is emerging as the answer Reduce infrastructure by 5XScalable Lightweight, JS back and front, HeadlessFull stack Write and maintain 50% lesser codeSimple Suited for mobile and IoTEvented & JSON Biggest OSS community on the planetEcosystem
  • 7.
    Evolution is inevitable! Thick Web SaaS Mobile IoT
  • 8.
    Frameworks evolve aswell ! •  Callback •  Reactor •  Observer •  Express •  HAPI •  Restify •  Total •  Partial •  Loopback •  Parse •  Meteor •  Feedhenry* •  Loopback •  Sails •  Meteor •  Geddy •  Loopback •  NodeRED •  Proprietary KISS MVC MBaaS ORM/ MEAN Micro/ loT
  • 9.
    Pattern 0: Natalpatterns Philosophy: KISS (Keep It Simple Stupid) u small core u small modules u small surface area Patterns u reactor u callback u module u observer
  • 10.
    Pattern 1: Convention HTTPServer Library REST HTTP Library Simple MVC Structure
  • 11.
    Pros and Cons Express DIY HTTPRouting, Middleware, Templating Simple Web Apps Github Stars – 19K Commercial Support - StrongLoop CLI App Generator Export API definition with strong-remoting Connect/Express middleware extensions Vast Ecosystem and low learning curve StrongLoop DevOps tooling support Manual CRUD endpoints Manual recursive refactoring/testing No Data source Support No Client SDK No ACL (Fine Authorization) Restify DIY Simplicity, Rest Routing Simple REST API Github Stars – 3K Commercial Support - Joyent Yeoman Generator SPDY Support Dtrace Support No export of API definition No Data source Support No Extensions of significance Manual CRUD endpoints Manual recursive refactoring/testing Limited Ecosystem No ACL (Fine Authorization)
  • 12.
    Router in Express StrongLoop  Confiden.al  and  Proprietary  Informa.on  –  ©  2015  
  • 13.
    Router in Restify StrongLoop  Confiden.al  and  Proprietary  Informa.on  –  ©  2015  
  • 14.
    Pattern 2: Configuration HTTPServer Framework Hapi Opinionated Modularity, Security, HTTP Server control Complex Web Apps, APIs Github Stars – 4K Commercial Support - None Yeoman Generator No export of API definition Hapi Plugins – Joi, bell, bassmaster, etc Limited ecosystem as compared to Express; but does support templates with plugins Swagger support for API documentation Very limited Data source support – Mongo, Postgres, leveldb No Client SDK No ACL (Fine Authorization)
  • 15.
    Router in hapi StrongLoop  Confiden.al  and  Proprietary  Informa.on  –  ©  2015  
  • 16.
    Pattern 3 :Full Stack JS à lends into pattern 4 {“..”} JSON is the new first class citizen
  • 17.
    Pattern 4: ORM& Isomorphic JS u Model Driven Development u Any data source u Isomorphic JS u Omni-Channel u Share Models (Client/Server) u Loopback & Meteor u Automatic REST API generation, routing, etc u Common Weakness : Higher Learning Curve
  • 18.
    Sails Opinionated Web MVC framework WebApps,API Rails familiarity, MVC Github Stars – 10 K (older) Commercial Support - None Yeoman Generator StrongLoop DevOps tooling support No export of API definition Limited data sources – MySQL, Mongo, Postgresql, memory/file No Extensions of significance Limited Ecosystem No ACL (Fine Authorization) No Client SDKs Pros and Cons
  • 19.
    Loopback Opinionated API framework Complex WebApps and APIs Modularity, Scaffolding, Enterprise Connectivity Github Stars – 4 K (newer) Commercial Support - StrongLoop CLI Code Generator, Visual API composer, API explorer Export API definition Extensions like Push, File Storage, Passport, Oauth 2.0, Express Middleware Vast Connector ecosystem and extend express Auto CRUD Swagger UI and Code Generator DataSources like Mongo, mySQL, Oracle, SOAP, REST, SQLServer, Memory/File, Postgresql, Email, ATG, Couchbase, Apache Kafka, and many more Client SDK – Angular, Browser, IOS, Android, Node.js Mature ACL (Fine Authorization), API Gateway Pros and Cons
  • 20.
    Developer SDKs ORM &Isomorphic JS – Loopback.io JS client JS Server Remoting JS client Replication Pub Sub
  • 21.
    Router & Swagger in Loopback StrongLoop  Confiden.al  and  Proprietary  Informa.on  –  ©  2015  
  • 22.
  • 23.
  • 24.
  • 25.
    mBaaS could beon cloud or premises u Closed Source / Commercial u Open Source Key API u Push Notification u Geo Location u Offline Sync u Storage u User Management u Metering, Analytics u Native SDK u Isomorphic JS
  • 26.
    REST API PUSH GEO OFF SYNC DEVICE USER FILE Relational DatabaseClustered 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 Open Source ORM, mBaaS and API framework 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
  • 27.
  • 28.
  • 29.
    Wait …what isthis API Gateway Thing then ?
  • 30.
  • 31.
    Security & SocialLogins Why not an node.js API Gateway pattern ? Pattern 6 API Clients API Gateway API Server API
  • 32.
    Internet of Everything Thedevices are taking over !!! Microsecond latencies are the norm
  • 33.
    API “Decomposition” isthe game changer {JSON} {JSON} {JSON}<SOAP/XML> <TABLE> Web SaaS Mobile loT HTML JSON App Server API Server
  • 34.
    Is micro servicesa pattern too ? Not just infrastructure virtualization !
  • 35.
    Pattern 7: Micro-services(Design Time) Client SDK REST Endpoints Store Cache API Micro Services One URL Space SL API PaaS REST/JSON API Gateway Router Remoting Model API Orchestrator Cloud Services Model Model Connector Connector Connectors
  • 36.
  • 37.
  • 38.
  • 40.
    First there wasNode Thank you! JUST WIN, BABY!