SlideShare a Scribd company logo
Emerging Web App Architectures
Using Java and Node.js
IMPORTANT info regarding IBM speaker guidelines and disclaimers
• If your presentation has forward looking content, it is mandatory that you put the forward disclaimer as
slide 2 in your presentation (this is the “Please Note” slide, third slide down in this template).
• All presentations, whether they have future content or not, must include the mandatory “Notices and
Disclaimers” – slides 8 and 9 in the template. Insert these slides just before the “Thank You” slide in
your deck.
• Please refer to the FAQ document in the Speaker Kit regarding additional legal guidance for use of
photos, logos, customer references and analyst information.
• It is recommended to have your material reviewed by Legal if you have any concerns regarding your
content.
• Please submit your final presentation, using the instructions in the online Speaker Kit, by February
5th, 2016. Post your final file in native format using the following naming convention: session code.ppt
(For example, 1576.ppt)
• Disclosures regarding forward guidance is embedded in the tool and also available through this link:
• https://w3-03.ibm.com/finance/finsubp.nsf/WebPages/N01FF08SoftwareRevenueRecognitionGuidelinesRelatedtoProductDisclosures
• Please remove these instructions before finalizing your presentation.
2
Please Note:
3
• IBM’s statements regarding its plans, directions, and intent are subject to change or withdrawal without notice at IBM’s sole discretion.
• Information regarding potential future products is intended to outline our general product direction and it should not be relied on in
making a purchasing decision.
• The information mentioned regarding potential future products is not a commitment, promise, or legal obligation to deliver any
material, code or functionality. Information about potential future products may not be incorporated into any contract.
• The development, release, and timing of any future features or functionality described for our products remains at our sole discretion.
• Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual
throughput or performance that any user will experience will vary depending upon many factors, including considerations such as the
amount of multiprogramming in the user’s job stream, the I/O configuration, the storage configuration, and the workload processed.
Therefore, no assurance can be given that an individual user will achieve results similar to those stated here.
© 2015 IBM Corporation4
1
STSM, IBM Runtime Development
@Chris__Bailey
@seabaylea
5
+
Node.js and Java
6
Developer
Productivity
7
API Package Support
● Node.js growth:
● 371 packages/day
● Java growth:
● 92 packages/day
8
Open Source Projects
9
Open Source Projects
10
var cluster = require('cluster');
var cpus = require('os').cpus().length;
var http = require('http');
if (cluster.isMaster) {
for (var i = 0; i < cpus; i++) {
cluster.fork();
}
cluster.on('death', function(worker) {
console.log("Worker" + worker.pid + "died");
});
} else {
http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World!n");
response.end();
}).listen(8080);
}
Writing a HTTP Server
11
var cluster = require('cluster');
var cpus = require('os').cpus().length;
var http = require('http');
if (cluster.isMaster) {
for (var i = 0; i < cpus; i++) {
cluster.fork();
}
cluster.on('death', function(worker) {
console.log("Worker" + worker.pid + "died");
});
} else {
http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World!n");
response.end();
}).listen(8080);
}
And Clustering It….
12
● 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
13
● 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
14
Node.js event based programming
var http = require('http');
var server = http.createServer();
server.listen(8080);
server.on('request', function(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World!n");
response.end();
});
server.on('connection', function(socket) {});
server.on('close', function() {});
server.on('connect', function(socket) {});
server.on('upgrade', function(request, socket, head) {});
server.on('clientError', function(exception, socket) {});
15
0	
500	
1000	
1500	
2000	
2500	
3000	
regex-dna	
n-body	
binary-trees	spectral-norm
	fannkuch-redux	
reverse-com
plim
ent	
k-nucleo>de	
fasta	
Volume	of	Code	
Node.js	
Java	
● Average 45% less code required for Node.js implementation
Code required to implement benchmarks
16
“Fullstack”
Development
17
● The web has moved from Web Sites to 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....
18
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
19
FullStack JavaScript Development
● Reuse of programming skills and teams
● Reuse of skills for both client and server side code
● Reuse of “isomorphic” code components
● Reuse of code for both client and server
● Write One Run Anywhere
● Faster user experience performance
● Use of server side rendering
20
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
21
Variable
Types
22
Simple Calculation: 5 + 3
private static void add (int a, int b){
System.out.println(a + b);
}
public static void main(String[] args){
int a = 5;
int b = 3;
add(a, b);
}
> javac app.java
> java app
> 8
var add = function (a, b) {
console.log(a + b);
}
var a = 5;
var b = 3;
add(a, b);
> node app.js
> 8
23
Simple Calculation: 5 + 3
private static void add (int a, int b){
System.out.println(a + b);
}
public static void main(String[] args){
int a = 5;
int b = 3;
add(a, b);
}
> javac app.java
> java app
> 8
var add = function (a, b) {
console.log(a + b);
}
var a = 5;
var b = 3;
add(a, b);
> node app.js
> 8
24
Simple Calculation: 5 + 3
private static void add (int a, int b){
System.out.println(a + b);
}
public static void main(String[] args){
int a = 5;
int b = 3;
add(a, b);
}
> javac app.java
> java app
> 8
var add = function (a, b) {
console.log(a + b);
}
var a = 5;
var b = 3;
add(a, b);
> node app.js
> 8
25
Simple Calculation: 5 + 3
private static void add (int a, int b){
System.out.println(a + b);
}
public static void main(String[] args){
int a = 5;
int b = 3;
add(a, b);
}
> javac app.java
> java app
> 8
var add = function (a, b) {
console.log(a + b);
}
var a = 5;
var b = 3;
add(a, b);
> node app.js
> 8
26
Simple Calculation: 5 + 3
private static void add (int a, int b){
System.out.println(a + b);
}
public static void main(String[] args){
int a = 5;
int b = 3;
add(a, b);
}
> javac app.java
> java app
> 8
var add = function (a, b) {
console.log(a + b);
}
var a = 5;
var b = 3;
add(a, b);
> node app.js
> 8
27
Simple Calculation: 5 + 3
private static void add (int a, int b){
System.out.println(a + b);
}
public static void main(String[] args){
String a = new String(“5”);
int b = 3;
add(a, b);
}
> javac app.java
> java app
> 8
var add = function (a, b) {
console.log(a + b);
}
var a = ‘5’;
var b = 3;
add(a, b);
> node app.js
> 8
28
Simple Calculation: 5 + 3
private static void add (int a, int b){
System.out.println(a + b);
}
public static void main(String[] args){
String a = new String(“5”);
int b = 3;
add(a, b);
}
> javac app.java
> java app
> 8
var add = function (a, b) {
console.log(a + b);
}
var a = ‘5’;
var b = 3;
add(a, b);
> node app.js
> 8
29
Simple Calculation: 5 + 3
private static void add (int a, int b){
System.out.println(a + b);
}
public static void main(String[] args){
String a = new String(“5”);
int b = 3;
add(a, b);
}
> javac app.java
Error: incompatible types: String
cannot be converted to int
add(a, b);
^
var add = function (a, b) {
console.log(a + b);
}
var a = ‘5’;
var b = 3;
add(a, b);
> node app.js
> 8
30
Simple Calculation: 5 + 3
private static void add (int a, int b){
System.out.println(a + b);
}
public static void main(String[] args){
String a = new String(“5”);
int b = 3;
add(a, b);
}
> javac app.java
Error: incompatible types: String
cannot be converted to int
add(a, b);
^
var add = function (a, b) {
console.log(a + b);
}
var a = ‘5’;
var b = 3;
add(a, b);
> node app.js
> 53
31
JavaScript Calculations
> 5 + 3
8
> '5' + 3
'53'
> '5' – 3
2 // Weak typing, implicit conversion
> '5' – '4'
1 // String minus String = Integer??

