java ee, microservices, apis and migration to the...
TRANSCRIPT
Java EE, Microservices, APIs and Migration to the Cloud Prof. dr. Matjaž B. Jurič Java Champion, IBM Champion, Oracle ACE Director
2
Microservices
3
Microservice Architecture
An architectural approach, that emphasizes the
decomposition of applications into single-purpose,
loosely coupled services managed by cross-functional
teams, for delivering and maintaining complex software
systems with the velocity and quality required by today’s
digital business
Traditional multi-tier architecture
Web front-end (such as HTML5/JS/AngularJS or React)
Product Catalog Shopping Cart
Purchase Payment
Delivery
DBMS
5
Traditional Java multi-tier architecture
Java EE applications packaged as WAR/EAR
Deployed on the application server
Monolithic approach
Problems:
Scaling
Updates require redeployment
To upgrade Java SE/EE or app server to a newer version requires
that all applications on the app server are upgraded at once.
Microservice Approach
Web front-end (such as HTML5/JS/AngularJS or React)
Product Catalog Shopping Cart
Purchase Payment
Delivery
DBMS
7
Advantages
Flexible architecture, easier development
Enables and fosters service reuse
Reuse of services, not source-code
Each microservice can be developed independently
Independent life-cycle
Easier upgrades
Only specific microservice needs to be upgraded, not the whole
application
Easier upgrades on new technologies/versions
More efficient scaling
8
Microservice Principles
Single Responsibility
Do one thing (but do it well).
Explicitly published interfaces
Integrated in a loosely-coupled way
Synchronous or asynchronous?
Circuit-breaker
Designed for failure
Fault tolerance is a requirement, not a feature
9
Deployment, Execution, Versioning, Scaling
Each microservices is deployed separately
Each microservices executes in its own process / virtual
machine / container
Each microservices can have multiple versions deployed
All versions executing side-by-side.
Microservices are scaled horizontally and independently.
Microservices
Applications Modularity (development-time)
Service orientation Microservices
11
Disadvantages
Deployment becomes more complex
Many „small“ microservices, dependencies, etc.
Automation is mandatory
DevOps – Continuous Integration, Continuous Deployment,
Automated Testing
Testing, logging, monitoring require new tools with support
for microservices
In Java EE – problem of fat application server
12
Java EE Approach to Microservices
Serverless Java EE
Package and deploy Java EE application into „fat“ JARs
Execute them on Java SE runtime
No need for Java EE application server
KumuluzEE
Microservice framework for Java EE standard API-s
Spring Boot
Microservice framework for Spring
13
Java EE Approach to Microservices
„Slim“ app server
App server is reduced to those technologies that your microservice
uses
WildFly Swarm
Payara Micro
14
Microprofile.io
MicroProfile is a baseline platform definition that optimizes
Enterprise Java for a microservices architecture
It delivers application portability across multiple
MicroProfile runtimes
The initially planned baseline is JAX-RS + CDI + JSON-P
16
KumuluzEE (open source)
Produces standalone microservices following the Twelve-
Factor principles
Microservices packaged as self-contained JARs
JAR includes the run-time for selected technologies
No application server required
Very efficient in terms of size and startup/shutdown time
Small footprint JARs
Ideal for Docker containers and other PaaS environments
Run-time can be freely selected
Servlet – Jetty, Tomcat, Grizzly, Undertow, etc.
17
DEMO
18
Where to deploy microservices
All microservices in a single VM (virtual machine)?
Each microservice in its own VM?
Each microservice on several VMs?
Use Docker containers instead of traditional VMs
19
Traditional VMs vs Docker
Traditional VMs Docker Containers
20
Comparison
Traditional
VM Docker Δ
Start-up 50 s 100 ms 500x
Shut-down 5 s 50 ms 100x
21
Docker and the Cloud
Docker containers are supported by the majority of Cloud
providers
Public and private clouds
Docker also supported on Windows Server 2016
Use Docker containers with container orchestration tools
Kubernetes
Docker Swarm, Mesos, etc.
22
Bottom-line
Microservices +
+ Docker containers =
= Perfect Fit
23
API
Application Programming Interfaces
Web front-end (such as HTML5/JS/AngularJS or React)
Product Catalog Shopping Cart
Purchase Payment
Delivery
DBMS
API API
API API
API
Web front-end (such as HTML5/JS/AngularJS or React)
API Gateway API Management Service/API Discovery
Product Catalog Shopping Cart
Purchase Payment
Delivery
API API
API API
API
26
APIs
27
Bottom-line
Microservices +
+ Docker containers +
APIs
= Architecture for the Cloud
29
Useful resources
KumuluzEE - http://ee.kumuluz.com/
Java Magazine - http://www.javamagazine.mozaicreader.com/JanFeb2016#&pageSet=
80&page=0&contentItem=0
Microprofile.io - http://microprofile.io/
E-mail: [email protected]
www.kumuluz.com
www.sunesis.si
THANK YOU!
Thank you!