Prof. dr. Matjaž B. Jurič, UL FRI and Kumuluz Project
Cloud-native Architectures
and Java
Software is How Companies Differentiate Themselves
 More and more major businesses and industries are being run on
software and delivered as online services.
 Many of the winners are Silicon Valley-style entrepreneurial
technology companies that are invading and overturning established
industry structures.
Digital Business
 Digitalization (digital transformation) is about delivering business
innovation through software.
Software is becoming the KEY differentiator
 „In the past 90% of the car value was in hardware. We expect 50% of
value will be in hardware and the other 50% in software.“
Gartner Forecast
75%
By 2020, 75 percent of
application purchases
supporting digital business
will be build, not buy.
Forecast Analysis: Enterprise Application
Software, Worldwide, 2Q15 Update.
The Challenge
How to build software
Faster
Resilient
Scalable
Engaging
Cloud Native Architecture
Cloud Native Architecture
Cloud native architecture is
about how software is build,
not where it runs
Microservices
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
Microservice Principles
 Single Responsibility
• Do one thing (but do it well).
 Explicitly published interfaces
 Integrated in a loosely-coupled way
• Synchronous or asynchronous?
• Circuit-breakers
 Designed for failure
• Fault tolerance is a requirement, not a feature
Deployment, Execution, Versioning, Scaling
 Each microservice is deployed separately
 Each microservice executes in its own process / virtual machine /
container
 Each microservice can have multiple versions deployed
• All versions executing side-by-side.
 Microservices are scaled horizontally and independently.
Microservice Frameworks for Java
 SpringBoot / SpringCloud
 WildFly Swarm
 KumuluzEE
 Dropwizard
 Payara Micro
 Microprofile.io
Containers
 Helpful to microservices
• But not a requirement
 Containers are lightweight
• Just like microservices themselves
 Higher density
 Easy to start/stop
 Portability
 Run ONE instance per container
 Expose ONE port per container
 Isn’t a Container Just Like a VM Image? NO
Hardware
Operating System
Container 1
App
Container 2
App
Containers
Artifacts Are Now Immutable Containers
 Not EARs, WARs – Containers!
 No more installing a JVM, app server, deploying the artifacts to them
 Build the container once, deploy it anywhere. Can include complex
environment variables, scripts, etc.
 Containers should be free of state and configuration
 Containers should not assume they are able to write to a persistent
local file system
Declaratively Build Containers Using Dockerfiles
FROM centos:centos6
# Enable Extra Packages for Enterprise Linux (EPEL) for CentOS
RUN yum install -y epel-release
# Install Node.js and npm
RUN yum install -y nodejs npm
# Install app dependencies
COPY package.json /src/package.json
RUN cd /src; npm install
# Bundle app source
COPY . /src
EXPOSE 8080
CMD ["node", "/src/index.js"]
Building Blocks
Service
Discovery
Microservice
Microservice
Microservice
Microservice
Microservice
Client
Client
Client
Client
Queue
AMQP
Microservice
Microservice
Microservice
API
Gateway
API
Gateway
Configuration
Server
Identity and
Access
Management
Logging
APIs
 All data exchange between microservices must be through API layer
• No accessing datastores across microservices
 Synchronous
 Asynchrnous
 Streaming
 Event-driven
 REST
 Messaging
APIs
 Adopt advanced REST concepts
• Versioning, Links, Paging, Querying, Filtering, Ordering, Etc
 API specification
• OpenAPI / Swagger
• JSON Schema
 Stateless
 Api Management
API Gateway
 Builds a JSON response for each type of client – web,
mobile, etc.
 Asynchronously calls each of the N microservices required
to build a response
 Handles security and hides back-end
 Load balances
 Meters APIs
• Rate-limiting
 Logs centrally
 Etc.
Circuit-Breakers
 Circuit breakers prevent cascading failures
• Prevent remote calls when a dependency is determined to be
unhealthy
 Cascading failures happen when request-handling threads are
waiting on a response from a remote system
 Rule #1 of microservices – avoid coupling!
 Hystrix
 @EnableCircuitBreaker Microservice
Microservice
Principles
Twelve-Factor Applications
Codebase, Dependencies, Config, Backing services, Build,
release, run, Processes, Port binding, Concurrency,
Disposability, Dev/prod parity, Logs, Admin processes
Cultural Change
From Silos to DevOps
The five stages of Cloud Native
1. DENIAL
2. ANGER
3. BARGAING
4. DEPRESSION
5. ACCEPTANCE
e-naslov: http://www.cloud.si
e-naslov: http://www.kumuluz.com
e-pošta: info@cloud.si
HVALA!

