SlideShare a Scribd company logo
1 of 31
Download to read offline
@nicolas_frankel
ZERO-DOWNTIME
DEPLOYMENT
With Kubernetes, Flyway and Spring Boot
@nicolas_frankel
Me, myself and I
● Developer Advocate
● Former dev/architect
● DevOps and Cloud curious
@nicolas_frankel
European alternative to the “big”
cloud-computing players
● Privacy-minded
● Great support
@nicolas_frankel
Why zero-downtime?
1. Company’s reputation
2. Users’ expectations
3. Missing revenue
@nicolas_frankel
Blue-Green deployment
@nicolas_frankel
Blue-Green deployment
@nicolas_frankel
Blue-Green deployment variant
@nicolas_frankel
Issues with Blue-Green deployment
● Routing latency
● “Lagging” users
● Database management
○ Migration
○ Or compatibility
@nicolas_frankel
Rolling updates principle
1.0 1.01.02.0 2.0 2.0
@nicolas_frankel
Kubernetes to the rescue!
apiVersion: apps/v1
kind: Deployment
spec:
replicas: 3
strategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
type: RollingUpdate
@nicolas_frankel
Rolling update options
● maxSurge:
○ Number of extra pods
● maxUnavalaible:
○ Number of down pods
allowed
@nicolas_frankel
@nicolas_frankel
@nicolas_frankel
@nicolas_frankel
● Kubernetes need to know the
application’s state
○ To mark the pod ready
● Spring Boot offers the actuator
○ With the /health
endpoint
Apps don’t start instantly
@nicolas_frankel
Kubernetes-Spring Boot integration magic
spec:
containers:
- name: spring-boot-app
image: zerodowntime:1.0
readinessProbe:
httpGet:
path: /actuator/health
port: 8080
@nicolas_frankel
Most talks stop there...
● Let’s pat ourselves on the
shoulder
● Hello world apps FTW!
@nicolas_frankel
It’s the database, stupid!
1.0 1.01.02.0
1.02.0
@nicolas_frankel
Version compatibility
Consecutive app versions
must be schema-compatible
@nicolas_frankel
It’s still the database...
1.0 1.01.02.0
1.0
2.0 2.0
2.0
@nicolas_frankel
Making changes for-/backward compatible
Break down a change into a
serie of side-by-side
compatible changes
@nicolas_frankel
A sample use-case
Separating a single table into
2 tables with a Primary Key -
Foreign Key relation
@nicolas_frankel
Database schema migration
@nicolas_frankel
Steps decomposition
1. Create ADDRESS table
○ App use the PERSON table data as previously
○ Trigger copy data to ADDRESS table
2. The ADDRESS becomes the “source of truth”
○ App now uses the ADDRESS table data
○ Trigger copy data to the PERSON table
3. Remove extra columns in the PERSON table
@nicolas_frankel
● Disable automatic DDL
creation/update
● Delegate to Flyway
○ (Or Liquibase)
Spring Boot specifics
@nicolas_frankel
Flyway
“Version control for your
database. Robust schema
evolution across all your
environments.”
@nicolas_frankel
Flyway 101
● Based on migrations
● A migration is a SQL script
● Each migration is versioned
● Flyway records migrations
in a dedicated table
@nicolas_frankel
Spring Boot Flyway integration
● Migrations are stored in
the db/migrations
folder
● Automatically applied at
application startup
@nicolas_frankel
JPA specifics
● Spring and JPA listeners
don’t go along well
● Implementation dependent
(Hibernate)
@nicolas_frankel
Time for DEMO
@nicolas_frankel
Thanks!
● https://blog.frankel.ch/
● @nicolas_frankel
● https://git.io/fhZrq

More Related Content

What's hot

What's hot (20)

Data & Analytics Forum: Moving Telcos to Real Time
Data & Analytics Forum: Moving Telcos to Real TimeData & Analytics Forum: Moving Telcos to Real Time
Data & Analytics Forum: Moving Telcos to Real Time
 
Modeling the Smart and Connected City of the Future with Kafka and Spark
Modeling the Smart and Connected City of the Future with Kafka and SparkModeling the Smart and Connected City of the Future with Kafka and Spark
Modeling the Smart and Connected City of the Future with Kafka and Spark
 
Real-Time Geospatial Intelligence at Scale
Real-Time Geospatial Intelligence at Scale Real-Time Geospatial Intelligence at Scale
Real-Time Geospatial Intelligence at Scale
 
Streaming Sensor Data with Grafana and InfluxDB | Ryan Mckinley | Grafana
Streaming Sensor Data with Grafana and InfluxDB | Ryan Mckinley | GrafanaStreaming Sensor Data with Grafana and InfluxDB | Ryan Mckinley | Grafana
Streaming Sensor Data with Grafana and InfluxDB | Ryan Mckinley | Grafana
 