> '5' + + '4'
54 // Multiple +'s are ok

> 'Hello' + 'World'
'HelloWorld' // Ok, that's expected

> 'Hello' + + 'World'
'HelloNaN' // ...but that isn't
32
JavaScript Calculations
> 5 + 3
8
> '5' + 3
'53'
> '5' – 3
2 // Weak typing, implicit conversion
> '5' – '4'
1 // String minus String = Integer??

> '5' + + '4'
54 // Multiple +'s are ok

> 'Hello' + 'World'
'HelloWorld' // Ok, that's expected

> 'Hello' + + 'World'
'HelloNaN' // ...but that isn't
33
JavaScript Calculations
> 5 + 3
8
> '5' + 3
'53'
> '5' – 3
2 // String is converted to a number for subtraction
> '5' – '4'
1 // String minus String = Integer??

> '5' + + '4'
54 // Multiple +'s are ok

> 'Hello' + 'World'
'HelloWorld' // Ok, that's expected

> 'Hello' + + 'World'
'HelloNaN' // ...but that isn't
34
JavaScript Calculations
> 5 + 3
8
> '5' + 3
'53'
> '5' – 3
2 // String is converted to a number for subtraction
> '5' – '4'
1 // String minus String = Integer??

> '5' + + '4'
54 // Multiple +'s are ok

> 'Hello' + 'World'
'HelloWorld' // Ok, that's expected

> 'Hello' + + 'World'
'HelloNaN' // ...but that isn't
35
JavaScript Calculations
> 5 + 3
8
> '5' + 3
'53'
> '5' – 3
2 // String is converted to a number for subtraction
> '5' – '4'
1 // Both Strings converted to number for subtraction
> '5' + + '4'
54 // Multiple +'s are ok

> 'Hello' + 'World'
'HelloWorld' // Ok, that's expected

> 'Hello' + + 'World'
'HelloNaN' // ...but that isn't
36
JavaScript Calculations
> 5 + 3
8
> '5' + 3
'53'
> '5' – 3
2 // String is converted to a number for subtraction
> '5' – '4'
1 // Both Strings converted to number for subtraction
> '5' + + '4'
54 // Multiple +'s are ok

> 'Hello' + 'World'
'HelloWorld' // Ok, that's expected

> 'Hello' + + 'World'
'HelloNaN' // ...but that isn't
37
JavaScript Calculations
> 5 + 3
8
> '5' + 3
'53'
> '5' – 3
2 // String is converted to a number for subtraction
> '5' – '4'
1 // Both Strings converted to number for subtraction
> '5' + + '4'
54 // Multiple +'s are ok

> 'Hello' + 'World'
'HelloWorld' // Ok, that's expected

> 'Hello' + + 'World'
'HelloNaN' // ...but that isn't
38
JavaScript Calculations
> 5 + 3
8
> '5' + 3
'53'
> '5' – 3
2 // String is converted to a number for subtraction
> '5' – '4'
1 // Both Strings converted to number for subtraction
> '5' + + '4'
54 // Multiple +'s are ok

> 'Hello' + 'World'
'HelloWorld' // Ok, that's expected

> 'Hello' + + 'World'
'HelloNaN' // ...but that isn't
39
JavaScript Calculations
> 5 + 3
8
> '5' + 3
'53'
> '5' – 3
2 // String is converted to a number for subtraction
> '5' – '4'
1 // Both Strings converted to number for subtraction
> '5' + + '4'
54 // Multiple +'s are ok

> 'Hello' + 'World'
'HelloWorld' // Ok, that's expected

> 'Hello' + + 'World'
'HelloNaN' // ...but that isn't
40
JavaScript Calculations
> 5 + 3
8
> '5' + 3
'53'
> '5' – 3
2 // String is converted to a number for subtraction
> '5' – '4'
1 // Both Strings converted to number for subtraction
> '5' + + '4'
54 // Multiple +'s are ok

> 'Hello' + 'World'
'HelloWorld' // Ok, that's expected

> 'Hello' + + 'World'
'HelloNaN' // ...but that isn't
41
JavaScript Calculations
> 5 + 3
8
> '5' + 3
'53'
> '5' – 3
2 // String is converted to a number for subtraction
> '5' – '4'
1 // Both Strings converted to number for subtraction
> '5' + + '4'
54 // Multiple +'s are ok

> 'Hello' + 'World'
'HelloWorld' // Ok, that's expected

> 'Hello' + + 'World'
'HelloNaN' // Multiple plus must cause String to number conversion
42
JavaScript Calculations
> '5' + - '5'
'5-2' // I can just about see that works
> var x = 3
undefined
> '5' – x + x
5 // Ok, that makes sense
> var x = 3
undefined
> '5' + x - x
50 // What???
43
JavaScript Calculations
> '5' + - '5'
'5-2' // I can just about see that works
> var x = 3
> '5' – x + x
5 // Ok, that makes sense
> var x = 3
undefined
> '5' + x - x
50 // What???
44
JavaScript Calculations
> '5' + - '5'
'5-2' // I can just about see that works
> var x = 3
> '5' – x + x
5 // Ok, that makes sense
> var x = 3
> '5' + x - x
50 // What???
45
Performance
● JSON serialization of a newly
instantiated object
● Maps
- Key of message
- Value of Hello, World!
● Example response:
46
Results from TechEmpower.com Round 9 tests (2014-05-01)
JSON Serialisation
● JSON serialization of a newly
instantiated object
● Maps
- Key of message
- Value of Hello, World!
● Example response:
47
Results from TechEmpower.com Round 9 tests (2014-05-01)
JSON Serialisation
Java
JavaScript
48
-100
-80
-60
-40
-20
0
20
40
-75
Node.js Performance
(Compared to Java)
JSON Serialization
%ageofJavaPerformance
Node.js Web App Performance vs. Java
● Fetches single row from simple
database table
● Row serialized as JSON
● Example response:
49
Results from TechEmpower.com Round 9 tests (2014-05-01)
Single Query
● Fetches single row from simple
database table
● Row serialized as JSON
● Example response:
50
Results from TechEmpower.com Round 9 tests (2014-05-01)
Single Query
Java
JavaScript
51
-100
-80
-60
-40
-20
0
20
40
-75
Node.js Performance
(Compared to Java)
JSON Serialization
%ageofJavaPerformance
Node.js Web App Performance vs. Java
-100
-80
-60
-40
-20
0
20
40
-60.5
Node.js Performance
(Compared to Java)
JSON Serialization
Single Query
%ageofJavaPerformance
52
Node.js Web App Performance vs. Java
● Fetches multiple rows from a simple
database table
● Rows serialized as JSON
● Example response:
53
Results from TechEmpower.com Round 9 tests (2014-05-01)
Multiple Queries
● Fetches multiple rows from a simple
database table
● Rows serialized as JSON
● Example response:
54
Results from TechEmpower.com Round 9 tests (2014-05-01)
Multiple Queries
Java
JavaScript
-100
-80
-60
-40
-20
0
20
40
-60.5
Node.js Performance
(Compared to Java)
JSON Serialization
Single Query
%ageofJavaPerformance
55
Node.js Web App Performance vs. Java
56
Node.js Web App Performance vs. Java
-100
-80
-60
-40
-20
0
20
40
-18
Node.js Performance
(Compared to Java)
JSON Serialization
Single Query
Multiple Queries
%ageofJavaPerformance
● Fetches multiple rows from a table
● Converts rows to objects and
modifies one attribute of each object
● Updates each associated row and
serializes as JSON
● Example Response:
57
Results from TechEmpower.com Round 9 tests (2014-05-01)
Data Updates
● Fetches multiple rows from a table
● Converts rows to objects and
modifies one attribute of each object
● Updates each associated row and
serializes as JSON
● Example Response:
58
Results from TechEmpower.com Round 9 tests (2014-05-01)
Data Updates
Java
JavaScript
59
Node.js Web App Performance vs. Java
-100
-80
-60
-40
-20
0
20
40
-18
Node.js Performance
(Compared to Java)
JSON Serialization
Single Query
Multiple Queries
%ageofJavaPerformance
60
Node.js Web App Performance vs. Java
-100
-80
-60
-40
-20
0
20
40
28
Node.js Performance
(Compared to Java)
JSON Serialization
Single Query
Multiple Queries
Data Updates
%ageofJavaPerformance
61
Node.js Web App Performance vs. Java
-100
-80
-60
-40
-20
0
20
40
28
Node.js Performance
(Compared to Java)
JSON Serialization
Single Query
Multiple Queries
Data Updates
%ageofJavaPerformance
More
Computation
More
I/O
6217*IBM created open sourced benchmark, being considered for endorsement by Node Foundation
Node.js Web App Performance
• Results from Acme Air*:
− Flight booking benchmark that includes large I/O component
− https://github.com/acmeair/acmeair
63
● JIT Compilers thrive on certainty
● Allows functions to be implemented as efficiently as possible

