SlideShare a Scribd company logo
© 2016 Pivotal Software, Inc. All rights reserved.
@kennybastani
Building Cloud Native Architectures with
Spring
Kenny Bastani
Spring Developer Advocate


Pivotal Cloud Native Roadshow 2016
1
Kenny Bastani
@kennybastani
Spring Developer Advocate
Agenda
Agenda
1 Microservices & Cloud Native
2 Reference Architecture
3 Spring Boot
4 Spring Cloud
5 Dealing with Legacy
© 2016 Pivotal Software, Inc. All rights reserved.
@kennybastani
Microservices
How did we get there?
4
We started with the monolith…
© 2016 Pivotal Software, Inc. All rights reserved.
@kennybastani
Cultural problems with monoliths
6
Slows our velocity getting into production
It takes too long to ramp up new engineers
The code base is just too large for anyone
one person to fully comprehend
Centralized authority and change
management slows progress (DBA, Ops)
© 2016 Pivotal Software, Inc. All rights reserved.
@kennybastani
Operational problems with monoliths
7
Coordinated releases batch many changes
together from different teams
Operations drives the runtime environment
of applications
Operators take on all operational
responsibility (including VM upgrades)
Deploy everything at once or nothing at all
We then moved towards SOA…
@kennybastani
We have now arrived at microservices…
Each team provisions self-service infrastructure, like a database, and builds a single application

Centralized resources are provided as backing services that are shared for data consistency, caching
© 2016 Pivotal Software, Inc. All rights reserved.
@kennybastani
Online Store Example
Cloud native application as microservices
10
@kennybastani
Building Cloud Native Architectures with Spring
Building Cloud Native Architectures with Spring
Building Cloud Native Architectures with Spring
Building Cloud Native Architectures with Spring
Building Cloud Native Architectures with Spring
Open Source Example
http://online-store-web.cfapps.io
https://github.com/kbastani/spring-cloud-event-sourcing-example
Demo Username: user
Password: password
© 2016 Pivotal Software, Inc. All rights reserved.
@kennybastani
Eventual consistency
Handling the guarantees of an eventually
consistent microservices architecture
18
Eventual consistency
Microservice architectures provide no guarantees about the correctness
of your data
So how can we guarantee high availability while also guaranteeing data
consistency?
Transaction logs
Event Sourcing
Aggregates can be used to generate the consistent state of any object
It provides an audit trail that can be replayed to generate the state of an object from
any point in time
It provides the many inputs necessary for analyzing data using event stream
processing
It enables the use of compensating transactions to rollback events leading to an
inconsistent application state
It also avoids complex synchronization between microservices, paving the way for
asynchronous non-blocking operations between microservices
Event Types
Event Log
Event logs are transaction logs
Use event sourcing in your microservices to ensure consistency of your
distributed system
Don’t store state with microservices, store events
Use event stream processing to observe the active usage of your cloud
native application in real-time
© 2016 Pivotal Software, Inc. All rights reserved.
@kennybastani
The Cloud Native Stack
What are the components of a cloud-native
architecture?
25
What is a cloud-native application?
The cloud provides resources
The platform provides services
The application provides value
Building Cloud Native Architectures with Spring
Platform
Services
What is a cloud service?
The platform provides services
The developer provisions services
The application uses services
Microservices != Cloud Native
Microservices are an architectural practice
Cloud native is a style of application development
Monoliths can equally be cloud native apps
Monolith to Microservice
Splitting the Monolith: User Service Migration
© 2016 Pivotal Software, Inc. All rights reserved.
@kennybastani
Spring Boot
A JVM micro-framework for building microservices
33
What is Spring Boot?
@kennybastani
spring boot
Spring Initializr for boostraping your applications
supports rapid development of
production-ready applications
and services
© 2016 Pivotal Software, Inc. All rights reserved.
@kennybastani
Cloud Native Platforms
Shipping applications in containers instead of
shared application servers
36
@kennybastani
Application Server Deployment: Monolith
Load balancing requires provisioning
of new VMs and app server
installations
Poor resource isolation; memory
leaks can cause other applications to
become unavailable
Runtime environment is driven by the
operator
Virtual Machine