Russ Savage [Ngrok] | InfluxDB QuickStart | InfluxDays NA 2021
Russ Savage [Ngrok] | InfluxDB QuickStart | InfluxDays NA 2021Russ Savage [Ngrok] | InfluxDB QuickStart | InfluxDays NA 2021
Russ Savage [Ngrok] | InfluxDB QuickStart | InfluxDays NA 2021
 
Real-Time Analytics with Spark and MemSQL
Real-Time Analytics with Spark and MemSQLReal-Time Analytics with Spark and MemSQL
Real-Time Analytics with Spark and MemSQL
 
From Legacy SQL Server to High Powered Confluent & Kafka Monitoring System at...
From Legacy SQL Server to High Powered Confluent & Kafka Monitoring System at...From Legacy SQL Server to High Powered Confluent & Kafka Monitoring System at...
From Legacy SQL Server to High Powered Confluent & Kafka Monitoring System at...
 
Timothy Spann [StreamNative] | Using FLaNK with InfluxDB for EdgeAI IoT at Sc...
Timothy Spann [StreamNative] | Using FLaNK with InfluxDB for EdgeAI IoT at Sc...Timothy Spann [StreamNative] | Using FLaNK with InfluxDB for EdgeAI IoT at Sc...
Timothy Spann [StreamNative] | Using FLaNK with InfluxDB for EdgeAI IoT at Sc...
 
Building the Next-gen Digital Meter Platform for Fluvius
Building the Next-gen Digital Meter Platform for FluviusBuilding the Next-gen Digital Meter Platform for Fluvius
Building the Next-gen Digital Meter Platform for Fluvius
 
Real-Time Analytics with MemSQL and Spark
Real-Time Analytics with MemSQL and SparkReal-Time Analytics with MemSQL and Spark
Real-Time Analytics with MemSQL and Spark
 
Winning the On-Demand Economy with Spark and Predictive Analytics
Winning the On-Demand Economy with Spark and Predictive AnalyticsWinning the On-Demand Economy with Spark and Predictive Analytics
Winning the On-Demand Economy with Spark and Predictive Analytics
 
Driving the On-Demand Economy with Spark and Predictive Analytics
Driving the On-Demand Economy with Spark and Predictive AnalyticsDriving the On-Demand Economy with Spark and Predictive Analytics
Driving the On-Demand Economy with Spark and Predictive Analytics
 
Ceilometer presentation ods havana final - published
Ceilometer presentation ods havana   final - publishedCeilometer presentation ods havana   final - published
Ceilometer presentation ods havana final - published
 
Mobile cloud sync
Mobile   cloud syncMobile   cloud sync
Mobile cloud sync
 
Getting It Right Exactly Once: Principles for Streaming Architectures
Getting It Right Exactly Once: Principles for Streaming ArchitecturesGetting It Right Exactly Once: Principles for Streaming Architectures
Getting It Right Exactly Once: Principles for Streaming Architectures
 
Real-Time Analytics with Confluent and MemSQL
Real-Time Analytics with Confluent and MemSQLReal-Time Analytics with Confluent and MemSQL
Real-Time Analytics with Confluent and MemSQL
 
Real-Time, Geospatial, Maps by Neil Dahlke
Real-Time, Geospatial, Maps by Neil DahlkeReal-Time, Geospatial, Maps by Neil Dahlke
Real-Time, Geospatial, Maps by Neil Dahlke
 
Building Software to Scale
Building Software to Scale Building Software to Scale
Building Software to Scale
 
Industrial Data Science
Industrial Data ScienceIndustrial Data Science
Industrial Data Science
 
Driving the On-Demand Economy with Predictive Analytics
Driving the On-Demand Economy with Predictive AnalyticsDriving the On-Demand Economy with Predictive Analytics
Driving the On-Demand Economy with Predictive Analytics
 

Similar to Zero-Downtime Deployment with Kubernetes, SpringBoot & Flyway

OSCONF Hyderabad - Shorten all URLs!
OSCONF Hyderabad - Shorten all URLs!OSCONF Hyderabad - Shorten all URLs!
OSCONF Hyderabad - Shorten all URLs!
Nicolas Fränkel
 

Similar to Zero-Downtime Deployment with Kubernetes, SpringBoot & Flyway (20)

VoxxedDays Cluj - Zero-downtime deployment with Kubernetes, Spring Boot and F...
VoxxedDays Cluj - Zero-downtime deployment with Kubernetes, Spring Boot and F...VoxxedDays Cluj - Zero-downtime deployment with Kubernetes, Spring Boot and F...
VoxxedDays Cluj - Zero-downtime deployment with Kubernetes, Spring Boot and F...
 
