node summit 2016: web app architectures
TRANSCRIPT
Emerging Web App ArchitecturesUsing Java and Node.js
1
STSM, IBM Runtime Development
@Chris__Bailey
@seabaylea
2005NumbersThe Aviator
CondoleezzaRice
Ellen MacArthur
Million DollarBaby
LanceArmstrong
3-Tier Web Applications
3-Tier Web Applications
HTTP
3-Tier Web Applications
HTTP
Load
Bal
ance
r
3-Tier Web Applications
HTTP
Load
Bal
ance
r
Operations and Management
Admin Analytics
Load
Bal
ance
r
HTTP
3-Tier Web Applications
Java and JEE based Web Applications
From Web Sites to Web Apps
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
+
Node.js and Java
API Package Support
Node.js: 300K+ packages 430 packages/day
Java growth: 150K packages 100 packages/day
Average 45% less code required for Node.js implementation
Code required to implement benchmarks
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
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
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
Algorithmic Performance
Algorithmic Performance
Web App Performance
MoreComputation
MoreI/O
Web App Performance
MoreComputation
MoreI/O
Web App Performance
MoreComputation
MoreI/O
Web App Performance
MoreComputation
MoreI/O
LanguageSelection
“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
Choosing the Right Language for the Service
Choosing the Right Language for the Service
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
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
Higher performance for I/O Easier async programming Fullstack/isomorphic development
Choosing the Right Language for the Service
Choosing the Right Language for the Service
Higher processing performance Type safety for calculations Transaction processing frameworks
Highly performant, scalable rich web applications Highly performant, reliable transaction processing Self-contained micro-service components
Choosing the Right Language for the Service
+
EmergingArchitectures
3-Tier Web Applications
Operations and Management
Admin Analytics
Load
Bal
ance
r
HTTP
3-Tier Web Applications
Operations and Management
Admin Analytics
Load
Bal
ance
r
HTTP
Rich Web Applications
Operations and Management
Admin Analytics
Load
Bal
ance
r
HTTP
Rich Web Applications
Operations and Management
Admin Analytics
Load
Bal
ance
r
HTTP
Rich Web Applications
Load
Bal
ance
r
Forrester 4-Tier Applications
Operations and Management
Admin Analytics
Load
Bal
ance
r
HTTP
MicroServices and API Economy
Load
Bal
ance
r
Operations and Management
Admin Analytics
Load
Bal
ance
r
HTTP
MicroServices and API Economy
Load
Bal
ance
r
Operations and Management
Admin Analytics
Load
Bal
ance
r
HTTP
MicroServices and API Economy
Load
Bal
ance
r
Operations and Management
Admin Analytics
Load
Bal
ance
r
HTTP
MicroServices and API Economy
Load
Bal
ance
r
Operations and Management
Admin Analytics
Load
Bal
ance
r
HTTP
MicroServices and API Economy
Operations and Management
Admin Analytics
Load
Bal
ance
r
HTTP
MicroServices and API Economy
Operations and Management
Admin Analytics
Load
Bal
ance
r
HTTP
MicroServices and API Economy
Services
Operations and Management
Admin Analytics
Load
Bal
ance
r
HTTP
MicroServices and API Economy
Services
Operations and Management
Admin Analytics
Load
Bal
ance
r
HTTP
MicroServices and API Economy
Services
Operations and Management
Admin Analytics
Load
Bal
ance
r
HTTP
MicroServices and API Economy
Services
Operations and Management
Admin Analytics
Load
Bal
ance
r
HTTP
MicroServices and API Economy
Services
Client
Operations and Management
Admin Analytics
Load
Bal
ance
r
HTTP
MicroServices and API Economy
Services
Client
Delivery
Operations and Management
Admin Analytics
Load
Bal
ance
r
HTTP
MicroServices and API Economy
Client
Delivery
Aggregation
Services
Highly performant, scalable rich web applications Highly performant, reliable transaction processing Self-contained micro-service components
Node.js and Java
+