Delivery Best Practices
A condensed summary of the 25 most important enterprise delivery practices for Python teams - drawn from every page in this section.
-
Separate PR and release pipelines: PR proves code; release promotes immutable image SHA - Release Management.
-
Tag images with git SHA: Never deploy floating tags to production.
-
Expand-contract migrations: Backward-compatible schema steps enable rollback - Rollback Strategies.
-
Migration before traffic shift: Run Alembic/Django migrations in release job before canary weight increases.
-
Document API to worker deploy order: Per service in repo
docs/deploy-order.md. -
Pause workers on incompatible schema steps: Avoid poison Celery messages.
-
Staging mirrors prod pool sizes: Catch SQLAlchemy pool exhaustion pre-prod - Environments & Config Promotion.
-
Smoke test write and read path:
/health/readyalone is insufficient. -
Feature flags default off: Server-side evaluation - Feature Flags & Progressive Delivery.
-
Kill switches in runbooks: Flag off before image rollback when path is isolated.
-
Sunset flags after 30 days stable: Stale flags are regression debt.
-
Canary at 5-10% first: Soak 10+ minutes with p95 guardrails.
-
Guardrail queue depth and pool wait: Not only HTTP 5xx rate.
-
Auto-abort canary on SLO burn: Wire analysis to rollout controller.
-
Blue-green keeps warm rollback: Fast swap when canary skipped.
-
Annotate dashboards with deploy SHA: Correlate incidents in minutes.
-
Track DORA per service: Frequency, lead time, CFR, MTTR - DORA Metrics.
-
Tag incidents with deploy SHA: Accurate change failure rate.
-
Tie deploy speed to error budget: Freeze features when budget low.
-
Release notes include migration and rollback: Support reads
#releasesSlack. -
CONCURRENTLY indexes on large Postgres tables: Avoid migration locks.
-
Retain 10 prod image tags:
rollout undorequires history. -
API and worker same Python and lock hash: Runtime skew causes subtle bugs.
-
Pre-register A/B experiments: Guardrails abort harmful variants - A/B Testing & Experimentation.
-
Game day rollback quarterly: DORA MTTR is a practiced skill.
FAQs
How fast should Python teams deploy?
As fast as migrations and CFR allow. Daily with flags is common; destructive schema weekly is normal.
Do we need Argo Rollouts?
Any canary with metric analysis works: Flagger, Spinnaker, custom ALB weights.
When skip the release train?
When error budget is exhausted, open SEV1, or staging load test failed.
How handle library releases vs services?
Libraries semver on demand; services pin lockfile per train.
What is the minimum canary soak?
10 minutes for high-traffic; longer for low-traffic until statistical samples exist.
Should notebooks use the same train?
No - batch jobs promote with data owner sign-off separately.
How document deploy order?
Markdown in repo with API pause, worker pause, migration, and rollback sections.
Does uv replace release discipline?
uv speeds CI; gates on tests, migrations, and canary remain mandatory.
Who owns release captain rotation?
Engineering manager schedules; each squad member serves quarterly.
How tie delivery to product?
Share DORA trends and incident themes in roadmap reviews - Roadmap Contributions.
Related
- Release Management - versioning and trains
- Feature Flags & Progressive Delivery - safe exposure
- Rollback Strategies - mitigation choices
- DORA Metrics - measurement
- CI/CD Pipelines - pipeline depth
Stack versions: This page was written for Python 3.14.0 (stable 3.14, maintenance 3.13), FastAPI 0.115+, Django 5.2, Flask 3.1, Pydantic 2, PyTorch 2.6+, pandas 2.2+, Polars 1.x, ruff 0.9+, and uv 0.6+.