● Dynamic typing forces the JIT to do more work:
● Variables could be function, or data
● Variables must be tested to determine how to handle them
● Variable types can change over time
Variable Typing and Just-In-Time (JIT) Compilation
64
Just-In-Time (JIT) Compilation: The ‘+’ operator
int add(int a, int b) {
return (a + b);
}
65
Just-In-Time (JIT) Compilation: The ‘+’ operator
int add(int a, int b) {
return (a + b);
}
Add Instruction
66
Just-In-Time (JIT) Compilation: The ‘+’ operator
int add(int a, int b) {
return (a + b);
}
Add Instruction
Return Result
67
Just-In-Time (JIT) Compilation: The ‘+’ operator
var add = function (a, b) {
return (a + b);
}
68
Just-In-Time (JIT) Compilation: The ‘+’ operator
var add = function (a, b) {
return (a + b);
}
Check
type of
A
69
Just-In-Time (JIT) Compilation: The ‘+’ operator
var add = function (a, b) {
return (a + b);
}
Check
type of
A
String Number
70
Just-In-Time (JIT) Compilation: The ‘+’ operator
var add = function (a, b) {
return (a + b);
}
Check
type of
A
String NumberString
Check
type of
B
Number
71
Just-In-Time (JIT) Compilation: The ‘+’ operator
var add = function (a, b) {
return (a + b);
}
Check
type of
A
String NumberString
Check
type of
B
Number
Concatenate
72
Just-In-Time (JIT) Compilation: The ‘+’ operator
var add = function (a, b) {
return (a + b);
}
Check
type of
A
String NumberString
Check
type of
B
Number
Concatenate
Concatenate
73
Just-In-Time (JIT) Compilation: The ‘+’ operator
var add = function (a, b) {
return (a + b);
}
Check
type of
A
String NumberString
Check
type of
B
Number
Concatenate
Concatenate
String
Check
type of
B
Number
74
Just-In-Time (JIT) Compilation: The ‘+’ operator
var add = function (a, b) {
return (a + b);
}
Check
type of
A
String NumberString
Check
type of
B
Number
Concatenate
Concatenate
String
Check
type of
B
Number
Concatenate
75
Just-In-Time (JIT) Compilation: The ‘+’ operator
var add = function (a, b) {
return (a + b);
}
Check
type of
A
String NumberString
Check
type of
B
Number
Concatenate
Concatenate
String
Check
type of
B
Number
Concatenate
Floating

Point or

Normal
NormalFloat
76
Just-In-Time (JIT) Compilation: The ‘+’ operator
var add = function (a, b) {
return (a + b);
}
Check
type of
A
String NumberString
Check
type of
B
Number
Concatenate
Concatenate
String
Check
type of
B
Number
Concatenate
Floating

Point or

Normal
NormalFloat Add Instruction
77
Just-In-Time (JIT) Compilation: The ‘+’ operator
var add = function (a, b) {
return (a + b);
}
Check
type of
A
String NumberString
Check
type of
B
Number
Concatenate
Concatenate
String
Check
type of
B
Number
Concatenate
Floating

Point or

Normal
NormalFloat Add InstructionFloat Calculation
78
Dynamically vs. Statically Typed Languages
-70
-60
-50
-40
-30
-20
-10
0
Dynamic vs Statically Typed Language Performance
JSON
Single
Multi
Updates
Bestdynamiccomparedtobeststaticasbaseline
● Best statically typed language much better than best dynamic
79
Language
Selection
80
“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
81
Choosing the Right Language for the Service
82
Choosing the Right Language for the Service
0	
500	
1000	
1500	
2000	
2500	
3000	
regex-dna	
n-body	
binary-trees	spectral-norm
	fannkuch-redux	
reverse-com
plim
ent	
k-nucleo>de	
fasta	
Volume	of	Code	
Node.js	
Java
83
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
0	
500	
1000	
1500	
2000	
2500	
3000	
regex-dna	
n-body	
binary-trees	spectral-norm
	fannkuch-redux	
reverse-com
plim
ent	
k-nucleo>de	
fasta	
Volume	of	Code	
Node.js	
Java
84
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
0	
500	
1000	
1500	
2000	
2500	
3000	
regex-dna	
n-body	
binary-trees	spectral-norm
	fannkuch-redux	
reverse-com
plim
ent	
k-nucleo>de	
fasta	
Volume	of	Code	
Node.js	
Java	
Error: incompatible types
ClassCastException
85
● Higher performance for I/O
● Easier async programming
● Fullstack/isomorphic development
Choosing the Right Language for the Service
86
Choosing the Right Language for the Service
● Higher processing performance
● Type safety for calculations
● Rich processing frameworks
87
● Highly performant, scalable rich web applications
● Highly performant, reliable transaction processing
● Self-contained micro-service components
Choosing the Right Language for the Service
+
88
Emerging

