picking the right node.js framework for your use case
TRANSCRIPT
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 bottlenecks Highly Concurrent
Very Fast JIT compiled
Node.js is emerging as the answer
Reduce infrastructure by 5X Scalable
Lightweight, JS back and front, Headless Full stack
Write and maintain 50% lesser code Simple
Suited for mobile and IoT Evented & JSON
Biggest OSS community on the planet Ecosystem
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
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)
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)
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 ore 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
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 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
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
CONNECTORs
API
SDKs
Open Source ORM, mBaaS and API framework
REST API
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
API Explorer
Security & Social Logins
Why not an node.js API Gateway pattern ? Pattern 6
API Clients API Gateway API Server
API
API “Decomposition” is the game changer
{JSON} {JSON}
{JSON}
<SOAP/XML>
<TABLE>
Web SaaS Mobile loT
HTML JSON
App Server API Server
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