SlideShare a Scribd company logo
@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

PPTX
Kubernetes PPT.pptx
PPTX
Gitlab CI/CD
PDF
Getting Started with Kubernetes
PDF
Kubernetes
PDF
Introduction to GitHub Actions
PDF
Kubernetes Deployment Tutorial | Kubernetes Tutorial For Beginners | Kubernet...
ODP
Kubernetes Architecture
PDF
Introduction to Kubernetes Workshop
Kubernetes PPT.pptx
Gitlab CI/CD
Getting Started with Kubernetes
Kubernetes
Introduction to GitHub Actions
Kubernetes Deployment Tutorial | Kubernetes Tutorial For Beginners | Kubernet...
Kubernetes Architecture
Introduction to Kubernetes Workshop

What's hot (20)

PDF
Kubernetes - A Comprehensive Overview
PDF
Jenkins
PDF
OpenStack Architecture
PDF
Introduction and Deep Dive Into Containerd
PDF
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
PPTX
Introduction to kubernetes
PPTX
OpenStack Architecture and Use Cases
PPTX
Intro to Helm for Kubernetes
PDF
Docker & kubernetes
PPTX
A brief study on Kubernetes and its components
PPTX
Introduction to helm
PDF
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
PDF
Kubernetes Basics
PPSX
Docker Kubernetes Istio
PDF
Automation with ansible
PDF
Kubernetes architecture
PPTX
KEDA Overview
PDF
쿠버네티스를 이용한 기능 브랜치별 테스트 서버 만들기 (GitOps CI/CD)
PDF
Platform Engineering
PPTX
OpenStack Introduction
Kubernetes - A Comprehensive Overview
Jenkins
OpenStack Architecture
Introduction and Deep Dive Into Containerd
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
Introduction to kubernetes
OpenStack Architecture and Use Cases
Intro to Helm for Kubernetes
Docker & kubernetes
A brief study on Kubernetes and its components
Introduction to helm
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
Kubernetes Basics
Docker Kubernetes Istio
Automation with ansible
Kubernetes architecture
KEDA Overview
쿠버네티스를 이용한 기능 브랜치별 테스트 서버 만들기 (GitOps CI/CD)
Platform Engineering
OpenStack Introduction
Ad

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

PPTX
JCon - Zero-Downtime-Deployment with Kubernetes, Spring Boot and Flyway
PPTX
VoxxedDays Cluj - Zero-downtime deployment with Kubernetes, Spring Boot and F...
PPTX
OSCONF Koshi - Zero downtime deployment with Kubernetes, Flyway and Spring Boot
PPTX
DevOpsDays Madrid - Zero-downtime deployment with Kubernetes, Spring Boot and...
PPTX
XP Days Ukraine - Zero-downtime deployment with Kubernetes, Spring Boot and F...
PDF
Zero-downtime Deployment on Kubernetes
PPTX
Zero-downtime deployment on Kubernetes with Hazelcast
PDF
InfluxDB Live Product Training
PPTX
OSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java application
PPTX
MongoDB World 2016: MongoDB + Google Cloud
PPTX
OSCONF Hyderabad - Shorten all URLs!
PDF
Data Science in the Cloud @StitchFix
PDF
Shorten All URLs
PDF
InfluxDB + Telegraf Operator: Easy Kubernetes Monitoring
PPTX
BigData conference - Introduction to stream processing
PPTX
Hot deploy
PPTX
Devclub.lv - Introduction to stream processing
PPTX
Snowflake Automated Deployments / CI/CD Pipelines
PDF
CDC patterns in Apache Kafka®
PDF
Meetup 2020 - Back to the Basics part 101 : IaC
JCon - Zero-Downtime-Deployment with Kubernetes, Spring Boot and Flyway
VoxxedDays Cluj - Zero-downtime deployment with Kubernetes, Spring Boot and F...
OSCONF Koshi - Zero downtime deployment with Kubernetes, Flyway and Spring Boot
DevOpsDays Madrid - Zero-downtime deployment with Kubernetes, Spring Boot and...
XP Days Ukraine - Zero-downtime deployment with Kubernetes, Spring Boot and F...
Zero-downtime Deployment on Kubernetes
Zero-downtime deployment on Kubernetes with Hazelcast
InfluxDB Live Product Training
OSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java application
MongoDB World 2016: MongoDB + Google Cloud
OSCONF Hyderabad - Shorten all URLs!
Data Science in the Cloud @StitchFix
Shorten All URLs
InfluxDB + Telegraf Operator: Easy Kubernetes Monitoring
BigData conference - Introduction to stream processing
Hot deploy
Devclub.lv - Introduction to stream processing
Snowflake Automated Deployments / CI/CD Pipelines
CDC patterns in Apache Kafka®
Meetup 2020 - Back to the Basics part 101 : IaC
Ad

