© 2015 IBM Corporation1
Trends in Application Development
For Enterprise Web Applications
Chris Bailey
IBM Runtime Technologies
© 2015 IBM Corporation2
2
#1
Language Choices
© 2014 IBM Corporation3
The Ecosystem is Increasingly Polyglot
Hardware Platforms
Language
Developers
Runtime Stacks
Cloud Providers
Service Providers
Want to ensure quality implementations of language runtimes on their HW
platforms and drive innovation to exploit hardware
Want high performance infrastructure but lack expertise. Lack a common point of
investment for runtime acceleration on all platforms
Want hardware platform benefits to showcase their stack regardless of the
language runtime engine
Need a premium deployment platform where the language runtime showcases
their density, performance, scaling and reliability
Leverage the platform capabilities to accelerate computation and communication
regardless of language runtime
© 2014 IBM Corporation4
GitHub Adoption
© 2014 IBM Corporation5
GitHub Trends
© 2014 IBM Corporation6
Ratings based on the number of skilled engineers, courses and third party vendors.
Tiobe Community Programming Index
© 2014 IBM Corporation7
modulecounts.com
© 2014 IBM Corporation8
Average salary and job vacancies (Computer Science Zone)
Computer Science Zone Jobs Report
© 2014 IBM Corporation9
RedMonk Language Rankings
1 JavaScript
2 Java
3 PHP
4 Python
5 C#
5 C++
5 Ruby
8 CSS
9 C
10 Objective-C
11 Perl
11 Shell
13 R
14 Scala
15 Go
16 Haskell
17 Matlab
17 Swift
19 Clojure
19 Groovy
19 Visual Basic
© 2014 IBM Corporation10
RedMonk Language Rankings Trends
01/01/2013 01/05/2013 01/09/2013 01/01/2014 01/05/2014 01/09/2014 01/01/2015 01/05/2015
0
2
4
6
8
10
12
14
16
18
20
JavaScript
Java
PHP
Python
C#
C++
Ruby
CSS
C
Objective-C
Perl
Shell
R
Scala
Go
Haskell
Matlab
Swift
Clojure
Groovy
Visual Basic
© 2014 IBM Corporation11
RedMonk Language Rankings Trends
01/01/2013 01/05/2013 01/09/2013 01/01/2014 01/05/2014 01/09/2014 01/01/2015 01/05/2015
0
2
4
6
8
10
12
14
16
18
20
JavaScript
Java
PHP
Python
C#
C++
Ruby
CSS
C
Objective-C
Perl
Shell
R
Scala
Go
Haskell
Matlab
Swift
Clojure
Groovy
Visual Basic
© 2015 IBM Corporation12
#2
Engaging Applications
© 2015 IBM Corporation13

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…
Browser Applications
© 2015 IBM Corporation14

Java has originally targeted at for creating user applications

Eventually started to migrate to the server:
- JPE launched in 1998

Today Java has rich platform support:
- Linux x86, Linux POWER, zLinux
- Windows, Mac OS, Solaris, AIX, z/OS

JavaScript usage is starting to grow on the server
Browser Applications to Server Applications
© 2015 IBM Corporation15

Single Threaded Event based JavaScript framework
– Uses non-blocking asynchronous I/O

Wraps the Chrome V8 JavaScript engine with I/O interfaces
– Libuv provides interaction with OS/system

Designed to build scalable network applications
– Suited for real time delivery of data to distributed client

Available on a wide set of platforms:
- Linux on x86, ARM, Power and Z
- Windows, Mac OS, Solaris, SmartOS and AIX
libuvV8
Node Bindings
Node Standard Library
C
JavaScript
Server Side JavaScript: Node.js
© 2015 IBM Corporation16
#3
Reactive Programming
© 2015 IBM Corporation17

Can easily express dynamic data flows

Execution model propagates changes through the model

Typically makes use of asynchronous models to propagate events
Reactive Programming
“a programming paradigm oriented around data
flows and the propagation of change.”
© 2015 IBM Corporation18

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

Number of concurrent customers
determined by number of depot workers

Additional customers wait in a queue with no
response
Typical approach to I/O
© 2015 IBM Corporation19

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

Number of concurrent customers
determined by how fast the food Server
can work

Or until the kitchen gets slammed
Asycnhronous Non-Blocking I/O
© 2015 IBM Corporation20

JavaScript is inherently designed to be asynchronous
- eg. onClick and onMouseOver events