App
Linux Kernel
App App
Hardware Infrastructure
@kennybastani
Linux Container Deployment: Microservices
Development team drives the
application runtime of a container
Containers are resource isolated,
allowing efficient scheduling onto a
grid of VMs
Containers take seconds to start,
VMs take minutesVirtual Machine

Container
Linux Kernel
App App
App App
Container
App App
App App
Container
App App
App App
Hardware Infrastructure
@kennybastani
Microservices: Container Deployment
Each microservice can be containerized with their application dependencies
Containers get scheduled on virtual machines with an allotted resource policy
@kennybastani
Container scheduling and auto-scaling
Minutes to provision and start a VM, but seconds to schedule and start a container
Auto-scaling becomes a feature of the cloud platform by scheduling on pool of VMs
@kennybastani
Distributed Applications
Each microservice will likely need to communicate with other containers
Service discovery automates how distributed apps find service dependencies
© 2016 Pivotal Software, Inc. All rights reserved.
@kennybastani
Spring Cloud
A toolset designed for building distributed
systems
42
@kennybastani
What is Spring Cloud?
Spring Cloud provides a way to turn Spring Boot microservices into distributed applications
@kennybastani
spring cloud
Apache Zookeeper
these logos are all trademark/copyright their respective owners (T-B, L-R): 



Netflix, amazon.com, Apache Software Foundation, Cloud Foundry, Hashicorp
they are ALL great organizations and we love their open-source and their APIs!!
*
© 2016 Pivotal Software, Inc. All rights reserved.
@kennybastani
Spring Cloud Demos
Applying the patterns of cloud-native architectures
with Spring Boot and Spring Cloud
45
@kennybastani
Spring Cloud: Cloud Native Patterns
Service Discovery
API Gateway
Config Server
Circuit Breakers
Distributed Tracing
Service Discovery
Allows applications to find each other in an environment
An essential component when using dynamic container scheduling
Each application handles its own routing
Developers only need the name of a dependency, not the URL
A service registry is distributed to all subscriber applications
Discovery Service
Service Registry
@kennybastani
Client-side Load Balancing
• Create discovery service
• Register user service
• Register user client
• Scale user service
• Reverse proxy from user client
to user service
User

Service
User

Service
User

Client
@kennybastani
Client-side Load Balancing
• Create discovery service
• Register user service
• Register user client
• Scale user service
• Reverse proxy from user client
to user service
User

Service
User

Service
User

Client
@kennybastani
Client-side Load Balancing
• Create discovery service
• Register user service
• Register user client
• Scale user service
• Reverse proxy from user client
to user service
User

Service
User

Service
User

Client
@kennybastani
Client-side Load Balancing
• Create discovery service
• Register user service
• Register user client
• Scale user service
• Reverse proxy from user client
to user service
User

Service
User

Service
User

Client
Building Cloud Native Architectures with Spring
Building Cloud Native Architectures with Spring
© 2016 Pivotal Software, Inc. All rights reserved.
@kennybastani
Config Server
Centralizing config management for microservices with
Spring Cloud Config Server
56
Config Server
Allows applications to source configuration from central service
Application configuration can be changed without deployment
Cascading configuration files for all apps and individual apps
Uses Git repository as file system, providing audit log of changes
Add Spring Cloud Bus to automate config refresh for many instances
Configuration Server
Building Cloud Native Architectures with Spring
© 2016 Pivotal Software, Inc. All rights reserved.
@kennybastani
API Gateway
Building edge services that route requests to
backend microservices
60
Building Cloud Native Architectures with Spring
Building Cloud Native Architectures with Spring
Edge Service
API gateway pattern using Spring Cloud Netflix Zuul starter project
Embeds relative routes from other services registered with Eureka
Automatic method for reverse proxying to other services
Routes are displayed at /routes of the Spring Boot app
Benefits
Provides a secure gateway to compose together REST APIs
exposed by backend microservices
Front-end developers can integrate with a single API over HTTP to
communicate with potentially many microservices
Front-end applications can further embed an edge service to avoid
the need to manage CORS and authentication concerns
Building Cloud Native Architectures with Spring
© 2016 Pivotal Software, Inc. All rights reserved.
@kennybastani
Distributed Tracing
Tracing the Online Store
66
Spring Cloud Sleuth
Spring Cloud Sleuth is a project that adds distributed tracing
capabilities to your distributed Spring Boot applications
https://cloud.spring.io/spring-cloud-sleuth/
http://zipkin.io/
Zipkin Dashboard
Building Cloud Native Architectures with Spring
© 2016 Pivotal Software, Inc. All rights reserved.
@kennybastani
Strangling Legacy with Microservices
How do I build microservices that are cloud-native without
doing a big bang refactor?
70
Going Cloud Native
Legacy migration challenges

