design patterns talk_node_summit
TRANSCRIPT
Shubhra Kar | Products & Education twitter:@shubhrakar mail:[email protected]
Frameworks or a Design Pattern ?
About me
StrongLoop Confidential and Proprietary Information – © 2015
u J2EE and SOA architect – Infosys u Performance architect – Wily à CA u Node, mBaaS and API stacks - StrongLoop
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 new curve: Innovate or Die
10
25
50
100 100
50
10 1 5
40
100
25
Web SaaS Mobile IoT
The new curve Concurrent Users Latency Adoption
StrongLoop Confidential and Proprietary Information – © 2015
Pattern 0: Natal patterns
StrongLoop Confidential and Proprietary Information – © 2015
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
StrongLoop Confidential and Proprietary Information – © 2015
u Pseudo-Opinionated, Express and Restify are DIY u Middleware u Strengths
u Express: Web templating, ecosystem u Restify: REST API
u Low learning curve u Restify: Dtrace and SPDY Support u Weakness
u Manual CRUD u Manual recursive Testing/Refactoring
Pattern 2: Configuration
u Opinionated u Configuration over Convention u Granular HTTP/Webserver control u Good plug-in ecosystem u Supported and well documented u Weakness
u Manual CRUD/Refactor/Testing
u No plug & play with Express ecosystem
StrongLoop Confidential and Proprietary Information – © 2015
Web Middleware
Pattern 3 : Full Stack JS
StrongLoop Confidential and Proprietary Information – © 2015
{“..”} 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 Weakness
u Higher learning curve
StrongLoop Confidential and Proprietary Information – © 2015
ORM & Isomorphic JS – Loopback.io
JS client
JS Server
Remoting
JS client
StrongLoop Confidential and Proprietary Information – © 2015
Developer SDKs
API Economy driven by Mobile / IoT
Mobile and IoT explosion u Sheer number of clients has increased
u Clients are increasingly sophis.cated
u Node.js is the plaHorm of choice for these API
StrongLoop Confiden.al and Proprietary Informa.on – © 2015
StrongLoop Confidential and Proprietary Information – © 2015
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
StrongLoop Confidential and Proprietary Information – © 2015
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
Is micro services a pattern too ?
StrongLoop Confiden.al and Proprietary Informa.on – © 2015
Not just infrastructure virtualization !
API “Re-Composition” is good…
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 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
Auth Routing Rate-Limit Proxy Mediation Orchestration Analytics
StrongLoop Confidential and Proprietary Information – © 2015
Why not an API Gateway pattern ? Pattern 6
Security & Social Logins
Marquee – Auth, Routing, Throttling, Proxy, Mediation, Aggregation, Virtualization
StrongLoop Confidential and Proprietary Information – © 2015
The need is “DE-COMPOSITION”
SaaS Mobile IoT Web
App Server API Server
HTML JSON
{JSON} {JSON}
{JSON}
<SOAP/XML>
<TABLE>
StrongLoop Confidential and Proprietary Information – © 2015
Pattern 7: Micro-services (Design Time)
StrongLoop Confidential and Proprietary Information – © 2015