Top Banner
Java App Servers are Dead! Eberhard Wolff Freelancer Head Technology Advisory Board adesso http://ewolff.com
63

Java Application Servers Are Dead!

Sep 08, 2014

Download

Technology

Eberhard Wolff

Java Application Server have long dominated the middleware market. This presentations show the weaknesses of them and some alternatives.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Java Application Servers Are Dead!

Java App Servers are

Dead! Eberhard Wolff

Freelancer Head Technology Advisory Board adesso

http://ewolff.com

Page 2: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Code

Page 3: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

2003

Page 4: Java Application Servers Are Dead!

App Server = Java EE or

Servlet Container

Page 5: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

An Application on a server needs an

Application Server!

Page 6: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Why??

The Price We Pay

What now?

Page 7: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

App Server... •  …container for multiple applications

•  ... infrastructure

•  …deployment

•  …monitoring

Page 8: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

App Server... •  …container for multiple applications

•  ... infrastructure

•  …deployment

•  …monitoring

Page 9: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Multiple Applications

•  Isolation •  ClassLoader •  Can lead to non-trivial problems

App Server App 1 App 2 App 3 App 4

Page 10: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Isolation •  ClassLoader is not enough •  CPU? •  Memory? •  Filesystems? •  Applications are not isolated •  Even individual parts are not isolated •  i.e. JMS might eat away resources

from web requests

Page 11: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Isolation is Impossible •  Operating systems isolate processes

from each other •  CPU, memory … •  Resource allocation: #1 feature for

operating systems •  Either the JVM becomes an

operating systems •  …or isolation won’t be perfect

Page 12: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Multiple Applications

•  Is that really what happens? •  Java EE spec talks about

“components” •  not Apps

App Server App 1 App 2 App 3 App 4

Page 13: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

One Application

App Server App 1 App 2 App 3 App 4

Page 14: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

One Application

App Server •  Component e.g. WAR, EJB JAR … •  Different ClassLoader isolation

needed •  OSGi like •  Memory/CPU isolation still missing

Component 1 Component 2 App

Page 15: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

What It Is More Like…

App Server App 1

App Server App 1

App Server App 1

App Server App 1

App Server App 1

App Server App 1

Cluster

Page 16: Java Application Servers Are Dead!

App Server: container for

one application

Page 17: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

App Server... •  …container for multiple applications

•  ... infrastructure

•  …deployment

•  …monitoring

Page 18: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

App Server... •  …container for multiple applications

•  ... infrastructure

•  …deployment

•  …monitoring

Page 19: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Infrastructure •  Two Phase Commit

•  Net / Threads

•  APIs

Page 20: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Infrastructure: Two Phase Commit

•  Idea: Coordinate multiple transactional resources

•  A talk in its own right •  2 DBs: Consider a different

architecture •  DB + JMS: Tx Synchronization

might help •  http://bit.ly/JMS-2PC

Page 21: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Infrastructure: Two Phase Commit

•  Slows down the good case in favor of the bad case

•  No 100% - 2PC can fail •  Of limited use in distributed

systems •  E.g. REST + 2PC? •  NoSQL + 2PC? •  Limits scalability

Page 22: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Infrastructure: Net / Threads •  Support i.e. for HTTP and thread

pooling

•  Connection pooling

•  Can be done inside the application •  Embedded servers (Tomcat, Jetty)

Page 23: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Infrastructure: APIs •  EJB, CDI, JPA, JSF... •  Version tied to App Server version •  App depends on Application Server •  New APIs can’t be used until new

App Server in production •  Version conflicts might arise

Page 24: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Infrastructure: APIs •  Usually not every need covered •  …so additional libraries are used •  App Server APIs can be replaced by

libraries •  Makes application more portable

Page 25: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Infrastructure: Application independent?

•  Each application has its own infrastructure

•  E.g. database connections •  + specific configuration •  Might even add its own libraries to

the AppServer •  Big no-no if the App Server should

be application independent

Page 26: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

DependenciesApp Server / Application

App Server

Application

Libraries Infrastructure

Specific configuration

Cyclic dependency i.e. one component

Page 27: Java Application Servers Are Dead!

Application Serversare just

another part of the Application

Page 28: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

You Don‘t Agree? •  Can you deploy your application on a different server? •  On a different version of the same server? •  Without modifications to the server? •  Do you deploy other applications on the App Server? •  Could you? •  Is the application server or an installation script in your version control?

Page 29: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Application Server: Just One Kind of Infrastructure

•  App Server focus on interactive (web) applications

•  Other types of application: •  Batches •  Integration •  Map / Reduce •  App Servers are no universal

infrastructure

Page 30: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

App Server... •  …container for multiple applications

•  ... infrastructure

•  …deployment

•  …monitoring

Page 31: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

App Server... •  …container for multiple applications

•  ... infrastructure

•  …deployment

•  …monitoring

Page 32: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Deployment •  Deployment Format: WAR, EAR, JAR... •  No way to define dependencies outside