“How do I change the engine of the aircraft while it’s still in flight?”
Approaches

Lift-and-shift
Big bang refactor and migration
Iterative legacy modernization
Problems with lift-and-shift
Brings your tech debt into the cloud
Rolling maintenance windows until migration is complete
Strangler Pattern
“Gradually create a new system around the edges
of the old, letting it grow slowly over several years
until the old system is strangled.”
— Martin Fowler
Strangler vines—seed in the upper branches of a fig tree and gradually work their
way down to the soil—strangling and eventually and killing the tree
Strangling legacy using microservices
How can we take advantage of building microservices that also
strangle data from the edge of legacy systems?
The problem with data
The most common pain point that companies experience when
building microservices is handling domain data
Your domain data is likely going to be trapped inside a large
shared database—probably being of the Oracle or IBM variety
Because of this, your new microservices will be dependent on
retrieving data from a large shared database
Fetching data from the legacy system
Microservices can reach into the legacy system and fetch data
in the same way that front-end applications do
While this isn’t a good long-term strategy, it can be an
intermediate step in gaining control over the legacy backend
Extending Domain Data
Agile benefits of extending domain data
We gain the benefit of agility in microservices by extending base
domain objects retrieved from a legacy system
New feature changes are moved out to the new microservice,
using an indirection layer to maintain backward compatibility
with the legacy system
Legacy Indirection Layer
Advantages
The legacy system does not need to be altered to support the
development of new microservices
New features can be deployed independently without being
tightly coupled to the legacy system
It ensures that any existing calls to a legacy web service are
unaltered for other apps
Disadvantages
Scalability may be a concern in the case that the base legacy
service is not cloud-native
Availability will be impacted if the base legacy service’s shared
database suffers an outage
The dependency on the legacy system’s shared database is
increased, making it harder to decompose
Point-to-point Connections
Point-to-point Connections
If your architecture has brittle point-to-point connections, code
changes may be required to create a legacy indirection layer

If you’re building microservices on top of an SOA and are using an
ESB, an indirection layer already exists
Centralized ESB
ESB Indirection Layer
Data Acquisition
We can use the Legacy Edge service to adapt responses from
microservices into the native formats expected by legacy
applications
We can also acquire data from the legacy system and migrate
the system of record to a microservice, without refactoring the
current database
© 2016 Pivotal Software, Inc. All rights reserved.
@kennybastani
Reference application
Open source example of strangling legacy
88
Building Cloud Native Architectures with Spring
Building Cloud Native Architectures with Spring
Building Cloud Native Architectures with Spring
Building Cloud Native Architectures with Spring
Let’s talk about theory and practice
The first law of microservices.
It depends.
In the end..
Do what makes sense for your architecture
Worry deeply about who cleans up after you
Building software is more about people than it is tools
Full open source examples on my blog
http://www.kennybastani.com
Wrapping up…
Cloud native applications
“If you have to implement the same functionality in each
application, it should instead be provided as a service using the
platform” – Matt Curry @ Allstate
Do this well, and the only thing you’ll be left with is the valuable
business logic in your applications
The two road blocks of cloud native
Legacy culture
Legacy culture
Before you can even begin to address the handling of legacy in a
new microservice architecture, you’ll need to address a legacy
culture
Some developers may believe a piece of legacy code is beautiful,
and has done its job without change for many years
Handling the culture shift is a delicate matter. Get people on
board before imposing changes
Legacy applications
This is what dropping a legacy application in a Docker
container and calling it a microservice looks like..
Legacy applications
Not all legacy needs to be destroyed right away
Make sure to take an iterative approach to go cloud-native that
promises backwards compatibility with legacy applications
The goal is to lessen the impact to users over time before making
a decision to phase out legacy applications and infrastructure
Developers dream of strangling legacy, but it likely still generates
revenue for the business
© 2016 Pivotal Software, Inc. All rights reserved.
@kennybastani
Thank you.
Reach out if you have any questions!
105

