Week 18: PostgreSQL & Redis in Production

Theme: Operate stateful databases on Kubernetes: backup, HA, migrations.

Learning Objectives

  1. Deploy PostgreSQL on Kubernetes using CloudNativePG or Zalando operator
  2. Configure streaming replication for HA
  3. Perform zero-downtime schema migrations
  4. Deploy Redis Sentinel or Redis Cluster for high availability

Reading Materials

Finger Exercises (choose 2)

  1. Deploy a PostgreSQL cluster with CloudNativePG: 1 primary + 1 replica. Connect and run a simple schema.
  2. Run a schema migration using golang-migrate: add a users table, then add an index. Roll back.
  3. Deploy Redis with Sentinel (3 nodes). Test failover by killing the primary.

Project

Time Budget

ActivityTime
Reading2 hrs
Finger exercises1.5 hrs
Project2.5 hrs
Total6 hrs