This applies easily to server applications as well
JavaScript and Asynchronous I/O
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) {});
© 2015 IBM Corporation21
#4
Cloud Deployments
© 2015 IBM Corporation22
Cloud
“a virtual, dynamic environment which maximizes use,
is infinitely scalable, always available and needs
minimal upfront investment or commitment”
●
Removes infrastructure as a bottleneck to rapid application delivery
and expansion
●
Provides “compute on tap”
●
But taps come with meters and usage charge models
© 2015 IBM Corporation23
Compute Costs
Offering RAM Cost CPUs
IBM Bluemix (CF) $24.15 GB/Month 4vCPUs per instance
IBM Bluemix (Containers) $  9.94 GB/Month 4vCPUs per GB
run.pivotal.io $21.60 GB/Month 4vCPUs per instance
Heroku (Hobby) $14.00 GB/Month 1 "CPU share" per 512MB
in an instance
Heroku (Professional) $50.00 GB/Month 1 "CPU share" per 512MB
in an instance
Amazon EC2 (SLES) $16.56 GB/Month 1 vCPU per 4GB in an
instance.
© 2015 IBM Corporation24
-Xmx: $$$
Cloud Economics
© 2015 IBM Corporation25
Cloud Economics
Someone
will be
looking at
your leaky
app
Someone
will be
looking at
your leaky
app
© 2015 IBM Corporation26
Clouds are Polyglot
© 2015 IBM Corporation27
N-Body Benchmark: Memory Footprints
0
10
20
30
40
50
60
70
© 2015 IBM Corporation28
N-Body Benchmark: Time to Complete
0
5
10
15
20
25
30
35
40
CompleteTime(s)
© 2015 IBM Corporation29
N-Body Benchmark: Time to Complete
0
2
4
6
8
10
12
14
16
18
20
CompleteTime/100MB(s)
© 2015 IBM Corporation30
#5
MicroServices
© 2015 IBM Corporation31

Services are small and targeted to their task

Services are organized around capabilties

Services are self contained, storing their own data
MicroServices
“Do one thing, and do it well”
© 2015 IBM Corporation32

Dynamically typed languages are harder to manage under the hood

They have lower runtime performance for computational tasks
Dynamically vs Statically Types Languages
-70
-60
-50
-40
-30
-20
-10
0
Dynamic vs Statically Typed Language Performance
JSON
Single
Multi
Updates
Bestdynamiccomparedtobeststaticasbaseline
© 2015 IBM Corporation33

Dynamically typed languages are harder to manage under the hood

They have lower runtime performance for computational tasks

They have higher scope for data integrity issues:

Statically typed languages throw error at compile time or runtime
Dynamically vs Statically Types Languages
-70
-60
-50
-40
-30
-20
-10
0
Dynamic vs Statically Typed Language Performance
JSON
Single
Multi
Updates
Bestdynamiccomparedtobeststaticasbaseline
> 12 + 3
123 // 12 or 3 previously used as text
© 2015 IBM Corporation34
Choosing the Right Language for the Service
Node.js
0
- 4x
+ 1/3x
Node.jsPerformanceRelativetoJava
CPU Bound I/O Bound
* based on TechEmpower benchmark results
regex-dna Spectral-normfannkuch-redux fasta k-nucleotide Binary-trees n-body Reverse-complement
Node.jsCodeVolumeRelativetoJava
* based on benchmarksgame benchmarks
Node.js
Application Performance
(higher is better)
Development Effort
(lower is better)
●
Node.js has higher performance for I/O
Fast async non-blocking framework for scalability
●
Node.js allows “fullstack” webapp development
End to end JavaScript for server and browser
However....
●
Java is much faster at computational logic
Node.js performance is non-ideal for transactions
- 3x
●
Node.js has higher developer productivity
Many applications developed with significantly less code
●
Rich module system simplifies development
Reduces need to develop custom code
However...
●
Java is strongly typed, ensuring data correctness
Node.js type mis-matches can result in incorrect results
Node.js fits the presentation tier, offloading to Java* for business transactional logic
Avg 1/3rd
less code
© 2015 IBM Corporation35
Service topology for Web Applications
Operations and Management
Admin Analytics
LoadBalancer
LoadBalancer
HTTP
Monitoring ScalingAnalytics Diagnostics
© 2015 IBM Corporation36
Service topology for Web Applications
Operations and Management
Admin Analytics
LoadBalancer
LoadBalancer
HTTP
Monitoring ScalingAnalytics Diagnostics
© 2015 IBM Corporation37
Service topology for Web Applications
Operations and Management
Admin Analytics
LoadBalancer
LoadBalancer
HTTP
Monitoring ScalingAnalytics Diagnostics
© 2015 IBM Corporation38

