I stumbled across Christophe Pettus‘ fabulous OSCON 2011 slide deck this morning and just had to share it as a must-read for Django app developers. It’s full of great gems on Django best practices by way of using real-world examples of “worst practices” and I defiinitely recognize some of my own forehead-slappers in there. The slides are particularly useful in elucidating the Django ORM and the peculiarities it introduces in the database layer. The author seems to have a great sense of humor to boot and keeps the tone light throughout the presentation.
Cristophe is from a consultancy called PostgreSQL Experts, which probably means he’s usually called in to clean up disasters instead of pre-launch testing when most of these issues should have been resolved. If there’s one thing I got from this slide deck, it’s to make sure to have a reasonable pre-launch staging environment with a test plan that maps to real-world usage numbers — something that’s become immeasurably cheaper and easier with cloud solutions (need to simulate 10,000 simultaneous users? No problem, spin up a few EC2 instances, point them at your app and let them loose!)
As a side note, I really need to investigate PostgreSQL as a database alternative on my next project — the reliable replication in PostgreSQL 9 alone opens up fascinating possibilities.