Delivery Best Practices
A condensed summary of the 25 most important enterprise delivery practices for Rust engineering 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
sqlx migratein 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 queue messages.
-
Staging mirrors prod pool sizes: Catch
sqlxpool 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
Cargo.lockhash: 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 Rust teams deploy?
Elite teams deploy daily with strong CI; weekly train is fine if CFR and MTTR are healthy.
Minimum CI before prod?
cargo test, clippy -D warnings, cargo audit, integration tests, migration dry-run on staging.
One workspace, many binaries?
Single release train coordinates API + worker SHA; document in monorepo README.
When skip canary?
Hotfix with identical artifact tested in staging + flag kill switch ready; document exception.
Compile time blocks lead time?
sccache, crate splitting, and CI parallelism are delivery investments.
CLI via cargo-dist?
Separate pipeline from server; same semver discipline and SBOM attachment.
Database per environment?
Never point staging at prod DB; anonymized snapshots only.
Who owns deploy order doc?
Service tech lead; review on every schema epic.
Freeze policy?
Commerce peaks + year-end; security CVE exceptions with EM approval.
Measure delivery improvement?
Pick one DORA metric per quarter; tie to concrete practice from this list.
Related
- Release Management - versioning
- Rollback Strategies - revert policy
- DORA Metrics - measurement
- Incident Response Playbooks - when deploy fails
- Governance Best Practices - fleet consistency
Stack versions: This page was written for Rust 1.97.0 (edition 2024), Tokio 1.x, Axum 0.8, serde 1.0, sqlx 0.8, clap 4, and Polars 0.46+.