QCon Shanghai: Trends in Application Development

  • 1.
    © 2015 IBMCorporation1 Trends in Application Development For Enterprise Web Applications Chris Bailey IBM Runtime Technologies
  • 2.
    © 2015 IBMCorporation2 2 #1 Language Choices
  • 3.
    © 2014 IBMCorporation3 The Ecosystem is Increasingly Polyglot Hardware Platforms Language Developers Runtime Stacks Cloud Providers Service Providers Want to ensure quality implementations of language runtimes on their HW platforms and drive innovation to exploit hardware Want high performance infrastructure but lack expertise. Lack a common point of investment for runtime acceleration on all platforms Want hardware platform benefits to showcase their stack regardless of the language runtime engine Need a premium deployment platform where the language runtime showcases their density, performance, scaling and reliability Leverage the platform capabilities to accelerate computation and communication regardless of language runtime
  • 4.
    © 2014 IBMCorporation4 GitHub Adoption
  • 5.
    © 2014 IBMCorporation5 GitHub Trends
  • 6.
    © 2014 IBMCorporation6 Ratings based on the number of skilled engineers, courses and third party vendors. Tiobe Community Programming Index
  • 7.
    © 2014 IBMCorporation7 modulecounts.com
  • 8.
    © 2014 IBMCorporation8 Average salary and job vacancies (Computer Science Zone) Computer Science Zone Jobs Report
  • 9.
    © 2014 IBMCorporation9 RedMonk Language Rankings 1 JavaScript 2 Java 3 PHP 4 Python 5 C# 5 C++ 5 Ruby 8 CSS 9 C 10 Objective-C 11 Perl 11 Shell 13 R 14 Scala 15 Go 16 Haskell 17 Matlab 17 Swift 19 Clojure 19 Groovy 19 Visual Basic
  • 10.
    © 2014 IBMCorporation10 RedMonk Language Rankings Trends 01/01/2013 01/05/2013 01/09/2013 01/01/2014 01/05/2014 01/09/2014 01/01/2015 01/05/2015 0 2 4 6 8 10 12 14 16 18 20 JavaScript Java PHP Python C# C++ Ruby CSS C Objective-C Perl Shell R Scala Go Haskell Matlab Swift Clojure Groovy Visual Basic
  • 11.
    © 2014 IBMCorporation11 RedMonk Language Rankings Trends 01/01/2013 01/05/2013 01/09/2013 01/01/2014 01/05/2014 01/09/2014 01/01/2015 01/05/2015 0 2 4 6 8 10 12 14 16 18 20 JavaScript Java PHP Python C# C++ Ruby CSS C Objective-C Perl Shell R Scala Go Haskell Matlab Swift Clojure Groovy Visual Basic
  • 12.
    © 2015 IBMCorporation12 #2 Engaging Applications
  • 13.
    © 2015 IBMCorporation13  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… Browser Applications
  • 14.
    © 2015 IBMCorporation14  Java has originally targeted at for creating user applications  Eventually started to migrate to the server: - JPE launched in 1998  Today Java has rich platform support: - Linux x86, Linux POWER, zLinux - Windows, Mac OS, Solaris, AIX, z/OS  JavaScript usage is starting to grow on the server Browser Applications to Server Applications
  • 15.
    © 2015 IBMCorporation15  Single Threaded Event based JavaScript framework – Uses non-blocking asynchronous I/O  Wraps the Chrome V8 JavaScript engine with I/O interfaces – Libuv provides interaction with OS/system  Designed to build scalable network applications – Suited for real time delivery of data to distributed client  Available on a wide set of platforms: - Linux on x86, ARM, Power and Z - Windows, Mac OS, Solaris, SmartOS and AIX libuvV8 Node Bindings Node Standard Library C JavaScript Server Side JavaScript: Node.js
  • 16.
    © 2015 IBMCorporation16 #3 Reactive Programming
  • 17.
    © 2015 IBMCorporation17  Can easily express dynamic data flows  Execution model propagates changes through the model  Typically makes use of asynchronous models to propagate events Reactive Programming “a programming paradigm oriented around data flows and the propagation of change.”
  • 18.
    © 2015 IBMCorporation18  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  Number of concurrent customers determined by number of depot workers  Additional customers wait in a queue with no response Typical approach to I/O
  • 19.
    © 2015 IBMCorporation19  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  Number of concurrent customers determined by how fast the food Server can work  Or until the kitchen gets slammed Asycnhronous Non-Blocking I/O
  • 20.
    © 2015 IBMCorporation20  JavaScript is inherently designed to be asynchronous - eg. onClick and onMouseOver events  This applies easily to server applications as well JavaScript and Asynchronous I/O 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) {});
  • 21.
    © 2015 IBMCorporation21 #4 Cloud Deployments
  • 22.
    © 2015 IBMCorporation22 Cloud “a virtual, dynamic environment which maximizes use, is infinitely scalable, always available and needs minimal upfront investment or commitment” ● Removes infrastructure as a bottleneck to rapid application delivery and expansion ● Provides “compute on tap” ● But taps come with meters and usage charge models
  • 23.
    © 2015 IBMCorporation23 Compute Costs Offering RAM Cost CPUs IBM Bluemix (CF) $24.15 GB/Month 4vCPUs per instance IBM Bluemix (Containers) $  9.94 GB/Month 4vCPUs per GB run.pivotal.io $21.60 GB/Month 4vCPUs per instance Heroku (Hobby) $14.00 GB/Month 1 "CPU share" per 512MB in an instance Heroku (Professional) $50.00 GB/Month 1 "CPU share" per 512MB in an instance Amazon EC2 (SLES) $16.56 GB/Month 1 vCPU per 4GB in an instance.
  • 24.
    © 2015 IBMCorporation24 -Xmx: $$$ Cloud Economics
  • 25.
    © 2015 IBMCorporation25 Cloud Economics Someone will be looking at your leaky app Someone will be looking at your leaky app
  • 26.
    © 2015 IBMCorporation26 Clouds are Polyglot
  • 27.
    © 2015 IBMCorporation27 N-Body Benchmark: Memory Footprints 0 10 20 30 40 50 60 70
  • 28.
    © 2015 IBMCorporation28 N-Body Benchmark: Time to Complete 0 5 10 15 20 25 30 35 40 CompleteTime(s)
  • 29.
    © 2015 IBMCorporation29 N-Body Benchmark: Time to Complete 0 2 4 6 8 10 12 14 16 18 20 CompleteTime/100MB(s)
  • 30.
    © 2015 IBMCorporation30 #5 MicroServices
  • 31.
    © 2015 IBMCorporation31  Services are small and targeted to their task  Services are organized around capabilties  Services are self contained, storing their own data MicroServices “Do one thing, and do it well”
  • 32.
    © 2015 IBMCorporation32  Dynamically typed languages are harder to manage under the hood  They have lower runtime performance for computational tasks Dynamically vs Statically Types Languages -70 -60 -50 -40 -30 -20 -10 0 Dynamic vs Statically Typed Language Performance JSON Single Multi Updates Bestdynamiccomparedtobeststaticasbaseline
  • 33.
    © 2015 IBMCorporation33  Dynamically typed languages are harder to manage under the hood  They have lower runtime performance for computational tasks  They have higher scope for data integrity issues:  Statically typed languages throw error at compile time or runtime Dynamically vs Statically Types Languages -70 -60 -50 -40 -30 -20 -10 0 Dynamic vs Statically Typed Language Performance JSON Single Multi Updates Bestdynamiccomparedtobeststaticasbaseline > 12 + 3 123 // 12 or 3 previously used as text
  • 34.
    © 2015 IBMCorporation34 Choosing the Right Language for the Service Node.js 0 - 4x + 1/3x Node.jsPerformanceRelativetoJava CPU Bound I/O Bound * based on TechEmpower benchmark results regex-dna Spectral-normfannkuch-redux fasta k-nucleotide Binary-trees n-body Reverse-complement Node.jsCodeVolumeRelativetoJava * based on benchmarksgame benchmarks Node.js Application Performance (higher is better) Development Effort (lower is better) ● Node.js has higher performance for I/O Fast async non-blocking framework for scalability ● Node.js allows “fullstack” webapp development End to end JavaScript for server and browser However.... ● Java is much faster at computational logic Node.js performance is non-ideal for transactions - 3x ● Node.js has higher developer productivity Many applications developed with significantly less code ● Rich module system simplifies development Reduces need to develop custom code However... ● Java is strongly typed, ensuring data correctness Node.js type mis-matches can result in incorrect results Node.js fits the presentation tier, offloading to Java* for business transactional logic Avg 1/3rd less code
  • 35.
    © 2015 IBMCorporation35 Service topology for Web Applications Operations and Management Admin Analytics LoadBalancer LoadBalancer HTTP Monitoring ScalingAnalytics Diagnostics
  • 36.
    © 2015 IBMCorporation36 Service topology for Web Applications Operations and Management Admin Analytics LoadBalancer LoadBalancer HTTP Monitoring ScalingAnalytics Diagnostics
  • 37.
    © 2015 IBMCorporation37 Service topology for Web Applications Operations and Management Admin Analytics LoadBalancer LoadBalancer HTTP Monitoring ScalingAnalytics Diagnostics
  • 38.
    © 2015 IBMCorporation38