44
APIs in minutes with Node.js Shubhra Kar Product Manager Oct 2014

StrongLoop Overview

Embed Size (px)

Citation preview

Page 1: StrongLoop Overview

APIs in minutes with Node.js

Shubhra Kar Product Manager

Oct 2014

Page 2: StrongLoop Overview

Some StrongLoop personalities

Ben Noordhuis

Al Tsang Jimmy GuerreroBert Belder

Ryan GrahamKrishna Raman

Ritchie Martori

Sam RobertsMiroslav Bajtos

Raymond Feng

John HigginsIssac Roth

Page 3: StrongLoop Overview

3

Jason Pressman Kiran Prasad

Neil Day

Nick Sturiale

Paul Ambrose

Marten Mickos

Fortune 10 retailer

Page 4: StrongLoop Overview

The Frontend is changing (Mobile First !)

Page 5: StrongLoop Overview

5

API Economy

Transaction Volume

API Endpoints

Mashups

SaaS

Mobile

IoT

1 Billion 5 Billion 50 Billion

Page 6: StrongLoop Overview

6

Why APIs

SaaS Mobile IoT

SOA

Web

App Server

Database Datacube

API Server

HTML JSON

Page 7: StrongLoop Overview

What’s needed ? Legacy services need to fit too !

API centric EnterpriseThousands to Millions of devices connecting to business APIs

creating the new user experience

APIs for each device, each app, each screen. Optimized for bandwidth & battery, adjusting to each device’s capabilities

Page 8: StrongLoop Overview

8

Why Node?

Node is FAST

Node is perfect for APIs

Node is JavaScript

…and highly concurrent!

Page 9: StrongLoop Overview

What is Node.js?

• Asynchronous, event-driven, non-blocking I/O platform that is perfect for real-time, data-intensive applications.

• Single thread of execution• Built on Chrome’s JavaScript runtime engine, V8• Uses Libuv, a high performance evented I/O library that works on

Linux and Windows (faster than Libev)

while there are still events to process:e = get the next eventif there is a callback associated

with e: call the callback

Page 10: StrongLoop Overview

Threads Don’t Wait !

Page 11: StrongLoop Overview

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

KernelYes, it’s C back there

Page 12: StrongLoop Overview

Why Node.js?

• Lots of JavaScript programmers out there (>62K)• Very large and active developer community• Has the most modules (90K > Java)

Page 13: StrongLoop Overview

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

Why Node.js?

Page 14: StrongLoop Overview

Nodies are not just silicon valley hipsters !

And most recently….Fortune 10Retailer

Page 15: StrongLoop Overview

Why do 2 million developers Download Node.js every month?

Page 16: StrongLoop Overview

16

Node vs Java for REST routing

Page 17: StrongLoop Overview

17

Node..

Roadmap past v0.12

Upgrade v8 and debugger interfaceFlow Control– Promises, Generators, Zones, etc

Error Reporting– Zones– Async-Tracker

Enterprise Ops Integration– Logs, Monitoring, Build, Deploy, CI

EcosystemReference deploymentsConcurrency

Breaking C++ API Changes

Page 18: StrongLoop Overview

18

Async-tracker

Page 19: StrongLoop Overview

19

Async-tracker: get involved

Page 20: StrongLoop Overview

20

Ops integration

Page 21: StrongLoop Overview

21

Error tracking/recovery

var http = require('http');var cache = {};

function curl(url, cb) {

if (cache[url]) return cb(null, cache[url]);

var data = '';

http.get(url, function(res) { res.setEncoding('utf8');

res.on('data', function(s) { data += s; });

res.on('end', function() { cache[url] = data; cb(null, data); });

res.on('error', function(err) { cb(err); }); });}

// Usage:curl('http://www.google.com', console.log);

Page 22: StrongLoop Overview

22

Error tracking/recovery

var http = require('http');var cache = {};

