~/notes/postgresql
#postgresql
Problems I ran into, what I tried, and what I learned along the way. Some are finished stories, some are notes I'm still adding to.
- 3,500 connections to PostgreSQL, and almost none of them working Our Tornado app hit PostgreSQL's connection limit. When I looked closer, most of those connections were just sitting there, idle or stuck in a transaction.
- Why I write runbooks and playbooks A runbook tells you how to do a known task. A playbook tells you how to think when you don't know what's wrong yet. I needed both.
- VACUUM in PostgreSQL If PostgreSQL never overwrites a row, where do all the old versions go? And why didn't my table shrink after I deleted most of it?
- Understanding MVCC in PostgreSQL What does transaction B see while transaction A is changing the same row? I finally sat down to find out what happens under a simple UPDATE.
- Deploying during business hours Our system takes payments all day, so every deploy meant downtime. Here's how we got to rolling deploys without Kubernetes, one question at a time.
- A backup is only a hope until you restore it We had nightly backups that nobody had ever restored. Then someone asked what we'd get back if we lost the database at 2 PM.
- Do I really need to think about isolation levels? Just querying the database as usual works, right up until two people try to book the last ticket at the same time.