10 pro tips: how to work with production databases
The goal here is get what you need done as quickly as possible and keep rolling.
Move fast and break things. Unless you are breaking stuff, you are not moving fast enough.
- Use the same tool you use for development to connect to your production databases. There's no need to learn more than one tool for the same job. Context-switching is for chumps.
- Connect to all of the databases and keep the connections open all the time. It should be really easy to jump between databases, and from development to production.
- Query using a user which has full privileges. Come on, we're grown-ups here.
- Run queries in bulk where possible.
- Don't group databases in folders. Aim to reduce clicks rather than introduce them. On a related note, if you use keyboard shortcuts you don't need to worry about UI or to look at what you're doing at all really.
- Don't waste time with labelling or colouring your connections. Customers don't care how pretty your setup is. Strive for absolute consistency.
- If your tool has a "safe mode", forget about it. It will only hold you back. Productivity beats safety every time.
- Always browse primaries, unless you have a legitimate reason to use a replica. You might run an update on the wrong database and impact fewer databases than expected.
- Snapshots / backups are for the weak.
- Only use
WHERE
clauses when necessary. Database browsers tend to limit how many rows are returned anyway. Adding aWHERE
clause yourself might unnecessarily slow down your query.
Bam! Rockstar database administration isn't a skill, it's a mindset.