14. Cloud-Native Architecture and Deployment

Deployment strategies

  • Rolling deployment: gradually replaces old instances; watch compatibility between versions.
  • Blue-green deployment: switches traffic between two environments; requires capacity and data compatibility planning.
  • Canary deployment: exposes a small traffic fraction to a new version and expands after validation.
  • Feature flags: separate code deployment from feature exposure; define ownership and cleanup to prevent flag accumulation.

Infrastructure principles

  • Automate repeatable infrastructure changes with version-controlled configuration.
  • Keep configuration separate from application code.
  • Use immutable or reproducible build artifacts.
  • Apply least privilege to deployment identities.
  • Define readiness and liveness checks separately.
  • Set resource requests, limits, and autoscaling policies based on measured behavior.
  • Plan graceful shutdown, connection draining, and in-flight request handling.

Container orchestration checklist

  • Health probes.
  • Resource requests and limits.
  • Replica count and disruption budget.
  • Autoscaling signals.
  • Secrets and configuration management.
  • Network policies and service identity.
  • Rollback and version compatibility.
  • Persistent storage and backup where required.

Cloud architecture decisions

  • Choose regions based on user latency, compliance, service availability, and recovery needs.
  • Use managed services when their guarantees, cost, and operational model fit.
  • Estimate total cost, including data transfer, storage operations, idle capacity, and observability.
  • Avoid assuming that multiple replicas in one failure domain protect against a zone or region outage.
Key Takeaways
  • Choose deployment strategies based on risk and rollback requirements.
  • Plan for version compatibility during gradual rollouts.
  • Autoscaling does not replace capacity planning or dependency limits.
  • Include operational cost and disaster recovery in cloud design.