Menu

1 / 2

Zero-Downtime Database Migrations on Kubernetes: How I Stopped Fearing Deploy Day

DEV Community·우병수·6 months ago
#B1lFBTjt
#flyway#pattern#when#migration#migrations
Reading 0:00
15s threshold

TL;DR: Here's the scenario that's burned me — and almost every backend dev I know — at least once: you push a migration that renames a column or adds a NOT NULL constraint. Your CI pipeline goes green.

📖 Reading time: ~39 min

What's in this article

The Problem: Why Database Migrations Are Still the Scariest Part of a Deploy

The Classic Failure Mode Nobody Warns You About

The Mental Model You Need Before Writing a Single YAML File

Tooling Choice: Flyway vs Liquibase in a Kubernetes World

Flyway vs Liquibase: Pick One and Commit

Pattern 1: Running Migrations as a Kubernetes Job Before Deployment

Pattern 2: Init Containers — When You Want Migrations Tightly Coupled to the Pod

The init container runs first, then your app — that's the whole mechanic, and it's deceptively useful

The Problem: Why Database Migrations Are Still the Scariest Part of a Deploy

The Classic Failure Mode Nobody Warns You About

Here's the scenario that's burned me — and almost every backend dev I know — at least once: you push…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.