Node Summit 2016: Web App Architectures

55
Emerging Web App Architectures Using Java and Node.js

Transcript of Node Summit 2016: Web App Architectures

Page 1: Node Summit 2016:  Web App Architectures

Emerging Web App ArchitecturesUsing Java and Node.js

Page 2: Node Summit 2016:  Web App Architectures

1

STSM, IBM Runtime Development

@Chris__Bailey

@seabaylea

Page 3: Node Summit 2016:  Web App Architectures

2005NumbersThe Aviator

CondoleezzaRice

Ellen MacArthur

Million DollarBaby

LanceArmstrong

Page 4: Node Summit 2016:  Web App Architectures

3-Tier Web Applications

Page 5: Node Summit 2016:  Web App Architectures

3-Tier Web Applications

HTTP

Page 6: Node Summit 2016:  Web App Architectures

3-Tier Web Applications

HTTP

Load

Bal

ance

r

Page 7: Node Summit 2016:  Web App Architectures

3-Tier Web Applications

HTTP

Load

Bal

ance

r

Page 8: Node Summit 2016:  Web App Architectures

Operations and Management

Admin Analytics

Load

Bal

ance

r

HTTP

3-Tier Web Applications

Page 9: Node Summit 2016:  Web App Architectures

Java and JEE based Web Applications

Page 10: Node Summit 2016:  Web App Architectures

From Web Sites to Web Apps

Page 11: Node Summit 2016:  Web App Architectures

JavaScript is ubiquitous in the browser- Supported in every browser- Integration with HTML and CSS

JavaScript is not affected by negative publicity....

Unless it is absolutely necessary to run Java in web browsers, disable it as described below, even after updating to 7u11. This will help mitigate other Java vulnerabilities that may be discovered in the future.

This and previous Java vulnerabilities have been widely targeted by attackers, and new Java vulnerabilities are likely to be discovered. To defend against this and future Java vulnerabilities, consider disabling Java in web browsers…

Programming in the Browser

Page 12: Node Summit 2016:  Web App Architectures

+

Node.js and Java

Page 13: Node Summit 2016:  Web App Architectures
Page 14: Node Summit 2016:  Web App Architectures

API Package Support

Node.js: 300K+ packages 430 packages/day

Java growth: 150K packages 100 packages/day

Page 15: Node Summit 2016:  Web App Architectures

Average 45% less code required for Node.js implementation

Code required to implement benchmarks

Page 16: Node Summit 2016:  Web App Architectures

One thread (or process) per connection- Each thread waits on a response- Scalability determined by the number of

threads

Each thread:- consumes memory- is relatively idle

Concurrency determined by number of depot workers

Typical Java Approach to Scalable I/O

Page 17: Node Summit 2016:  Web App Architectures

One thread multiplexes for multiple requests- No waiting for a response- Handles return from I/O when notified

Scalability determined by:- CPU usage- “Back end” responsiveness

Concurrency determined by how fast the food server can work

Node.js approach to Scalable I/O

Page 18: Node Summit 2016:  Web App Architectures

Isomorphic Development and Server Side Rendering

Pre-Initialisation of the client UI on the server: Improves time for the first

elements appearing in the UI

Has additional benefits: Search Engine Indexing Easier code maintenance

Page 19: Node Summit 2016:  Web App Architectures
Page 20: Node Summit 2016:  Web App Architectures

Algorithmic Performance

Page 21: Node Summit 2016:  Web App Architectures

Algorithmic Performance

Page 22: Node Summit 2016:  Web App Architectures

Web App Performance

MoreComputation

MoreI/O

Page 23: Node Summit 2016:  Web App Architectures

Web App Performance

MoreComputation

MoreI/O

Page 24: Node Summit 2016:  Web App Architectures

Web App Performance

MoreComputation

MoreI/O

Page 25: Node Summit 2016:  Web App Architectures

Web App Performance

MoreComputation

MoreI/O

Page 26: Node Summit 2016:  Web App Architectures

LanguageSelection

Page 27: Node Summit 2016:  Web App Architectures

“Do one thing, and do it well”

Services are small and targeted to their task Services are organized around capabilities Services are self contained, storing their own data

Microservices Paradigm

Page 28: Node Summit 2016:  Web App Architectures

Choosing the Right Language for the Service

Page 29: Node Summit 2016:  Web App Architectures

Choosing the Right Language for the Service

Page 30: Node Summit 2016:  Web App Architectures

Node.js

0

- 4x

+ 1/3x

Nod

e.js

Per

form

ance

Rel

ativ

e to