More Related Content

What's hot (20)

PDF
CNCF Meetup - OpenShift Overview
Sumit Shatwara
 
PPTX
API Governance in the Enterprise
Apigee | Google Cloud
 
PPTX
OpenShift Introduction
Red Hat Developers
 
PPSX
Service Mesh - Observability
Araf Karsh Hamid
 
PDF
API Security Best Practices & Guidelines
Prabath Siriwardena
 
PDF
Apigee Demo: API Platform Overview
Apigee | Google Cloud
 
PPTX
FIDO Workshop-Demo Breakdown.pptx
FIDO Alliance
 
PDF
“How to Secure Your Applications With a Keycloak?
GlobalLogic Ukraine
 
PDF
AWS VPC Flow logs
Knoldus Inc.
 
PDF
20명 규모의 팀에서 Vault 사용하기
Doyoon Kim
 
PDF
[AWS Dev Day] 앱 현대화 | DevOps 개발자가 되기 위한 쿠버네티스 핵심 활용 예제 알아보기 - 정영준 AWS 솔루션즈 아키...
Amazon Web Services Korea
 
PDF
OpenShift Overview
roundman
 
PPT
The eBay Architecture: Striking a Balance between Site Stability, Feature Ve...
Randy Shoup
 
PDF
AWS CDK를 활용한 게임 데이터 파이프라인 구축 방안 [레벨 200] - 발표자: Douglas Lima, 데브옵스 컨설턴트, AWS ...
Amazon Web Services Korea
 
PPTX
Apigee Edge Product Demo
Apigee | Google Cloud
 
PDF
The Complete Guide to Service Mesh
Aspen Mesh
 
PDF
쿠알못이 Amazon EKS로 안정적인 서비스 운영하기 - 최용호(넥슨코리아) :: AWS Community Day 2020
AWSKRUG - AWS한국사용자모임
 
PDF
API Gateway How-To: The Many Ways to Apply the Gateway Pattern
VMware Tanzu
 
PDF
kubernetes, pourquoi et comment
Jean-Baptiste Claramonte
 
PDF
Introduction to docker
Instruqt
 
CNCF Meetup - OpenShift Overview
Sumit Shatwara
 
API Governance in the Enterprise
Apigee | Google Cloud
 
OpenShift Introduction
Red Hat Developers
 
Service Mesh - Observability
Araf Karsh Hamid
 
API Security Best Practices & Guidelines
Prabath Siriwardena
 
Apigee Demo: API Platform Overview
Apigee | Google Cloud
 
FIDO Workshop-Demo Breakdown.pptx
FIDO Alliance
 
“How to Secure Your Applications With a Keycloak?
GlobalLogic Ukraine
 
AWS VPC Flow logs
Knoldus Inc.
 
20명 규모의 팀에서 Vault 사용하기
Doyoon Kim
 
[AWS Dev Day] 앱 현대화 | DevOps 개발자가 되기 위한 쿠버네티스 핵심 활용 예제 알아보기 - 정영준 AWS 솔루션즈 아키...
Amazon Web Services Korea
 
OpenShift Overview
roundman
 
The eBay Architecture: Striking a Balance between Site Stability, Feature Ve...
Randy Shoup
 
AWS CDK를 활용한 게임 데이터 파이프라인 구축 방안 [레벨 200] - 발표자: Douglas Lima, 데브옵스 컨설턴트, AWS ...
Amazon Web Services Korea
 
Apigee Edge Product Demo
Apigee | Google Cloud
 
The Complete Guide to Service Mesh
Aspen Mesh
 
쿠알못이 Amazon EKS로 안정적인 서비스 운영하기 - 최용호(넥슨코리아) :: AWS Community Day 2020
AWSKRUG - AWS한국사용자모임
 
API Gateway How-To: The Many Ways to Apply the Gateway Pattern
VMware Tanzu
 
kubernetes, pourquoi et comment
Jean-Baptiste Claramonte
 
Introduction to docker
Instruqt
 

Similar to Building Cloud Native Architectures with Spring (20)

PDF
Cloud Native Java Microservices
Kenny Bastani
 
PDF
The Beginner’s Guide To Spring Cloud
VMware Tanzu
 
