Emerging Web App Architectures
Using Java and Node.js
2
1
STSM, IBM Runtime Development
@Chris__Bailey
@seabaylea
3
2005Numbers
The Aviator
Condoleezza
Rice
Ellen
MacArthur
Million Dollar
Baby
Lance
Armstrong
4
3-Tier Web Applications
5
3-Tier Web Applications
HTTP
6
3-Tier Web Applications
HTTP
LoadBalancer
7
3-Tier Web Applications
HTTP
LoadBalancer
8
Operations and Management
Admin Analytics
LoadBalancer
HTTP
3-Tier Web Applications
9
Java and JEE based Web Applications
10
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....
11
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
12
+
Node.js and Java
13
14
API Package Support
 Node.js:
 300K+ packages
 430 packages/day
 Java growth:
 150K packages
 100 packages/day
15
 Average 45% less code required for Node.js implementation
Code required to implement benchmarks
16
 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
17
 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
18
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
19
20
Algorithmic Performance
21
Algorithmic Performance
22
Web App Performance
More
Computation
More
I/O
23
Web App Performance
More
Computation
More
I/O
24
Web App Performance
More
Computation
More
I/O
25
Web App Performance
More
Computation
More
I/O
26
Language
Selection
27
“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
28
Choosing the Right Language for the Service
29
Choosing the Right Language for the Service
30
Node.js
0
- 4x
+ 1/3x
Node.jsPerformanceRelativetoJava
CPU Bound I/O Bound
* based on TechEmpower benchmark results
Application Performance
(higher is better)
Choosing the Right Language for the Service
31
Node.js
0
- 4x
+ 1/3x
Node.jsPerformanceRelativetoJava
CPU Bound I/O Bound
* based on TechEmpower benchmark results
Application Performance
(higher is better)
Choosing the Right Language for the Service
Error: incompatible types
ClassCastException
32
 Higher performance for I/O
 Easier async programming
 Fullstack/isomorphic development
Choosing the Right Language for the Service
33
Choosing the Right Language for the Service
 Higher processing performance
 Type safety for calculations
 Transaction processing frameworks
34
 Highly performant, scalable rich web applications
 Highly performant, reliable transaction processing
 Self-contained micro-service components
Choosing the Right Language for the Service
+
35
Emerging
Architectures
36
3-Tier Web Applications
37
Operations and Management
Admin Analytics
LoadBalancer
HTTP
3-Tier Web Applications
38
Operations and Management
Admin Analytics
LoadBalancer
HTTP
Rich Web Applications
39
Operations and Management
Admin Analytics
LoadBalancer
HTTP
Rich Web Applications
40
Operations and Management
Admin Analytics
LoadBalancer
HTTP
Rich Web Applications
LoadBalancer
41
Forrester 4-Tier Applications
42
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
LoadBalancer
43
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
LoadBalancer
44
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
LoadBalancer
45
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
LoadBalancer
46
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
47
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
48
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
Services
49
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
Services
50
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
Services
51
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
Services
52
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
Services
Client
53
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
Services
Client
Delivery
54
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
Client
Delivery
Aggregation
Services
55
 Highly performant, scalable rich web applications
 Highly performant, reliable transaction processing
 Self-contained micro-service components
Node.js and Java
+

Node Summit 2016: Web App Architectures

Editor's Notes

  • #4 Leonardo DiCaprio - The Aviator, Golden Globes, Million Dollar Baby - Oscar Numbers started on TV Ellen MacArthur sailed round the world Condoleeza Rice: First African-American Secretary of State Lance Armstrong TDF Huffington Post Started YouTube Started
  • #13 But this is a presentation about: Node.js and java
  • #16 Data holds true for bigger apps like Acme-Air fashion retailer measureable increase in sales for items on landing page within 1hr or being in media of it appearing in public. Each product placement is different: - need a fast, agile, approach that does not jeopardize their on-line stores availability and quality.
  • #20 Ok, so why still use Java?
  • #22 Computation blocks the event loop, which you don’t want to do for Node.js
  • #26 And Transaction Processing Open XA, 2 phase commit based distributed transactions Java Transactions API, with or without (EJBs) from Java EE