JCon - Zero-Downtime-Deployment with Kubernetes, Spring Boot and Flyway
JCon - Zero-Downtime-Deployment with Kubernetes, Spring Boot and FlywayJCon - Zero-Downtime-Deployment with Kubernetes, Spring Boot and Flyway
JCon - Zero-Downtime-Deployment with Kubernetes, Spring Boot and Flyway
 
DevOpsDays Madrid - Zero-downtime deployment with Kubernetes, Spring Boot and...
DevOpsDays Madrid - Zero-downtime deployment with Kubernetes, Spring Boot and...DevOpsDays Madrid - Zero-downtime deployment with Kubernetes, Spring Boot and...
DevOpsDays Madrid - Zero-downtime deployment with Kubernetes, Spring Boot and...
 
Zero-downtime Deployment on Kubernetes
Zero-downtime Deployment on KubernetesZero-downtime Deployment on Kubernetes
Zero-downtime Deployment on Kubernetes
 
InfluxDB Live Product Training
InfluxDB Live Product TrainingInfluxDB Live Product Training
InfluxDB Live Product Training
 
OSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java application
OSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java applicationOSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java application
OSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java application
 
MongoDB World 2016: MongoDB + Google Cloud
MongoDB World 2016: MongoDB + Google CloudMongoDB World 2016: MongoDB + Google Cloud
MongoDB World 2016: MongoDB + Google Cloud
 
OSCONF Hyderabad - Shorten all URLs!
OSCONF Hyderabad - Shorten all URLs!OSCONF Hyderabad - Shorten all URLs!
OSCONF Hyderabad - Shorten all URLs!
 
Data Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixData Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFix
 
Shorten All URLs
Shorten All URLsShorten All URLs
Shorten All URLs
 
InfluxDB + Telegraf Operator: Easy Kubernetes Monitoring
InfluxDB + Telegraf Operator: Easy Kubernetes MonitoringInfluxDB + Telegraf Operator: Easy Kubernetes Monitoring
InfluxDB + Telegraf Operator: Easy Kubernetes Monitoring
 
BigData conference - Introduction to stream processing
BigData conference - Introduction to stream processingBigData conference - Introduction to stream processing
BigData conference - Introduction to stream processing
 
Hot deploy
Hot deployHot deploy
Hot deploy
 
Devclub.lv - Introduction to stream processing
Devclub.lv - Introduction to stream processingDevclub.lv - Introduction to stream processing
Devclub.lv - Introduction to stream processing
 
Snowflake Automated Deployments / CI/CD Pipelines
Snowflake Automated Deployments / CI/CD PipelinesSnowflake Automated Deployments / CI/CD Pipelines
Snowflake Automated Deployments / CI/CD Pipelines
 
CDC patterns in Apache Kafka®
CDC patterns in Apache Kafka®CDC patterns in Apache Kafka®
CDC patterns in Apache Kafka®
 
Meetup 2020 - Back to the Basics part 101 : IaC
Meetup 2020 - Back to the Basics part 101 : IaCMeetup 2020 - Back to the Basics part 101 : IaC
Meetup 2020 - Back to the Basics part 101 : IaC
 
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
 
GeekcampSG 2020 - A Change-Data-Capture use-case: designing an evergreen cache
GeekcampSG 2020 - A Change-Data-Capture use-case: designing an evergreen cacheGeekcampSG 2020 - A Change-Data-Capture use-case: designing an evergreen cache
GeekcampSG 2020 - A Change-Data-Capture use-case: designing an evergreen cache
 
PuppetConf 2016: Using Puppet with Kubernetes and OpenShift – Diane Mueller, ...
PuppetConf 2016: Using Puppet with Kubernetes and OpenShift – Diane Mueller, ...PuppetConf 2016: Using Puppet with Kubernetes and OpenShift – Diane Mueller, ...
PuppetConf 2016: Using Puppet with Kubernetes and OpenShift – Diane Mueller, ...
 

More from Nicolas Fränkel

jLove - A Change-Data-Capture use-case: designing an evergreen cache
jLove - A Change-Data-Capture use-case: designing an evergreen cachejLove - A Change-Data-Capture use-case: designing an evergreen cache
jLove - A Change-Data-Capture use-case: designing an evergreen cache
Nicolas Fränkel
 

More from Nicolas Fränkel (20)

Un CV de dévelopeur toujours a jour
Un CV de dévelopeur toujours a jourUn CV de dévelopeur toujours a jour
Un CV de dévelopeur toujours a jour
 
jLove - A Change-Data-Capture use-case: designing an evergreen cache
jLove - A Change-Data-Capture use-case: designing an evergreen cachejLove - A Change-Data-Capture use-case: designing an evergreen cache
jLove - A Change-Data-Capture use-case: designing an evergreen cache
 