PDF
Cloud-native Patterns (July 4th, 2019)
Alexandre Roman
 
PDF
Cloud-native Patterns
VMware Tanzu
 
PDF
Spring cloud
Milan Ashara
 
PDF
Azure Spring Cloud Workshop - June 17, 2020
VMware Tanzu
 
PPT
JDD 2016 - Jacek Bukowski - "Flying To Clouds" - Can It Be Easy?
PROIDEA
 
PPT
Flying to clouds - can it be easy? Cloud Native Applications
Jacek Bukowski
 
PPTX
"The Cloud Native Enterprise is Coming"
James Watters
 
PDF
Cloud Native Spring in Action 1st Edition Thomas Vitale
kannorarcus
 
PDF
Cloud-Native-Data with Cornelia Davis
VMware Tanzu
 
PDF
Cloud-native Data
cornelia davis
 
PDF
Lattice: A Cloud-Native Platform for Your Spring Applications
Matt Stine
 
PDF
Integration in the Age of DevOps
Brian Ashburn
 
PDF
Cloud Native Java Designing Resilient Systems with Spring Boot Spring Cloud a...
pjuelbj7772
 
PPTX
Intro to spring cloud &microservices by Eugene Hanikblum
Eugene Hanikblum
 
PPTX
Building REST APIs with Spring Boot and Spring Cloud
Kenny Bastani
 
PPTX
The Cloud Native Journey
VMware Tanzu
 
PDF
S1P: Spring Cloud on PKS
Mauricio (Salaboy) Salatino
 
PDF
Cloud Native Java Designing Resilient Systems with Spring Boot Spring Cloud a...
zubinrlondoit
 
Cloud Native Java Microservices
Kenny Bastani
 
The Beginner’s Guide To Spring Cloud
VMware Tanzu
 
Cloud-native Patterns (July 4th, 2019)
Alexandre Roman
 
Cloud-native Patterns
VMware Tanzu
 
Spring cloud
Milan Ashara
 
Azure Spring Cloud Workshop - June 17, 2020
VMware Tanzu
 
JDD 2016 - Jacek Bukowski - "Flying To Clouds" - Can It Be Easy?
PROIDEA
 
Flying to clouds - can it be easy? Cloud Native Applications
Jacek Bukowski
 
"The Cloud Native Enterprise is Coming"
James Watters
 
Cloud Native Spring in Action 1st Edition Thomas Vitale
kannorarcus
 
Cloud-Native-Data with Cornelia Davis
VMware Tanzu
 
Cloud-native Data
cornelia davis
 
Lattice: A Cloud-Native Platform for Your Spring Applications
Matt Stine
 
Integration in the Age of DevOps
Brian Ashburn
 
Cloud Native Java Designing Resilient Systems with Spring Boot Spring Cloud a...
pjuelbj7772
 
Intro to spring cloud &microservices by Eugene Hanikblum
Eugene Hanikblum
 
Building REST APIs with Spring Boot and Spring Cloud
Kenny Bastani
 
The Cloud Native Journey
VMware Tanzu
 
S1P: Spring Cloud on PKS
Mauricio (Salaboy) Salatino
 
Cloud Native Java Designing Resilient Systems with Spring Boot Spring Cloud a...
zubinrlondoit
 
Ad

More from Kenny Bastani (12)

PDF
In the Eventual Consistency of Succeeding at Microservices
Kenny Bastani
 
PDF
Extending the Platform with Spring Boot and Cloud Foundry
Kenny Bastani
 
PDF
Back your app with MySQL and Redis on Cloud Foundry
Kenny Bastani
 
PDF
Using Docker, Neo4j, and Spring Cloud for Developing Microservices
Kenny Bastani
 
PDF
Open Source Big Graph Analytics on Neo4j with Apache Spark
Kenny Bastani
 
PPT
Big Graph Analytics on Neo4j with Apache Spark
Kenny Bastani
 
PPTX
Document Classification with Neo4j
Kenny Bastani
 
PDF
Neo4j Graph Data Modeling
Kenny Bastani
 
PDF
Building a Graph-based Analytics Platform
Kenny Bastani
 
PDF
Building Killer Apps with Neo4j 2.0
Kenny Bastani
 
PPT
Natural Language Processing with Neo4j
Kenny Bastani
 
