Deployment
From template to production
Deployment is the controlled movement of tested artifacts into an environment. Understand infrastructure as code: declarative templates, version control, idempotent runs, drift detection, and review before apply. Golden images and bootstrapping scripts standardize servers; configuration management keeps state converged. CI builds and tests every change; continuous delivery keeps releases deployable with a manual gate, while continuous deployment releases automatically.
Release strategies
Recreate stops old instances and starts new ones: simple, with downtime. Rolling replaces instances in batches: no extra capacity, but mixed versions and partial failure are possible. Blue/green runs two full environments and switches traffic, giving fast rollback at roughly double cost. Canary sends a small percentage of traffic to the new version and expands after metrics pass. Immutable deployment replaces instances rather than patching them. Feature flags decouple release from deploy.
Migration and testing
Know lift-and-shift, replatform, refactor, and repurchase, plus pilot, phased, and big-bang cutover. Test unit, integration, system, performance, load, stress, smoke, and UAT before production. Database changes must be backward compatible for rolling and blue/green.
Traps
Blue/green does not remove database compatibility problems and needs capacity. Canary requires traffic splitting and good metrics, not just a second environment. Rolling is not zero-risk. A rollback plan that has never been rehearsed is not a plan.
Worked example
A team must deploy weekly with low risk and fast rollback. Use CI to build an immutable image, run automated tests and a security scan, deploy to a small canary, watch error rate and latency, then promote. Keep the previous image ready for rollback. Rule of thumb: match the strategy to the risk and to your data model.