Architectures
89
Rich Web Applications
90
Rich Web Applications
91
Rich Web Applications
HTTP
92
Rich Web Applications
HTTP
LoadBalancer
93
Rich Web Applications
HTTP
LoadBalancer
94
Operations and Management
Admin Analytics
LoadBalancer
HTTP
Rich Web Applications
95
Operations and Management
Admin Analytics
LoadBalancer
HTTP
Rich Web Applications
96
Operations and Management
Admin Analytics
LoadBalancer
HTTP
Rich Web Applications
97
Operations and Management
Admin Analytics
LoadBalancer
HTTP
Rich Web Applications
LoadBalancer
98
MicroServices and API Economy
99
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
LoadBalancer
100
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
LoadBalancer
101
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
LoadBalancer
102
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
LoadBalancer
103
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
104
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
105
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
Services
106
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
Services
107
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
Services
108
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
Services
109
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
Services
Client
110
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
Services
Client
Delivery
111
Operations and Management
Admin Analytics
LoadBalancer
HTTP
MicroServices and API Economy
Client
Delivery
Aggregation
Services
112
Questions?
Notices and Disclaimers
113
Copyright © 2016 by International Business Machines Corporation (IBM). No part of this document may be reproduced or transmitted in any form without written permission
from IBM.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM.
Information in these presentations (including information relating to products that have not yet been announced by IBM) has been reviewed for accuracy as of the date of initial
publication and could include unintentional technical or typographical errors. IBM shall have no responsibility to update this information. THIS DOCUMENT IS DISTRIBUTED
"AS IS" WITHOUT ANY WARRANTY, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL IBM BE LIABLE FOR ANY DAMAGE ARISING FROM THE USE OF THIS
INFORMATION, INCLUDING BUT NOT LIMITED TO, LOSS OF DATA, BUSINESS INTERRUPTION, LOSS OF PROFIT OR LOSS OF OPPORTUNITY. IBM products and
services are warranted according to the terms and conditions of the agreements under which they are provided.
Any statements regarding IBM's future direction, intent or product plans are subject to change or withdrawal without notice.
Performance data contained herein was generally obtained in a controlled, isolated environments. Customer examples are presented as illustrations of how those customers
have used IBM products and the results they may have achieved. Actual performance, cost, savings or other results in other operating environments may vary.
References in this document to IBM products, programs, or services does not imply that IBM intends to make such products, programs or services available in all countries in
which IBM operates or does business.
Workshops, sessions and associated materials may have been prepared by independent session speakers, and do not necessarily reflect the views of IBM. All materials and
discussions are provided for informational purposes only, and are neither intended to, nor shall constitute legal or other guidance or advice to any individual participant or their
specific situation.
It is the customer’s responsibility to insure its own compliance with legal requirements and to obtain advice of competent legal counsel as to the identification and
interpretation of any relevant laws and regulatory requirements that may affect the customer’s business and any actions the customer may need to take to comply with such
laws. IBM does not provide legal advice or represent or warrant that its services or products will ensure that the customer is in compliance with any law
Notices and Disclaimers Con’t.
114
Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not
tested those products in connection with this publication and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products.
Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. IBM does not warrant the quality of any third-party products, or the
ability of any such third-party products to interoperate with IBM’s products. IBM EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING BUT
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The provision of the information contained h erein is not intended to, and does not, grant any right or license under any IBM patents, copyrights, trademarks or other intellectual
property right.
IBM, the IBM logo, ibm.com, Aspera®, Bluemix, Blueworks Live, CICS, Clearcase, Cognos®, DOORS®, Emptoris®, Enterprise Document Management System™, FASP®,
FileNet®, Global Business Services ®, Global Technology Services ®, IBM ExperienceOne™, IBM SmartCloud®, IBM Social Business®, Information on Demand, ILOG,
Maximo®, MQIntegrator®, MQSeries®, Netcool®, OMEGAMON, OpenPower, PureAnalytics™, PureApplication®, pureCluster™, PureCoverage®, PureData®,
PureExperience®, PureFlex®, pureQuery®, pureScale®, PureSystems®, QRadar®, Rational®, Rhapsody®, Smarter Commerce®, SoDA, SPSS, Sterling Commerce®,
StoredIQ, Tealeaf®, Tivoli®, Trusteer®, Unica®, urban{code}®, Watson, WebSphere®, Worklight®, X-Force® and System z® Z/OS, are trademarks of International Business
Machines Corporation, registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM
trademarks is available on the Web at "Copyright and trademark information" at: www.ibm.com/legal/copytrade.shtml.
Thank You
Your Feedback is Important!
Access the InterConnect 2016 Conference Attendee
Portal to complete your session surveys from your
smartphone,
laptop or conference kiosk.

More Related Content

PDF
Impact2014: Practical Performance Troubleshooting
PDF
WebSphere Technical University: Introduction to the Java Diagnostic Tools
PDF
JAX London 2015: Java vs Nodejs
PDF
IBM InterConnect: Java vs JavaScript for Enterprise WebApps
PDF
JavaOne 2014: Java vs JavaScript
PDF
Swift Summit: Pushing the boundaries of Swift to the Server
PPTX
Node Summit 2016: Web App Architectures
PDF
IBM Monitoring and Diagnostics Tools - Health Center 3.0.2
Impact2014: Practical Performance Troubleshooting
WebSphere Technical University: Introduction to the Java Diagnostic Tools
JAX London 2015: Java vs Nodejs
IBM InterConnect: Java vs JavaScript for Enterprise WebApps
JavaOne 2014: Java vs JavaScript
Swift Summit: Pushing the boundaries of Swift to the Server
Node Summit 2016: Web App Architectures
IBM Monitoring and Diagnostics Tools - Health Center 3.0.2

What's hot (20)

PDF
IBM Monitoring and Diagnostic Tools - GCMV 2.8
PDF
InterConnect2016 Monitoring Nodejs
PDF
QCon Shanghai: Trends in Application Development
PDF
JavaOne 2015: From Java Code to Machine Code
PDF
FrenchKit: End to End Application Development with Swift
PDF
JavaOne2013: Build Your Own Runtime Monitoring for the IBM JDK with the Healt...
PDF
O'Reilly Software Architecture Conf: Cloud Economics
PPT
Cloud Economics
PDF
What's New in IBM Java 8 SE?
PDF
Puppet devops wdec
PDF
The Play Framework at LinkedIn
PDF
Spring5 New Features - Nov, 2017
PDF
Node.js vs Play Framework
PDF
Deployment Best Practices on WebLogic Server (DOAG IMC Summit 2013)
PPTX
Managed Beans: When, Why and How
PDF
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
PDF
AWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
PPTX
Load Balancing, Failover and Scalability with ColdFusion
PDF
Maxim Salnikov - Service Worker: taking the best from the past experience for...
PDF
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
IBM Monitoring and Diagnostic Tools - GCMV 2.8
InterConnect2016 Monitoring Nodejs
QCon Shanghai: Trends in Application Development
JavaOne 2015: From Java Code to Machine Code
FrenchKit: End to End Application Development with Swift
JavaOne2013: Build Your Own Runtime Monitoring for the IBM JDK with the Healt...
O'Reilly Software Architecture Conf: Cloud Economics
Cloud Economics
What's New in IBM Java 8 SE?
Puppet devops wdec
The Play Framework at LinkedIn
Spring5 New Features - Nov, 2017
Node.js vs Play Framework
Deployment Best Practices on WebLogic Server (DOAG IMC Summit 2013)
Managed Beans: When, Why and How
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
Load Balancing, Failover and Scalability with ColdFusion
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Ad

Viewers also liked (12)

PPTX
Django apps and ORM Beyond the basics [Meetup hosted by Prodeers.com]
PDF
Enterprise makeover. Be a good web citizen, deliver continuously and change y...
PPTX
How NOT to write in Node.js
PDF
(node.js) Web Development - prościej
PPTX
Managing and Versioning Machine Learning Models in Python
PDF
How to Write a Popular Python Library by Accident
PPTX
Web backends development using Python
PDF
State of Tech in Texas
PDF
The Django Web Application Framework
PDF
Web Development with Python and Django
PPTX
Connecting With the Disconnected
PPTX
Can We Assess Creativity?
Django apps and ORM Beyond the basics [Meetup hosted by Prodeers.com]
Enterprise makeover. Be a good web citizen, deliver continuously and change y...
How NOT to write in Node.js
(node.js) Web Development - prościej
Managing and Versioning Machine Learning Models in Python
How to Write a Popular Python Library by Accident
Web backends development using Python
State of Tech in Texas
The Django Web Application Framework
Web Development with Python and Django
Connecting With the Disconnected
Can We Assess Creativity?
Ad

Similar to InterConnect2016: WebApp Architectures with Java and Node.js (20)