Application •  i.e. App Server version, database etc •  Operations usually work with deb, RPM… •  Completely different tool chain •  Also: Usually Unix services to start

applications

Page 33: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

App Server... •  …container for multiple applications

•  ... infrastructure

•  …deployment

•  …monitoring

Page 34: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

App Server... •  …container for multiple applications

•  ... infrastructure

•  …deployment

•  …monitoring

Page 35: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Monitoring •  Provided by JMX •  Can be integrated in SMNP etc J •  New tools arise •  Logs + Logstash / Kibana or Splunk •  REST based monitoring resources •  Scripts for monitoring

Page 36: Java Application Servers Are Dead!

App Server are needed for

monitoring & deployment

Page 37: Java Application Servers Are Dead!

App Server come with their own

Ops Tool Set

Page 38: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

App Server... •  …container for multiple applications

•  ... provide infrastructure

•  …support deployment

•  …support monitoring

1 App per server ..or per cluster

App Server part of the application

Deployment & monitoring OK but different tools

Page 39: Java Application Servers Are Dead!

The Price We Pay

Page 40: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Slower Turn Around •  Code •  Package a WAR •  Install it •  Have it unpacked •  Test

•  Solutions: JRebel, Spring Loaded •  But: Why is it done at all??

Why??

Page 41: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

App Server: Complex Deployment

•  Deployment: not just an application •  But also an Application Server •  App Server configuration more

complex than Application configuration

•  Look at automation scripts with Puppet / Chef etc

Page 42: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Cyclic Dependency Application – App Server

•  Application and App Server must fit each other

•  Configuration must be compatible •  For each developer and each testing

stage •  Old configuration e.g. for bug fixes •  Hard to get right

Page 43: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Deployment Is Important •  Continuous Delivery means a lot

more deployment •  Must optimize deployment

Commit

Acceptance Tests

Capacity Tests

Explorative Tests

Production

Many times per day

Page 44: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Continuous Delivery •  Applications deployed more

frequently •  …in many different stages •  Simple deployment even more

important •  App Servers become bigger headache

Page 45: Java Application Servers Are Dead!

Continuous Delivery increases

demand for simple

infrastructure.

Page 46: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Different Ops Mindset •  App Server administrator? •  Deployment, monitoring etc. have

been solved already! •  Package manager •  Ops Monitoring •  Why not stick to general solutions?

Page 47: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

DevOps •  DevOps and Continuous Delivery:

focus on “normal” tools and approaches

•  Dev will see more than only Java Apps and App Servers

•  Need different tools

Page 48: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Micro Services •  Build software composed of services •  Service has business meaning •  i.e. Order, Catalog etc •  Services (re)deployed

independently •  …instead of deployment monolith •  …and communicate e.g. via REST

Page 49: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Micro Services: eCommerce

Catalog

Order Processing

Customer

Recommendation

Page 50: Java Application Servers Are Dead!

Install and configure App Server for each Microservice??

Page 51: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Micro Services •  Service might have different non-functional

requirements •  So different infrastructure might be needed •  E.g. asynchronous applications •  Traditional Servlets •  Batches •  Map / reduce •  …. •  App Server just provide one kind of

infrastructure

Page 52: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

The Price We Pay

App Server

Slow Turn Around

Standard OPs Tools

Continuous Delivery

Micro Services

App Server specific OPs tools

Deployment complex

One infrastructure doesn’t fit all

One App Server per Micro Service? Smaller

deployment units

Page 53: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

RIP Application Server!

Page 54: Java Application Servers Are Dead!

What now??

Page 55: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

The Re-Rise of the Applications

•  Create a JAR files •  …that contains a main class •  Custom infrastructure •  E.g. HTTP server •  Or Batch •  …

Page 56: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Monitoring & Deployment •  Rely on standard Ops deployment

and monitoring tools

•  REST based monitoring URLs

•  Evaluate log files

Page 57: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Application: Benefit •  Easier to Deploy: Just a JAR •  + command line •  + config file •  Debug & run in IDE •  Acceptance tests etc much easier •  Ensured: Infrastructure compatible

with application

Page 58: Java Application Servers Are Dead!

Spring BootActuator &

CRaSH Demo

Page 59: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Deploy Demo •  mvn package

•  Show java –jar with JAR

Page 60: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Actuator Demo •  Open

http://localhost:8080/monitor.html

•  Show metrics / trace •  Show info and

application.properties

Page 61: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Demo CRaSH •  ssh -p 2000 user@localhost •  Password in log output •  help •  Mention jpa / jdbc / problems •  thread top CTRL-C •  metrics •  dashboard

Page 62: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Technologies •  Spring Boot •  see my talk on Wednesday

•  Dropwizard by Yammer

•  Vert.x •  see Tim Fox’s talk this evening

•  Play Framework

Page 63: Java Application Servers Are Dead!

Eberhard Wolff - @ewolff

Thank You!!

[email protected] @ewolff