function curl(url, cb) { if (cache[url]) // WRONG: Synchronous callback return cb(null, cache[url]);

var data = '';

http.get(url, function(res) { res.setEncoding('utf8');

res.on('data', function(s) { data += s; });

res.on('end', function() { cache[url] = data; cb(null, data); });

// WRONG: are you sure that 'end' and 'error' are mutually exclusive? res.on('error', function(err) { cb(err); }); });

// WRONG: the request object may emit 'error'}

Page 23: StrongLoop Overview

23

Error tracking/recovery

Page 24: StrongLoop Overview

24

Error tracking/recovery

Page 25: StrongLoop Overview

25

Error tracking/recovery

Page 26: StrongLoop Overview

26

Zones for Error cleanup

strongloop.com/zone

Page 27: StrongLoop Overview

27

What’s coming in Express

https://github.com/strongloop/expressjs.com/issues

Docs in markdown!

Page 28: StrongLoop Overview
Page 29: StrongLoop Overview

Strongloop and Node.js

29

Page 30: StrongLoop Overview

RESTAPI

PUSH

GEOOFF

SYNC

DEVICE

USER FILE

Storage

In-Memory

REST

APIGATEWAY

Channel SDKs

CONNECTORM

API ENGINE

DATAMODEL

API

SDKs

Loopback: Open Source API Framework in Node.js

REST API

APIExplorer

DevOps

ON-PREMISES / PRIVATE CLOUD / PUBLIC CLOUD

Page 31: StrongLoop Overview

Upcoming API Gateway

Page 32: StrongLoop Overview

API Orchestrator

Router

Client SDK

Isomorphic

One URL Space

Push

API Micro Services

Store Cache

SL API PaaS

Log Console

Perf.Console

Analytics

Console

CloudService

s

REST/JSON

API Gateway (Throttling, Proxy, OAuth)

ESB

RDBMS NoSQL SOAPStandalone ERP

ConnectorsEnterprise Services

Model------------------------------

Model------------------------------

Model------------------------------

REMOTING

CONNEC TOR

CONNEC TOR

RESTEndpoints

Micro-services Architecture

Store Cache

Page 33: StrongLoop Overview

Service Container

Upcoming Distributed Provisioning and Routing

Nginx (LB / SSL)

Sto

re (S

tate

)

Master

Service Container

Worker

Worker

Controller

Agent

Service Container

Service Container

Nginx (LB / SSL)

Sto

re (S

tate

)

Master

Service Container

Worker

Worker

Controller

Agent

Service Container

Store (Groups, Routes and State) and Scheduler

Server

Provision and Deploy App

REST/JSON

API Gateway (Routing, Throttling, Proxy, OAuth)

ServiceMgr

(Exec.)Service

Mgr.

Page 34: StrongLoop Overview

Marquee Features

Mobile SDKs Pre-Built Services ORM – no SQL

Enterprise ConnectorsAuto API Engine API Gateway

Page 35: StrongLoop Overview

Some cool features in Open Source

Offline Sync & Replication

Model Auto-Discovery and Relationship

Connector

Page 36: StrongLoop Overview

Automatic modeling and REST API generated

Page 37: StrongLoop Overview

37

What’s coming in LoopBack

GUIAPI Rate limitingOAuth 2.0 Swagger 2.0

Page 38: StrongLoop Overview

& helps realize a full-stack JavaScript solution

Develop

Create Scaffolding

Define base CSS

Define components

Use JS widgets

Create Scaffolding

Define Models

Define Controllers

Define Views

Define Filters

User

Device

File

GeoLocation

Notification

Define Directives

Configure Routes

Model the Data

Generate REST API

Connect to Data-sources (Oracle, SOAP, Mongo)

Setup Services

Configure API Security

Mobile App Mgmt.

Create UI & styling Arch. & binding Access Native Integrate Existing Data and Services

BLE

Page 39: StrongLoop Overview

Node.js Platform Support

39

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 ServerConnector

MongoDBConnector

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

Page 40: StrongLoop Overview

DevOps Tools – Debugging

Page 41: StrongLoop Overview

DevOps Tools – Runtime Mgmt. & Dynamic Scaling

Page 42: StrongLoop Overview

DevOps Tools - Profilers

Page 43: StrongLoop Overview

DevOps Tools - Performance Monitoring

Page 44: StrongLoop Overview

StrongLoop’s commercial business

SupportSecurity subscriptionTrainingConsultingAPI Gatewaystrong-agent – MonitoringConnectors to enterprise systemsAPI Microservices Mesh Controller