More from Nicolas Fränkel (20)

PPTX
SnowCamp - Adding search to a legacy application
PPTX
Un CV de dévelopeur toujours a jour
PDF
jLove - A Change-Data-Capture use-case: designing an evergreen cache
PPTX
ADDO - Your own Kubernetes controller, not only in Go
PPTX
TestCon Europe - Mutation Testing to the Rescue of Your Tests
PPTX
GeekcampSG 2020 - A Change-Data-Capture use-case: designing an evergreen cache
PPTX
JavaDay Istanbul - 3 improvements in your microservices architecture
PPTX
JOnConf - A CDC use-case: designing an Evergreen Cache
PPTX
London In-Memory Computing Meetup - A Change-Data-Capture use-case: designing...
PPTX
JUG Tirana - Introduction to data streaming
PPTX
Java.IL - Your own Kubernetes controller, not only in Go!
PPTX
vJUG - Introduction to data streaming
PPTX
London Java Community - An Experiment in Continuous Deployment of JVM applica...
PPTX
OSCONF - Your own Kubernetes controller: not only in Go
PPTX
vKUG - Migrating Spring Boot apps from annotation-based config to Functional
PPTX
Tech talks - 3 performance improvements
PPTX
AllTheTalks.online - A Streaming Use-Case: And Experiment in Continuous Deplo...
PPTX
ING Meetup - Migrating Spring Boot Config Annotations to Functional with Kotlin
PPTX
SouJava- 3 easy performance improvements in your microservices architecture
PPTX
JUG SF - Introduction to data streaming
SnowCamp - Adding search to a legacy application
Un CV de dévelopeur toujours a jour
jLove - A Change-Data-Capture use-case: designing an evergreen cache
ADDO - Your own Kubernetes controller, not only in Go
TestCon Europe - Mutation Testing to the Rescue of Your Tests
GeekcampSG 2020 - A Change-Data-Capture use-case: designing an evergreen cache
JavaDay Istanbul - 3 improvements in your microservices architecture
JOnConf - A CDC use-case: designing an Evergreen Cache
London In-Memory Computing Meetup - A Change-Data-Capture use-case: designing...
JUG Tirana - Introduction to data streaming
Java.IL - Your own Kubernetes controller, not only in Go!
vJUG - Introduction to data streaming
London Java Community - An Experiment in Continuous Deployment of JVM applica...
OSCONF - Your own Kubernetes controller: not only in Go
vKUG - Migrating Spring Boot apps from annotation-based config to Functional
Tech talks - 3 performance improvements
AllTheTalks.online - A Streaming Use-Case: And Experiment in Continuous Deplo...
ING Meetup - Migrating Spring Boot Config Annotations to Functional with Kotlin
SouJava- 3 easy performance improvements in your microservices architecture
JUG SF - Introduction to data streaming

Recently uploaded (20)

PDF
medical staffing services at VALiNTRY
PPTX
ai tools demonstartion for schools and inter college
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Understanding Forklifts - TECH EHS Solution
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Introduction to Artificial Intelligence
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
System and Network Administration Chapter 2
medical staffing services at VALiNTRY
ai tools demonstartion for schools and inter college
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Internet Downloader Manager (IDM) Crack 6.42 Build 41
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Odoo Companies in India – Driving Business Transformation.pdf
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
How to Choose the Right IT Partner for Your Business in Malaysia
Understanding Forklifts - TECH EHS Solution
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
L1 - Introduction to python Backend.pptx
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
VVF-Customer-Presentation2025-Ver1.9.pptx
Introduction to Artificial Intelligence
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
System and Network Administration Chapter 2

Zero-Downtime Deployment with Kubernetes, SpringBoot & Flyway