Interview practice question
Migration causes a database lock pile-up
Backend Engineering · Production Debugging · Experienced
A schema migration that adds a column brought your application down, even though the operation itself should be fast. What happened?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- ALTER needs ACCESS EXCLUSIVE lock.
- Waits behind long-running query/transaction.
- All new queries queue behind it.
- Use lock_timeout and retries.
- Check for long transactions before migrating.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.