PGCon2017 - 20180510

PGCon 2017
The PostgreSQL Conference

Brad Urani
Day Talks - Day 2 - 2017-05-26
Room DMS 1110
Start time 13:00
Duration 00:45
ID 1036
Event type Lecture
Track Case Studies
Language used for presentation English

Jaywalking in Traffic: Safe Migrations at Scale

At scale, easy things become hard. Database migrations for web applications are particularly perilous when performed under heavy load. Join us as we discuss migration strategies for non-downtime deployments. We'll cover the fundamentals of Postgres locking and how it can block requests and crash your app. Using real life examples, we'll see what types of schema changes cause locking and what techniques can be used to circumvent it.

We'll cover:

  • Splitting a single migration into many to avoid locking pitfalls
  • Using temporary indexes to speed up updates
  • Dividing migrations into phases to solve web framework schema caching issues
  • Batching updates to minimize lock contention
  • Automatically managing lock timeouts
  • Migration tooling for Ruby on Rails and similar frameworks

Regardless of the scale you run at, you'll learn plenty of value about Postgres, locking, and safely altering schemas. You'll get a comprehensive list of changes you can and cannot make under load to inform your migration strategy. Learn these techniques, tips and tools for safe migrations and avoid catastrophe next time your team deploys.