PPT
Natural language search using Neo4j
Kenny Bastani
 
In the Eventual Consistency of Succeeding at Microservices
Kenny Bastani
 
Extending the Platform with Spring Boot and Cloud Foundry
Kenny Bastani
 
Back your app with MySQL and Redis on Cloud Foundry
Kenny Bastani
 
Using Docker, Neo4j, and Spring Cloud for Developing Microservices
Kenny Bastani
 
Open Source Big Graph Analytics on Neo4j with Apache Spark
Kenny Bastani
 
Big Graph Analytics on Neo4j with Apache Spark
Kenny Bastani
 
Document Classification with Neo4j
Kenny Bastani
 
Neo4j Graph Data Modeling
Kenny Bastani
 
Building a Graph-based Analytics Platform
Kenny Bastani
 
Building Killer Apps with Neo4j 2.0
Kenny Bastani
 
Natural Language Processing with Neo4j
Kenny Bastani
 
Natural language search using Neo4j
Kenny Bastani
 
Ad

Recently uploaded (20)

PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PPTX
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 

Building Cloud Native Architectures with Spring

  • 1. © 2016 Pivotal Software, Inc. All rights reserved. @kennybastani Building Cloud Native Architectures with Spring Kenny Bastani Spring Developer Advocate 
 Pivotal Cloud Native Roadshow 2016 1
  • 3. Agenda Agenda 1 Microservices & Cloud Native 2 Reference Architecture 3 Spring Boot 4 Spring Cloud 5 Dealing with Legacy
  • 4. © 2016 Pivotal Software, Inc. All rights reserved. @kennybastani Microservices How did we get there? 4
  • 5. We started with the monolith…
  • 6. © 2016 Pivotal Software, Inc. All rights reserved. @kennybastani Cultural problems with monoliths 6 Slows our velocity getting into production It takes too long to ramp up new engineers The code base is just too large for anyone one person to fully comprehend Centralized authority and change management slows progress (DBA, Ops)
  • 7. © 2016 Pivotal Software, Inc. All rights reserved. @kennybastani Operational problems with monoliths 7 Coordinated releases batch many changes together from different teams Operations drives the runtime environment of applications Operators take on all operational responsibility (including VM upgrades) Deploy everything at once or nothing at all
  • 8. We then moved towards SOA…
  • 9. @kennybastani We have now arrived at microservices… Each team provisions self-service infrastructure, like a database, and builds a single application Centralized resources are provided as backing services that are shared for data consistency, caching
  • 10. © 2016 Pivotal Software, Inc. All rights reserved. @kennybastani Online Store Example Cloud native application as microservices 10
  • 18. © 2016 Pivotal Software, Inc. All rights reserved. @kennybastani Eventual consistency Handling the guarantees of an eventually consistent microservices architecture 18
  • 19. Eventual consistency Microservice architectures provide no guarantees about the correctness of your data So how can we guarantee high availability while also guaranteeing data consistency?
  • 21. Event Sourcing Aggregates can be used to generate the consistent state of any object It provides an audit trail that can be replayed to generate the state of an object from any point in time It provides the many inputs necessary for analyzing data using event stream processing It enables the use of compensating transactions to rollback events leading to an inconsistent application state It also avoids complex synchronization between microservices, paving the way for asynchronous non-blocking operations between microservices
  • 24. Event logs are transaction logs Use event sourcing in your microservices to ensure consistency of your distributed system Don’t store state with microservices, store events Use event stream processing to observe the active usage of your cloud native application in real-time
  • 25. © 2016 Pivotal Software, Inc. All rights reserved. @kennybastani The Cloud Native Stack What are the components of a cloud-native architecture? 25
  • 26. What is a cloud-native application? The cloud provides resources The platform provides services The application provides value
  • 29. What is a cloud service? The platform provides services The developer provisions services The application uses services
  • 30. Microservices != Cloud Native Microservices are an architectural practice Cloud native is a style of application development Monoliths can equally be cloud native apps
  • 32. Splitting the Monolith: User Service Migration
  • 33. © 2016 Pivotal Software, Inc. All rights reserved. @kennybastani Spring Boot A JVM micro-framework for building microservices 33
  • 34. What is Spring Boot?
  • 35. @kennybastani spring boot Spring Initializr for boostraping your applications supports rapid development of production-ready applications and services
  • 36. © 2016 Pivotal Software, Inc. All rights reserved. @kennybastani Cloud Native Platforms Shipping applications in containers instead of shared application servers 36
  • 37. @kennybastani Application Server Deployment: Monolith Load balancing requires provisioning of new VMs and app server installations Poor resource isolation; memory leaks can cause other applications to become unavailable Runtime environment is driven by the operator Virtual Machine
 App Linux Kernel App App Hardware Infrastructure
  • 38. @kennybastani Linux Container Deployment: Microservices Development team drives the application runtime of a container Containers are resource isolated, allowing efficient scheduling onto a grid of VMs Containers take seconds to start, VMs take minutesVirtual Machine
 Container Linux Kernel App App App App Container App App App App Container App App App App Hardware Infrastructure
  • 39. @kennybastani Microservices: Container Deployment Each microservice can be containerized with their application dependencies Containers get scheduled on virtual machines with an allotted resource policy
  • 40. @kennybastani Container scheduling and auto-scaling Minutes to provision and start a VM, but seconds to schedule and start a container Auto-scaling becomes a feature of the cloud platform by scheduling on pool of VMs
  • 41. @kennybastani Distributed Applications Each microservice will likely need to communicate with other containers Service discovery automates how distributed apps find service dependencies
  • 42. © 2016 Pivotal Software, Inc. All rights reserved. @kennybastani Spring Cloud A toolset designed for building distributed systems 42
  • 43. @kennybastani What is Spring Cloud? Spring Cloud provides a way to turn Spring Boot microservices into distributed applications
  • 44. @kennybastani spring cloud Apache Zookeeper these logos are all trademark/copyright their respective owners (T-B, L-R): 
 
 Netflix, amazon.com, Apache Software Foundation, Cloud Foundry, Hashicorp they are ALL great organizations and we love their open-source and their APIs!! *
  • 45. © 2016 Pivotal Software, Inc. All rights reserved. @kennybastani Spring Cloud Demos Applying the patterns of cloud-native architectures with Spring Boot and Spring Cloud 45
  • 46. @kennybastani Spring Cloud: Cloud Native Patterns Service Discovery API Gateway Config Server Circuit Breakers Distributed Tracing
  • 47. Service Discovery Allows applications to find each other in an environment An essential component when using dynamic container scheduling Each application handles its own routing Developers only need the name of a dependency, not the URL A service registry is distributed to all subscriber applications
  • 50. @kennybastani Client-side Load Balancing • Create discovery service • Register user service • Register user client • Scale user service • Reverse proxy from user client to user service User
 Service User
 Service User
 Client
  • 51. @kennybastani Client-side Load Balancing • Create discovery service • Register user service • Register user client • Scale user service • Reverse proxy from user client to user service User
 Service User
 Service User
 Client
  • 52. @kennybastani Client-side Load Balancing • Create discovery service • Register user service • Register user client • Scale user service • Reverse proxy from user client to user service User
 Service User
 Service User
 Client
  • 53. @kennybastani Client-side Load Balancing • Create discovery service • Register user service • Register user client • Scale user service • Reverse proxy from user client to user service User
 Service User
 Service User
 Client
  • 56. © 2016 Pivotal Software, Inc. All rights reserved. @kennybastani Config Server Centralizing config management for microservices with Spring Cloud Config Server 56
  • 57. Config Server Allows applications to source configuration from central service Application configuration can be changed without deployment Cascading configuration files for all apps and individual apps Uses Git repository as file system, providing audit log of changes Add Spring Cloud Bus to automate config refresh for many instances
  • 60. © 2016 Pivotal Software, Inc. All rights reserved. @kennybastani API Gateway Building edge services that route requests to backend microservices 60
  • 63. Edge Service API gateway pattern using Spring Cloud Netflix Zuul starter project Embeds relative routes from other services registered with Eureka Automatic method for reverse proxying to other services Routes are displayed at /routes of the Spring Boot app
  • 64. Benefits Provides a secure gateway to compose together REST APIs exposed by backend microservices Front-end developers can integrate with a single API over HTTP to communicate with potentially many microservices Front-end applications can further embed an edge service to avoid the need to manage CORS and authentication concerns
  • 66. © 2016 Pivotal Software, Inc. All rights reserved. @kennybastani Distributed Tracing Tracing the Online Store 66
  • 67. Spring Cloud Sleuth Spring Cloud Sleuth is a project that adds distributed tracing capabilities to your distributed Spring Boot applications https://cloud.spring.io/spring-cloud-sleuth/ http://zipkin.io/
  • 70. © 2016 Pivotal Software, Inc. All rights reserved. @kennybastani Strangling Legacy with Microservices How do I build microservices that are cloud-native without doing a big bang refactor? 70
  • 71. Going Cloud Native Legacy migration challenges “How do I change the engine of the aircraft while it’s still in flight?” Approaches Lift-and-shift Big bang refactor and migration Iterative legacy modernization
  • 72. Problems with lift-and-shift Brings your tech debt into the cloud Rolling maintenance windows until migration is complete
  • 73. Strangler Pattern “Gradually create a new system around the edges of the old, letting it grow slowly over several years until the old system is strangled.” — Martin Fowler
  • 74. Strangler vines—seed in the upper branches of a fig tree and gradually work their way down to the soil—strangling and eventually and killing the tree
  • 75. Strangling legacy using microservices How can we take advantage of building microservices that also strangle data from the edge of legacy systems?
  • 76. The problem with data The most common pain point that companies experience when building microservices is handling domain data Your domain data is likely going to be trapped inside a large shared database—probably being of the Oracle or IBM variety Because of this, your new microservices will be dependent on retrieving data from a large shared database
  • 77. Fetching data from the legacy system Microservices can reach into the legacy system and fetch data in the same way that front-end applications do While this isn’t a good long-term strategy, it can be an intermediate step in gaining control over the legacy backend
  • 79. Agile benefits of extending domain data We gain the benefit of agility in microservices by extending base domain objects retrieved from a legacy system New feature changes are moved out to the new microservice, using an indirection layer to maintain backward compatibility with the legacy system
  • 81. Advantages The legacy system does not need to be altered to support the development of new microservices New features can be deployed independently without being tightly coupled to the legacy system It ensures that any existing calls to a legacy web service are unaltered for other apps
  • 82. Disadvantages Scalability may be a concern in the case that the base legacy service is not cloud-native Availability will be impacted if the base legacy service’s shared database suffers an outage The dependency on the legacy system’s shared database is increased, making it harder to decompose
  • 84. Point-to-point Connections If your architecture has brittle point-to-point connections, code changes may be required to create a legacy indirection layer If you’re building microservices on top of an SOA and are using an ESB, an indirection layer already exists
  • 87. Data Acquisition We can use the Legacy Edge service to adapt responses from microservices into the native formats expected by legacy applications We can also acquire data from the legacy system and migrate the system of record to a microservice, without refactoring the current database
  • 88. © 2016 Pivotal Software, Inc. All rights reserved. @kennybastani Reference application Open source example of strangling legacy 88
  • 93. Let’s talk about theory and practice
  • 94. The first law of microservices. It depends.
  • 95. In the end.. Do what makes sense for your architecture Worry deeply about who cleans up after you Building software is more about people than it is tools
  • 96. Full open source examples on my blog http://www.kennybastani.com
  • 98. Cloud native applications “If you have to implement the same functionality in each application, it should instead be provided as a service using the platform” – Matt Curry @ Allstate Do this well, and the only thing you’ll be left with is the valuable business logic in your applications
  • 99. The two road blocks of cloud native
  • 101. Legacy culture Before you can even begin to address the handling of legacy in a new microservice architecture, you’ll need to address a legacy culture Some developers may believe a piece of legacy code is beautiful, and has done its job without change for many years Handling the culture shift is a delicate matter. Get people on board before imposing changes
  • 103. This is what dropping a legacy application in a Docker container and calling it a microservice looks like..
  • 104. Legacy applications Not all legacy needs to be destroyed right away Make sure to take an iterative approach to go cloud-native that promises backwards compatibility with legacy applications The goal is to lessen the impact to users over time before making a decision to phase out legacy applications and infrastructure Developers dream of strangling legacy, but it likely still generates revenue for the business
  • 105. © 2016 Pivotal Software, Inc. All rights reserved. @kennybastani Thank you. Reach out if you have any questions! 105