PDF
Testing for fun in production Into The Box 2018
PDF
IBM Cloud University: Build, Deploy and Scale Node.js Microservices
PDF
Node Interactive: Node.js Performance and Highly Scalable Micro-Services
PDF
Instrumenting plugins for Performance Schema
PDF
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
PDF
JavaOne 2016 -Emerging Web App Architectures using Java and node.js
PDF
AOP in Python API design
PPT
The Web on OSGi: Here's How
PPTX
Extending uBuild and uDeploy with Plugins
PDF
Node Summit 2018: Cloud Native Node.js
PPTX
Saving Time And Effort With QuickBase Api - Sergio Haro
PDF
using Mithril.js + postgREST to build and consume API's
PPT
Scripting Oracle Develop 2007
PPTX
Creating sub zero dashboard plugin for apex with google
PDF
Maximize the power of OSGi in AEM
PDF
OpenStack API's and WSGI
PDF
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
PDF
RAHUL_Updated( (2)
PDF
بررسی چارچوب جنگو
PPT
Asp.net tips
Testing for fun in production Into The Box 2018
IBM Cloud University: Build, Deploy and Scale Node.js Microservices
Node Interactive: Node.js Performance and Highly Scalable Micro-Services
Instrumenting plugins for Performance Schema
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
JavaOne 2016 -Emerging Web App Architectures using Java and node.js
AOP in Python API design
The Web on OSGi: Here's How
Extending uBuild and uDeploy with Plugins
Node Summit 2018: Cloud Native Node.js
Saving Time And Effort With QuickBase Api - Sergio Haro
using Mithril.js + postgREST to build and consume API's
Scripting Oracle Develop 2007
Creating sub zero dashboard plugin for apex with google
Maximize the power of OSGi in AEM
OpenStack API's and WSGI
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
RAHUL_Updated( (2)
بررسی چارچوب جنگو
Asp.net tips

More from Chris Bailey (17)

PDF
NodeJS Interactive 2019: FaaS meets Frameworks
PDF
Voxxed Micro-services: Serverless JakartaEE - JAX-RS comes to FaaS
PDF
Silicon Valley Code Camp 2019 - Reaching the Cloud Native World
PDF
FaaS Meets Java EE: Developing Cloud Native Applications at Speed
PDF
AltConf 2019: Server-Side Swift State of the Union
PDF
Server-side Swift with Swagger
PDF
Index - BFFs vs GraphQL
PDF
Swift Cloud Workshop - Swift Microservices
PDF
Swift Cloud Workshop - Codable, the key to Fullstack Swift
PDF
Try!Swift India 2017: All you need is Swift
PDF
Swift Summit 2017: Server Swift State of the Union
PDF
IBM Cloud University: Java, Node.js and Swift
PDF
FrenchKit 2017: Server(less) Swift
PDF
AltConf 2017: Full Stack Swift in 30 Minutes
PDF
InterConnect: Server Side Swift for Java Developers
PDF
InterConnect: Java, Node.js and Swift - Which, Why and When
PDF
Playgrounds: Mobile + Swift = BFF
NodeJS Interactive 2019: FaaS meets Frameworks
Voxxed Micro-services: Serverless JakartaEE - JAX-RS comes to FaaS
Silicon Valley Code Camp 2019 - Reaching the Cloud Native World
FaaS Meets Java EE: Developing Cloud Native Applications at Speed
AltConf 2019: Server-Side Swift State of the Union
Server-side Swift with Swagger
Index - BFFs vs GraphQL
Swift Cloud Workshop - Swift Microservices
Swift Cloud Workshop - Codable, the key to Fullstack Swift
Try!Swift India 2017: All you need is Swift
Swift Summit 2017: Server Swift State of the Union
IBM Cloud University: Java, Node.js and Swift
FrenchKit 2017: Server(less) Swift
AltConf 2017: Full Stack Swift in 30 Minutes
InterConnect: Server Side Swift for Java Developers
InterConnect: Java, Node.js and Swift - Which, Why and When
Playgrounds: Mobile + Swift = BFF

Recently uploaded (20)

PDF
medical staffing services at VALiNTRY
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
L1 - Introduction to python Backend.pptx
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
System and Network Administraation Chapter 3
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
medical staffing services at VALiNTRY
2025 Textile ERP Trends: SAP, Odoo & Oracle
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
L1 - Introduction to python Backend.pptx
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
How to Choose the Right IT Partner for Your Business in Malaysia
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PTS Company Brochure 2025 (1).pdf.......
Upgrade and Innovation Strategies for SAP ERP Customers
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Wondershare Filmora 15 Crack With Activation Key [2025
System and Network Administraation Chapter 3
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
How to Migrate SBCGlobal Email to Yahoo Easily
Understanding Forklifts - TECH EHS Solution
Odoo Companies in India – Driving Business Transformation.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises

InterConnect2016: WebApp Architectures with Java and Node.js

  • 1. Emerging Web App Architectures Using Java and Node.js
  • 2. IMPORTANT info regarding IBM speaker guidelines and disclaimers • If your presentation has forward looking content, it is mandatory that you put the forward disclaimer as slide 2 in your presentation (this is the “Please Note” slide, third slide down in this template). • All presentations, whether they have future content or not, must include the mandatory “Notices and Disclaimers” – slides 8 and 9 in the template. Insert these slides just before the “Thank You” slide in your deck. • Please refer to the FAQ document in the Speaker Kit regarding additional legal guidance for use of photos, logos, customer references and analyst information. • It is recommended to have your material reviewed by Legal if you have any concerns regarding your content. • Please submit your final presentation, using the instructions in the online Speaker Kit, by February 5th, 2016. Post your final file in native format using the following naming convention: session code.ppt (For example, 1576.ppt) • Disclosures regarding forward guidance is embedded in the tool and also available through this link: • https://w3-03.ibm.com/finance/finsubp.nsf/WebPages/N01FF08SoftwareRevenueRecognitionGuidelinesRelatedtoProductDisclosures • Please remove these instructions before finalizing your presentation. 2
  • 3. Please Note: 3 • IBM’s statements regarding its plans, directions, and intent are subject to change or withdrawal without notice at IBM’s sole discretion. • Information regarding potential future products is intended to outline our general product direction and it should not be relied on in making a purchasing decision. • The information mentioned regarding potential future products is not a commitment, promise, or legal obligation to deliver any material, code or functionality. Information about potential future products may not be incorporated into any contract. • The development, release, and timing of any future features or functionality described for our products remains at our sole discretion. • Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will experience will vary depending upon many factors, including considerations such as the amount of multiprogramming in the user’s job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve results similar to those stated here.
  • 4. © 2015 IBM Corporation4 1 STSM, IBM Runtime Development @Chris__Bailey @seabaylea
  • 7. 7 API Package Support ● Node.js growth: ● 371 packages/day ● Java growth: ● 92 packages/day
  • 10. 10 var cluster = require('cluster'); var cpus = require('os').cpus().length; var http = require('http'); if (cluster.isMaster) { for (var i = 0; i < cpus; i++) { cluster.fork(); } cluster.on('death', function(worker) { console.log("Worker" + worker.pid + "died"); }); } else { http.createServer(function(request, response) { response.writeHead(200, {"Content-Type": "text/plain"}); response.write("Hello World!n"); response.end(); }).listen(8080); } Writing a HTTP Server
  • 11. 11 var cluster = require('cluster'); var cpus = require('os').cpus().length; var http = require('http'); if (cluster.isMaster) { for (var i = 0; i < cpus; i++) { cluster.fork(); } cluster.on('death', function(worker) { console.log("Worker" + worker.pid + "died"); }); } else { http.createServer(function(request, response) { response.writeHead(200, {"Content-Type": "text/plain"}); response.write("Hello World!n"); response.end(); }).listen(8080); } And Clustering It….
  • 12. 12 ● 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
  • 13. 13 ● 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
  • 14. 14 Node.js event based programming var http = require('http'); var server = http.createServer(); server.listen(8080); server.on('request', function(request, response) { response.writeHead(200, {"Content-Type": "text/plain"}); response.write("Hello World!n"); response.end(); }); server.on('connection', function(socket) {}); server.on('close', function() {}); server.on('connect', function(socket) {}); server.on('upgrade', function(request, socket, head) {}); server.on('clientError', function(exception, socket) {});
  • 17. 17 ● The web has moved from Web Sites to Web Applications From Web Sites to Web Apps
  • 18. ● JavaScript is ubiquitous in the browser - Supported in every browser - Integration with HTML and CSS ● JavaScript is not affected by negative publicity.... 18 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
  • 19. 19 FullStack JavaScript Development ● Reuse of programming skills and teams ● Reuse of skills for both client and server side code ● Reuse of “isomorphic” code components ● Reuse of code for both client and server ● Write One Run Anywhere ● Faster user experience performance ● Use of server side rendering
  • 20. 20 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
  • 22. 22 Simple Calculation: 5 + 3 private static void add (int a, int b){ System.out.println(a + b); } public static void main(String[] args){ int a = 5; int b = 3; add(a, b); } > javac app.java > java app > 8 var add = function (a, b) { console.log(a + b); } var a = 5; var b = 3; add(a, b); > node app.js > 8
  • 23. 23 Simple Calculation: 5 + 3 private static void add (int a, int b){ System.out.println(a + b); } public static void main(String[] args){ int a = 5; int b = 3; add(a, b); } > javac app.java > java app > 8 var add = function (a, b) { console.log(a + b); } var a = 5; var b = 3; add(a, b); > node app.js > 8
  • 24. 24 Simple Calculation: 5 + 3 private static void add (int a, int b){ System.out.println(a + b); } public static void main(String[] args){ int a = 5; int b = 3; add(a, b); } > javac app.java > java app > 8 var add = function (a, b) { console.log(a + b); } var a = 5; var b = 3; add(a, b); > node app.js > 8
  • 25. 25 Simple Calculation: 5 + 3 private static void add (int a, int b){ System.out.println(a + b); } public static void main(String[] args){ int a = 5; int b = 3; add(a, b); } > javac app.java > java app > 8 var add = function (a, b) { console.log(a + b); } var a = 5; var b = 3; add(a, b); > node app.js > 8
  • 26. 26 Simple Calculation: 5 + 3 private static void add (int a, int b){ System.out.println(a + b); } public static void main(String[] args){ int a = 5; int b = 3; add(a, b); } > javac app.java > java app > 8 var add = function (a, b) { console.log(a + b); } var a = 5; var b = 3; add(a, b); > node app.js > 8
  • 27. 27 Simple Calculation: 5 + 3 private static void add (int a, int b){ System.out.println(a + b); } public static void main(String[] args){ String a = new String(“5”); int b = 3; add(a, b); } > javac app.java > java app > 8 var add = function (a, b) { console.log(a + b); } var a = ‘5’; var b = 3; add(a, b); > node app.js > 8
  • 28. 28 Simple Calculation: 5 + 3 private static void add (int a, int b){ System.out.println(a + b); } public static void main(String[] args){ String a = new String(“5”); int b = 3; add(a, b); } > javac app.java > java app > 8 var add = function (a, b) { console.log(a + b); } var a = ‘5’; var b = 3; add(a, b); > node app.js > 8
  • 29. 29 Simple Calculation: 5 + 3 private static void add (int a, int b){ System.out.println(a + b); } public static void main(String[] args){ String a = new String(“5”); int b = 3; add(a, b); } > javac app.java Error: incompatible types: String cannot be converted to int add(a, b); ^ var add = function (a, b) { console.log(a + b); } var a = ‘5’; var b = 3; add(a, b); > node app.js > 8
  • 30. 30 Simple Calculation: 5 + 3 private static void add (int a, int b){ System.out.println(a + b); } public static void main(String[] args){ String a = new String(“5”); int b = 3; add(a, b); } > javac app.java Error: incompatible types: String cannot be converted to int add(a, b); ^ var add = function (a, b) { console.log(a + b); } var a = ‘5’; var b = 3; add(a, b); > node app.js > 53
  • 31. 31 JavaScript Calculations > 5 + 3 8 > '5' + 3 '53' > '5' – 3 2 // Weak typing, implicit conversion > '5' – '4' 1 // String minus String = Integer??
 > '5' + + '4' 54 // Multiple +'s are ok
 > 'Hello' + 'World' 'HelloWorld' // Ok, that's expected
 > 'Hello' + + 'World' 'HelloNaN' // ...but that isn't
  • 32. 32 JavaScript Calculations > 5 + 3 8 > '5' + 3 '53' > '5' – 3 2 // Weak typing, implicit conversion > '5' – '4' 1 // String minus String = Integer??
 > '5' + + '4' 54 // Multiple +'s are ok
 > 'Hello' + 'World' 'HelloWorld' // Ok, that's expected
 > 'Hello' + + 'World' 'HelloNaN' // ...but that isn't
  • 33. 33 JavaScript Calculations > 5 + 3 8 > '5' + 3 '53' > '5' – 3 2 // String is converted to a number for subtraction > '5' – '4' 1 // String minus String = Integer??
 > '5' + + '4' 54 // Multiple +'s are ok
 > 'Hello' + 'World' 'HelloWorld' // Ok, that's expected
 > 'Hello' + + 'World' 'HelloNaN' // ...but that isn't
  • 34. 34 JavaScript Calculations > 5 + 3 8 > '5' + 3 '53' > '5' – 3 2 // String is converted to a number for subtraction > '5' – '4' 1 // String minus String = Integer??
 > '5' + + '4' 54 // Multiple +'s are ok
 > 'Hello' + 'World' 'HelloWorld' // Ok, that's expected
 > 'Hello' + + 'World' 'HelloNaN' // ...but that isn't
  • 35. 35 JavaScript Calculations > 5 + 3 8 > '5' + 3 '53' > '5' – 3 2 // String is converted to a number for subtraction > '5' – '4' 1 // Both Strings converted to number for subtraction > '5' + + '4' 54 // Multiple +'s are ok
 > 'Hello' + 'World' 'HelloWorld' // Ok, that's expected
 > 'Hello' + + 'World' 'HelloNaN' // ...but that isn't
  • 36. 36 JavaScript Calculations > 5 + 3 8 > '5' + 3 '53' > '5' – 3 2 // String is converted to a number for subtraction > '5' – '4' 1 // Both Strings converted to number for subtraction > '5' + + '4' 54 // Multiple +'s are ok
 > 'Hello' + 'World' 'HelloWorld' // Ok, that's expected
 > 'Hello' + + 'World' 'HelloNaN' // ...but that isn't
  • 37. 37 JavaScript Calculations > 5 + 3 8 > '5' + 3 '53' > '5' – 3 2 // String is converted to a number for subtraction > '5' – '4' 1 // Both Strings converted to number for subtraction > '5' + + '4' 54 // Multiple +'s are ok
 > 'Hello' + 'World' 'HelloWorld' // Ok, that's expected
 > 'Hello' + + 'World' 'HelloNaN' // ...but that isn't
  • 38. 38 JavaScript Calculations > 5 + 3 8 > '5' + 3 '53' > '5' – 3 2 // String is converted to a number for subtraction > '5' – '4' 1 // Both Strings converted to number for subtraction > '5' + + '4' 54 // Multiple +'s are ok
 > 'Hello' + 'World' 'HelloWorld' // Ok, that's expected
 > 'Hello' + + 'World' 'HelloNaN' // ...but that isn't
  • 39. 39 JavaScript Calculations > 5 + 3 8 > '5' + 3 '53' > '5' – 3 2 // String is converted to a number for subtraction > '5' – '4' 1 // Both Strings converted to number for subtraction > '5' + + '4' 54 // Multiple +'s are ok
 > 'Hello' + 'World' 'HelloWorld' // Ok, that's expected
 > 'Hello' + + 'World' 'HelloNaN' // ...but that isn't
  • 40. 40 JavaScript Calculations > 5 + 3 8 > '5' + 3 '53' > '5' – 3 2 // String is converted to a number for subtraction > '5' – '4' 1 // Both Strings converted to number for subtraction > '5' + + '4' 54 // Multiple +'s are ok
 > 'Hello' + 'World' 'HelloWorld' // Ok, that's expected
 > 'Hello' + + 'World' 'HelloNaN' // ...but that isn't
  • 41. 41 JavaScript Calculations > 5 + 3 8 > '5' + 3 '53' > '5' – 3 2 // String is converted to a number for subtraction > '5' – '4' 1 // Both Strings converted to number for subtraction > '5' + + '4' 54 // Multiple +'s are ok
 > 'Hello' + 'World' 'HelloWorld' // Ok, that's expected
 > 'Hello' + + 'World' 'HelloNaN' // Multiple plus must cause String to number conversion
  • 42. 42 JavaScript Calculations > '5' + - '5' '5-2' // I can just about see that works > var x = 3 undefined > '5' – x + x 5 // Ok, that makes sense > var x = 3 undefined > '5' + x - x 50 // What???
  • 43. 43 JavaScript Calculations > '5' + - '5' '5-2' // I can just about see that works > var x = 3 > '5' – x + x 5 // Ok, that makes sense > var x = 3 undefined > '5' + x - x 50 // What???
  • 44. 44 JavaScript Calculations > '5' + - '5' '5-2' // I can just about see that works > var x = 3 > '5' – x + x 5 // Ok, that makes sense > var x = 3 > '5' + x - x 50 // What???
  • 46. ● JSON serialization of a newly instantiated object ● Maps - Key of message - Value of Hello, World! ● Example response: 46 Results from TechEmpower.com Round 9 tests (2014-05-01) JSON Serialisation
  • 47. ● JSON serialization of a newly instantiated object ● Maps - Key of message - Value of Hello, World! ● Example response: 47 Results from TechEmpower.com Round 9 tests (2014-05-01) JSON Serialisation Java JavaScript
  • 48. 48 -100 -80 -60 -40 -20 0 20 40 -75 Node.js Performance (Compared to Java) JSON Serialization %ageofJavaPerformance Node.js Web App Performance vs. Java
  • 49. ● Fetches single row from simple database table ● Row serialized as JSON ● Example response: 49 Results from TechEmpower.com Round 9 tests (2014-05-01) Single Query
  • 50. ● Fetches single row from simple database table ● Row serialized as JSON ● Example response: 50 Results from TechEmpower.com Round 9 tests (2014-05-01) Single Query Java JavaScript
  • 51. 51 -100 -80 -60 -40 -20 0 20 40 -75 Node.js Performance (Compared to Java) JSON Serialization %ageofJavaPerformance Node.js Web App Performance vs. Java
  • 52. -100 -80 -60 -40 -20 0 20 40 -60.5 Node.js Performance (Compared to Java) JSON Serialization Single Query %ageofJavaPerformance 52 Node.js Web App Performance vs. Java
  • 53. ● Fetches multiple rows from a simple database table ● Rows serialized as JSON ● Example response: 53 Results from TechEmpower.com Round 9 tests (2014-05-01) Multiple Queries
  • 54. ● Fetches multiple rows from a simple database table ● Rows serialized as JSON ● Example response: 54 Results from TechEmpower.com Round 9 tests (2014-05-01) Multiple Queries Java JavaScript
  • 55. -100 -80 -60 -40 -20 0 20 40 -60.5 Node.js Performance (Compared to Java) JSON Serialization Single Query %ageofJavaPerformance 55 Node.js Web App Performance vs. Java
  • 56. 56 Node.js Web App Performance vs. Java -100 -80 -60 -40 -20 0 20 40 -18 Node.js Performance (Compared to Java) JSON Serialization Single Query Multiple Queries %ageofJavaPerformance
  • 57. ● Fetches multiple rows from a table ● Converts rows to objects and modifies one attribute of each object ● Updates each associated row and serializes as JSON ● Example Response: 57 Results from TechEmpower.com Round 9 tests (2014-05-01) Data Updates
  • 58. ● Fetches multiple rows from a table ● Converts rows to objects and modifies one attribute of each object ● Updates each associated row and serializes as JSON ● Example Response: 58 Results from TechEmpower.com Round 9 tests (2014-05-01) Data Updates Java JavaScript
  • 59. 59 Node.js Web App Performance vs. Java -100 -80 -60 -40 -20 0 20 40 -18 Node.js Performance (Compared to Java) JSON Serialization Single Query Multiple Queries %ageofJavaPerformance
  • 60. 60 Node.js Web App Performance vs. Java -100 -80 -60 -40 -20 0 20 40 28 Node.js Performance (Compared to Java) JSON Serialization Single Query Multiple Queries Data Updates %ageofJavaPerformance
  • 61. 61 Node.js Web App Performance vs. Java -100 -80 -60 -40 -20 0 20 40 28 Node.js Performance (Compared to Java) JSON Serialization Single Query Multiple Queries Data Updates %ageofJavaPerformance More Computation More I/O
  • 62. 6217*IBM created open sourced benchmark, being considered for endorsement by Node Foundation Node.js Web App Performance • Results from Acme Air*: − Flight booking benchmark that includes large I/O component − https://github.com/acmeair/acmeair
  • 63. 63 ● JIT Compilers thrive on certainty ● Allows functions to be implemented as efficiently as possible
 ● Dynamic typing forces the JIT to do more work: ● Variables could be function, or data ● Variables must be tested to determine how to handle them ● Variable types can change over time Variable Typing and Just-In-Time (JIT) Compilation
  • 64. 64 Just-In-Time (JIT) Compilation: The ‘+’ operator int add(int a, int b) { return (a + b); }
  • 65. 65 Just-In-Time (JIT) Compilation: The ‘+’ operator int add(int a, int b) { return (a + b); } Add Instruction
  • 66. 66 Just-In-Time (JIT) Compilation: The ‘+’ operator int add(int a, int b) { return (a + b); } Add Instruction Return Result
  • 67. 67 Just-In-Time (JIT) Compilation: The ‘+’ operator var add = function (a, b) { return (a + b); }
  • 68. 68 Just-In-Time (JIT) Compilation: The ‘+’ operator var add = function (a, b) { return (a + b); } Check type of A
  • 69. 69 Just-In-Time (JIT) Compilation: The ‘+’ operator var add = function (a, b) { return (a + b); } Check type of A String Number
  • 70. 70 Just-In-Time (JIT) Compilation: The ‘+’ operator var add = function (a, b) { return (a + b); } Check type of A String NumberString Check type of B Number
  • 71. 71 Just-In-Time (JIT) Compilation: The ‘+’ operator var add = function (a, b) { return (a + b); } Check type of A String NumberString Check type of B Number Concatenate
  • 72. 72 Just-In-Time (JIT) Compilation: The ‘+’ operator var add = function (a, b) { return (a + b); } Check type of A String NumberString Check type of B Number Concatenate Concatenate
  • 73. 73 Just-In-Time (JIT) Compilation: The ‘+’ operator var add = function (a, b) { return (a + b); } Check type of A String NumberString Check type of B Number Concatenate Concatenate String Check type of B Number
  • 74. 74 Just-In-Time (JIT) Compilation: The ‘+’ operator var add = function (a, b) { return (a + b); } Check type of A String NumberString Check type of B Number Concatenate Concatenate String Check type of B Number Concatenate
  • 75. 75 Just-In-Time (JIT) Compilation: The ‘+’ operator var add = function (a, b) { return (a + b); } Check type of A String NumberString Check type of B Number Concatenate Concatenate String Check type of B Number Concatenate Floating
 Point or
 Normal NormalFloat
  • 76. 76 Just-In-Time (JIT) Compilation: The ‘+’ operator var add = function (a, b) { return (a + b); } Check type of A String NumberString Check type of B Number Concatenate Concatenate String Check type of B Number Concatenate Floating
 Point or
 Normal NormalFloat Add Instruction
  • 77. 77 Just-In-Time (JIT) Compilation: The ‘+’ operator var add = function (a, b) { return (a + b); } Check type of A String NumberString Check type of B Number Concatenate Concatenate String Check type of B Number Concatenate Floating
 Point or
 Normal NormalFloat Add InstructionFloat Calculation
  • 78. 78 Dynamically vs. Statically Typed Languages -70 -60 -50 -40 -30 -20 -10 0 Dynamic vs Statically Typed Language Performance JSON Single Multi Updates Bestdynamiccomparedtobeststaticasbaseline ● Best statically typed language much better than best dynamic
  • 80. 80 “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
  • 81. 81 Choosing the Right Language for the Service
  • 82. 82 Choosing the Right Language for the Service 0 500 1000 1500 2000 2500 3000 regex-dna n-body binary-trees spectral-norm fannkuch-redux reverse-com plim ent k-nucleo>de fasta Volume of Code Node.js Java
  • 83. 83 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 0 500 1000 1500 2000 2500 3000 regex-dna n-body binary-trees spectral-norm fannkuch-redux reverse-com plim ent k-nucleo>de fasta Volume of Code Node.js Java
  • 84. 84 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 0 500 1000 1500 2000 2500 3000 regex-dna n-body binary-trees spectral-norm fannkuch-redux reverse-com plim ent k-nucleo>de fasta Volume of Code Node.js Java Error: incompatible types ClassCastException
  • 85. 85 ● Higher performance for I/O ● Easier async programming ● Fullstack/isomorphic development Choosing the Right Language for the Service
  • 86. 86 Choosing the Right Language for the Service ● Higher processing performance ● Type safety for calculations ● Rich processing frameworks
  • 87. 87 ● Highly performant, scalable rich web applications ● Highly performant, reliable transaction processing ● Self-contained micro-service components Choosing the Right Language for the Service +
  • 94. 94 Operations and Management Admin Analytics LoadBalancer HTTP Rich Web Applications
  • 95. 95 Operations and Management Admin Analytics LoadBalancer HTTP Rich Web Applications
  • 96. 96 Operations and Management Admin Analytics LoadBalancer HTTP Rich Web Applications
  • 97. 97 Operations and Management Admin Analytics LoadBalancer HTTP Rich Web Applications LoadBalancer
  • 99. 99 Operations and Management Admin Analytics LoadBalancer HTTP MicroServices and API Economy LoadBalancer
  • 100. 100 Operations and Management Admin Analytics LoadBalancer HTTP MicroServices and API Economy LoadBalancer
  • 101. 101 Operations and Management Admin Analytics LoadBalancer HTTP MicroServices and API Economy LoadBalancer
  • 102. 102 Operations and Management Admin Analytics LoadBalancer HTTP MicroServices and API Economy LoadBalancer
  • 103. 103 Operations and Management Admin Analytics LoadBalancer HTTP MicroServices and API Economy
  • 104. 104 Operations and Management Admin Analytics LoadBalancer HTTP MicroServices and API Economy
  • 105. 105 Operations and Management Admin Analytics LoadBalancer HTTP MicroServices and API Economy Services
  • 106. 106 Operations and Management Admin Analytics LoadBalancer HTTP MicroServices and API Economy Services
  • 107. 107 Operations and Management Admin Analytics LoadBalancer HTTP MicroServices and API Economy Services
  • 108. 108 Operations and Management Admin Analytics LoadBalancer HTTP MicroServices and API Economy Services
  • 109. 109 Operations and Management Admin Analytics LoadBalancer HTTP MicroServices and API Economy Services Client
  • 110. 110 Operations and Management Admin Analytics LoadBalancer HTTP MicroServices and API Economy Services Client Delivery
  • 111. 111 Operations and Management Admin Analytics LoadBalancer HTTP MicroServices and API Economy Client Delivery Aggregation Services
  • 113. Notices and Disclaimers 113 Copyright © 2016 by International Business Machines Corporation (IBM). No part of this document may be reproduced or transmitted in any form without written permission from IBM. U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM. Information in these presentations (including information relating to products that have not yet been announced by IBM) has been reviewed for accuracy as of the date of initial publication and could include unintentional technical or typographical errors. IBM shall have no responsibility to update this information. THIS DOCUMENT IS DISTRIBUTED "AS IS" WITHOUT ANY WARRANTY, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL IBM BE LIABLE FOR ANY DAMAGE ARISING FROM THE USE OF THIS INFORMATION, INCLUDING BUT NOT LIMITED TO, LOSS OF DATA, BUSINESS INTERRUPTION, LOSS OF PROFIT OR LOSS OF OPPORTUNITY. IBM products and services are warranted according to the terms and conditions of the agreements under which they are provided. Any statements regarding IBM's future direction, intent or product plans are subject to change or withdrawal without notice. Performance data contained herein was generally obtained in a controlled, isolated environments. Customer examples are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual performance, cost, savings or other results in other operating environments may vary. References in this document to IBM products, programs, or services does not imply that IBM intends to make such products, programs or services available in all countries in which IBM operates or does business. Workshops, sessions and associated materials may have been prepared by independent session speakers, and do not necessarily reflect the views of IBM. All materials and discussions are provided for informational purposes only, and are neither intended to, nor shall constitute legal or other guidance or advice to any individual participant or their specific situation. It is the customer’s responsibility to insure its own compliance with legal requirements and to obtain advice of competent legal counsel as to the identification and interpretation of any relevant laws and regulatory requirements that may affect the customer’s business and any actions the customer may need to take to comply with such laws. IBM does not provide legal advice or represent or warrant that its services or products will ensure that the customer is in compliance with any law
  • 114. Notices and Disclaimers Con’t. 114 Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products in connection with this publication and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. IBM does not warrant the quality of any third-party products, or the ability of any such third-party products to interoperate with IBM’s products. IBM EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The provision of the information contained h erein is not intended to, and does not, grant any right or license under any IBM patents, copyrights, trademarks or other intellectual property right. IBM, the IBM logo, ibm.com, Aspera®, Bluemix, Blueworks Live, CICS, Clearcase, Cognos®, DOORS®, Emptoris®, Enterprise Document Management System™, FASP®, FileNet®, Global Business Services ®, Global Technology Services ®, IBM ExperienceOne™, IBM SmartCloud®, IBM Social Business®, Information on Demand, ILOG, Maximo®, MQIntegrator®, MQSeries®, Netcool®, OMEGAMON, OpenPower, PureAnalytics™, PureApplication®, pureCluster™, PureCoverage®, PureData®, PureExperience®, PureFlex®, pureQuery®, pureScale®, PureSystems®, QRadar®, Rational®, Rhapsody®, Smarter Commerce®, SoDA, SPSS, Sterling Commerce®, StoredIQ, Tealeaf®, Tivoli®, Trusteer®, Unica®, urban{code}®, Watson, WebSphere®, Worklight®, X-Force® and System z® Z/OS, are trademarks of International Business Machines Corporation, registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at: www.ibm.com/legal/copytrade.shtml.
  • 115. Thank You Your Feedback is Important! Access the InterConnect 2016 Conference Attendee Portal to complete your session surveys from your smartphone, laptop or conference kiosk.