Javantura v4 - Cloud-native Architectures and Java - Matjaž B. Jurič

  • 1.
    Prof. dr. MatjažB. Jurič, UL FRI and Kumuluz Project Cloud-native Architectures and Java
  • 2.
    Software is HowCompanies Differentiate Themselves  More and more major businesses and industries are being run on software and delivered as online services.  Many of the winners are Silicon Valley-style entrepreneurial technology companies that are invading and overturning established industry structures.
  • 3.
    Digital Business  Digitalization(digital transformation) is about delivering business innovation through software.
  • 4.
    Software is becomingthe KEY differentiator  „In the past 90% of the car value was in hardware. We expect 50% of value will be in hardware and the other 50% in software.“
  • 5.
    Gartner Forecast 75% By 2020,75 percent of application purchases supporting digital business will be build, not buy. Forecast Analysis: Enterprise Application Software, Worldwide, 2Q15 Update.
  • 6.
    The Challenge How tobuild software Faster Resilient Scalable Engaging
  • 7.
  • 8.
    Cloud Native Architecture Cloudnative architecture is about how software is build, not where it runs
  • 9.
    Microservices 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
  • 10.
    Microservice Principles  SingleResponsibility • Do one thing (but do it well).  Explicitly published interfaces  Integrated in a loosely-coupled way • Synchronous or asynchronous? • Circuit-breakers  Designed for failure • Fault tolerance is a requirement, not a feature
  • 11.
    Deployment, Execution, Versioning,Scaling  Each microservice is deployed separately  Each microservice executes in its own process / virtual machine / container  Each microservice can have multiple versions deployed • All versions executing side-by-side.  Microservices are scaled horizontally and independently.
  • 12.
    Microservice Frameworks forJava  SpringBoot / SpringCloud  WildFly Swarm  KumuluzEE  Dropwizard  Payara Micro  Microprofile.io
  • 13.
    Containers  Helpful tomicroservices • But not a requirement  Containers are lightweight • Just like microservices themselves  Higher density  Easy to start/stop  Portability  Run ONE instance per container  Expose ONE port per container  Isn’t a Container Just Like a VM Image? NO Hardware Operating System Container 1 App Container 2 App Containers
  • 14.
    Artifacts Are NowImmutable Containers  Not EARs, WARs – Containers!  No more installing a JVM, app server, deploying the artifacts to them  Build the container once, deploy it anywhere. Can include complex environment variables, scripts, etc.  Containers should be free of state and configuration  Containers should not assume they are able to write to a persistent local file system
  • 15.
    Declaratively Build ContainersUsing Dockerfiles FROM centos:centos6 # Enable Extra Packages for Enterprise Linux (EPEL) for CentOS RUN yum install -y epel-release # Install Node.js and npm RUN yum install -y nodejs npm # Install app dependencies COPY package.json /src/package.json RUN cd /src; npm install # Bundle app source COPY . /src EXPOSE 8080 CMD ["node", "/src/index.js"]
  • 16.
  • 17.
    APIs  All dataexchange between microservices must be through API layer • No accessing datastores across microservices  Synchronous  Asynchrnous  Streaming  Event-driven  REST  Messaging
  • 18.
    APIs  Adopt advancedREST concepts • Versioning, Links, Paging, Querying, Filtering, Ordering, Etc  API specification • OpenAPI / Swagger • JSON Schema  Stateless  Api Management
  • 19.
    API Gateway  Buildsa JSON response for each type of client – web, mobile, etc.  Asynchronously calls each of the N microservices required to build a response  Handles security and hides back-end  Load balances  Meters APIs • Rate-limiting  Logs centrally  Etc.
  • 20.
    Circuit-Breakers  Circuit breakersprevent cascading failures • Prevent remote calls when a dependency is determined to be unhealthy  Cascading failures happen when request-handling threads are waiting on a response from a remote system  Rule #1 of microservices – avoid coupling!  Hystrix  @EnableCircuitBreaker Microservice Microservice
  • 21.
    Principles Twelve-Factor Applications Codebase, Dependencies,Config, Backing services, Build, release, run, Processes, Port binding, Concurrency, Disposability, Dev/prod parity, Logs, Admin processes
  • 22.
  • 23.
    The five stagesof Cloud Native 1. DENIAL 2. ANGER 3. BARGAING 4. DEPRESSION 5. ACCEPTANCE
  • 24.