WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
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 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.
4. 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.“
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.
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
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
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.
13. 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
14. 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
15. 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"]
17. APIs
All data exchange between microservices must be through API layer
• No accessing datastores across microservices
Synchronous
Asynchrnous
Streaming
Event-driven
REST
Messaging
19. 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.
20. 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