3 Topics
Chapter•55 Minutes

Infrastructure, CI/CD, and Deployment

Reproducible environments, safe containers, automated releases, scaling controls, and cost visibility

Environments and Configuration

Module:Core concept

Keep development, test, staging, and production isolated, with deliberate configuration differences.

How to apply it

Validate required configuration at startup; document variables and rotation. Keep public frontend config separate from server secrets. Use infrastructure as code and least-privilege roles; prefer short-lived CI credentials where supported.

Worked example

Fail startup if a required database URL is missing rather than failing on the first customer request.

Common mistakes to avoid

Sharing production data with tests or committing environment secrets.

Practice task

Implement this concept in the capstone. Add one positive test, one negative or failure-path test, and a short note explaining the trade-off you chose.

Key Takeaways
  • Keep development, test, staging, and production isolated, with deliberate configuration differences.
  • Validate required configuration at startup; document variables and rotation.
Knowledge Check

What is the strongest production practice for Environments and Configuration?

Containers, Health Checks, and Shutdown

Module:Core concept

Container images package code and runtime dependencies but should not contain production secrets.

How to apply it

Use supported base images, deterministic dependency installation, non-root execution, small build context, and scans. Separate readiness from liveness; gracefully stop traffic and handle in-flight work during shutdown.

Worked example

Readiness verifies serving capability; liveness detects a stuck process without depending on every external provider.

Common mistakes to avoid

Restart storms during provider outages or copying secrets into images.

Practice task

Implement this concept in the capstone. Add one positive test, one negative or failure-path test, and a short note explaining the trade-off you chose.

Key Takeaways
  • Container images package code and runtime dependencies but should not contain production secrets.
  • Use supported base images, deterministic dependency installation, non-root execution, small build context, and scans.
Knowledge Check

What is the strongest production practice for Containers, Health Checks, and Shutdown?

CI/CD, Scaling, and Cost Management

Module:Core concept

Automate lint, type checks, tests, security checks, and build verification; promote the same immutable artifact across environments.

How to apply it

Use backward-compatible database changes, canary/rolling releases, and predefined rollback signals. Load-test realistic traffic. Track latency, errors, queue depth, database saturation, and cost per active organization. Set budgets, tags, quotas, and retention controls.

Worked example

Send a small fraction of traffic to a canary version and stop rollout when error or latency thresholds are crossed.

Common mistakes to avoid

Scaling without measurements or allowing unbounded queues and cloud spend.

Practice task

Implement this concept in the capstone. Add one positive test, one negative or failure-path test, and a short note explaining the trade-off you chose.

Key Takeaways
  • Automate lint, type checks, tests, security checks, and build verification; promote the same immutable artifact across environments.
  • Use backward-compatible database changes, canary/rolling releases, and predefined rollback signals.
Knowledge Check

What is the strongest production practice for CI/CD, Scaling, and Cost Management?