Jav

a

CPU Bound I/O Bound

* based on TechEmpower benchmark results

Application Performance(higher is better)

Choosing the Right Language for the Service

Page 31: Node Summit 2016:  Web App Architectures

Node.js

0

- 4x

+ 1/3x

Nod

e.js

Per

form

ance

Rel

ativ

e to

Jav

a

CPU Bound I/O Bound

* based on TechEmpower benchmark results

Application Performance(higher is better)

Choosing the Right Language for the Service

Error: incompatible typesClassCastException

Page 32: Node Summit 2016:  Web App Architectures

Higher performance for I/O Easier async programming Fullstack/isomorphic development

Choosing the Right Language for the Service

Page 33: Node Summit 2016:  Web App Architectures

Choosing the Right Language for the Service

Higher processing performance Type safety for calculations Transaction processing frameworks

Page 34: Node Summit 2016:  Web App Architectures

Highly performant, scalable rich web applications Highly performant, reliable transaction processing Self-contained micro-service components

Choosing the Right Language for the Service

+

Page 35: Node Summit 2016:  Web App Architectures

EmergingArchitectures

Page 36: Node Summit 2016:  Web App Architectures

3-Tier Web Applications

Page 37: Node Summit 2016:  Web App Architectures

Operations and Management

Admin Analytics

Load

Bal

ance

r

HTTP

3-Tier Web Applications

Page 38: Node Summit 2016:  Web App Architectures

Operations and Management

Admin Analytics

Load

Bal

ance

r

HTTP

Rich Web Applications

Page 39: Node Summit 2016:  Web App Architectures

Operations and Management

Admin Analytics

Load

Bal

ance

r

HTTP

Rich Web Applications

Page 40: Node Summit 2016:  Web App Architectures

Operations and Management

Admin Analytics

Load

Bal

ance

r

HTTP

Rich Web Applications

Load

Bal

ance

r

Page 41: Node Summit 2016:  Web App Architectures

Forrester 4-Tier Applications

Page 42: Node Summit 2016:  Web App Architectures

Operations and Management

Admin Analytics

Load

Bal

ance

r

HTTP

MicroServices and API Economy

Load

Bal

ance

r

Page 43: Node Summit 2016:  Web App Architectures

Operations and Management

Admin Analytics

Load

Bal

ance

r

HTTP

MicroServices and API Economy

Load

Bal

ance

r

Page 44: Node Summit 2016:  Web App Architectures

Operations and Management

Admin Analytics

Load

Bal

ance

r

HTTP

MicroServices and API Economy

Load

Bal

ance

r

Page 45: Node Summit 2016:  Web App Architectures

Operations and Management

Admin Analytics

Load

Bal

ance

r

HTTP

MicroServices and API Economy

Load

Bal

ance

r

Page 46: Node Summit 2016:  Web App Architectures

Operations and Management

Admin Analytics

Load

Bal

ance

r

HTTP

MicroServices and API Economy

Page 47: Node Summit 2016:  Web App Architectures

Operations and Management

Admin Analytics

Load

Bal

ance

r

HTTP

MicroServices and API Economy

Page 48: Node Summit 2016:  Web App Architectures

Operations and Management

Admin Analytics

Load

Bal

ance

r

HTTP

MicroServices and API Economy

Services

Page 49: Node Summit 2016:  Web App Architectures

Operations and Management

Admin Analytics

Load

Bal

ance

r

HTTP

MicroServices and API Economy

Services

Page 50: Node Summit 2016:  Web App Architectures

Operations and Management

Admin Analytics

Load

Bal

ance

r

HTTP

MicroServices and API Economy

Services

Page 51: Node Summit 2016:  Web App Architectures

Operations and Management

Admin Analytics

Load

Bal

ance

r

HTTP

MicroServices and API Economy

Services

Page 52: Node Summit 2016:  Web App Architectures

Operations and Management

Admin Analytics

Load

Bal

ance

r

HTTP

MicroServices and API Economy

Services

Client

Page 53: Node Summit 2016:  Web App Architectures

Operations and Management

Admin Analytics

Load

Bal

ance

r

HTTP

MicroServices and API Economy

Services

Client

Delivery

Page 54: Node Summit 2016:  Web App Architectures

Operations and Management

Admin Analytics

Load

Bal

ance

r

HTTP

MicroServices and API Economy

Client

Delivery

Aggregation

Services

Page 55: Node Summit 2016:  Web App Architectures

Highly performant, scalable rich web applications Highly performant, reliable transaction processing Self-contained micro-service components

Node.js and Java

+