ADDO - Your own Kubernetes controller, not only in Go
ADDO - Your own Kubernetes controller, not only in GoADDO - Your own Kubernetes controller, not only in Go
ADDO - Your own Kubernetes controller, not only in Go
 
TestCon Europe - Mutation Testing to the Rescue of Your Tests
TestCon Europe - Mutation Testing to the Rescue of Your TestsTestCon Europe - Mutation Testing to the Rescue of Your Tests
TestCon Europe - Mutation Testing to the Rescue of Your Tests
 
JavaDay Istanbul - 3 improvements in your microservices architecture
JavaDay Istanbul - 3 improvements in your microservices architectureJavaDay Istanbul - 3 improvements in your microservices architecture
JavaDay Istanbul - 3 improvements in your microservices architecture
 
London In-Memory Computing Meetup - A Change-Data-Capture use-case: designing...
London In-Memory Computing Meetup - A Change-Data-Capture use-case: designing...London In-Memory Computing Meetup - A Change-Data-Capture use-case: designing...
London In-Memory Computing Meetup - A Change-Data-Capture use-case: designing...
 
JUG Tirana - Introduction to data streaming
JUG Tirana - Introduction to data streamingJUG Tirana - Introduction to data streaming
JUG Tirana - Introduction to data streaming
 
Java.IL - Your own Kubernetes controller, not only in Go!
Java.IL - Your own Kubernetes controller, not only in Go!Java.IL - Your own Kubernetes controller, not only in Go!
Java.IL - Your own Kubernetes controller, not only in Go!
 
vJUG - Introduction to data streaming
vJUG - Introduction to data streamingvJUG - Introduction to data streaming
vJUG - Introduction to data streaming
 
London Java Community - An Experiment in Continuous Deployment of JVM applica...
London Java Community - An Experiment in Continuous Deployment of JVM applica...London Java Community - An Experiment in Continuous Deployment of JVM applica...
London Java Community - An Experiment in Continuous Deployment of JVM applica...
 
OSCONF - Your own Kubernetes controller: not only in Go
OSCONF - Your own Kubernetes controller: not only in GoOSCONF - Your own Kubernetes controller: not only in Go
OSCONF - Your own Kubernetes controller: not only in Go
 
vKUG - Migrating Spring Boot apps from annotation-based config to Functional
vKUG - Migrating Spring Boot apps from annotation-based config to FunctionalvKUG - Migrating Spring Boot apps from annotation-based config to Functional
vKUG - Migrating Spring Boot apps from annotation-based config to Functional
 
Tech talks - 3 performance improvements
Tech talks - 3 performance improvementsTech talks - 3 performance improvements
Tech talks - 3 performance improvements
 
AllTheTalks.online - A Streaming Use-Case: And Experiment in Continuous Deplo...
AllTheTalks.online - A Streaming Use-Case: And Experiment in Continuous Deplo...AllTheTalks.online - A Streaming Use-Case: And Experiment in Continuous Deplo...
AllTheTalks.online - A Streaming Use-Case: And Experiment in Continuous Deplo...
 
ING Meetup - Migrating Spring Boot Config Annotations to Functional with Kotlin
ING Meetup - Migrating Spring Boot Config Annotations to Functional with KotlinING Meetup - Migrating Spring Boot Config Annotations to Functional with Kotlin
ING Meetup - Migrating Spring Boot Config Annotations to Functional with Kotlin
 
SouJava- 3 easy performance improvements in your microservices architecture
SouJava- 3 easy performance improvements in your microservices architectureSouJava- 3 easy performance improvements in your microservices architecture
SouJava- 3 easy performance improvements in your microservices architecture
 
JUG SF - Introduction to data streaming
JUG SF - Introduction to data streamingJUG SF - Introduction to data streaming
JUG SF - Introduction to data streaming
 
SCALE - Stream processing and Open Data, a match made in Heaven
SCALE - Stream processing and Open Data, a match made in HeavenSCALE - Stream processing and Open Data, a match made in Heaven
SCALE - Stream processing and Open Data, a match made in Heaven
 
ConFoo - 3 performance improvements
ConFoo - 3 performance improvementsConFoo - 3 performance improvements
ConFoo - 3 performance improvements
 
YaJUG/Kaiserslautern JUG - 3 easy improvements in your microservices architec...
YaJUG/Kaiserslautern JUG - 3 easy improvements in your microservices architec...YaJUG/Kaiserslautern JUG - 3 easy improvements in your microservices architec...
YaJUG/Kaiserslautern JUG - 3 easy improvements in your microservices architec...
 

Recently uploaded

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Recently uploaded (20)

8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 

Zero-Downtime Deployment with Kubernetes, SpringBoot & Flyway