Skip to content

Deployment: recap and quiz

  1. Containers and images. You deploy a fixed image, identified by a digest, by replacing containers, and a new instance serves nothing for the time it takes to start and pass its readiness check.
  2. Rolling deployments. Replacing a few instances at a time keeps the service up only if the capacity that is left carries the traffic, and surge buys that capacity with extra instances.
  3. Blue/green and canary. Blue/green keeps a whole second fleet so that going back is a switch; a canary sends a small share of the traffic first, so that few users meet a bad release.
  4. Rollback and detection. The users a bad release reaches depend on the time to detect, the time for a person to act, and the time the strategy needs to go back.
  5. Feature flags. A flag separates deploying code from releasing a feature, so that a rollback can be a setting, at the price of flags that must be managed and removed.
  6. Zero-downtime schema changes. Two versions of the code share one database during a rollout, so a change is made in expand, migrate and contract steps that each suit both.
Idea What breaks What you see What helps
Image A moving tag, or a change made to a running container A mix of versions that nobody chose Deploy by digest, and replace containers
Rolling Too big a batch, or too little headroom Refused requests while the capacity is low A smaller batch, or surge
Blue/green The old fleet retired too soon, or a slow person A rollback that takes minutes Keep the old fleet, shorten the reaction
Canary Too little traffic or too small a regression Detection in minutes, or not at all A larger first step, a better alert
Rollback A new version that changed data An old version that fails on new data Compatible steps, or a roll forward
Flag A forgotten flag, or a default of “on” Untested combinations, a release by accident A default of “off”, and flags that expire
Schema A change only one version understands Errors from the old or the new instances Expand, migrate, contract
  1. Is the thing you deploy a fixed image, named by a digest? (Containers and images)
  2. How long does a new instance take to serve? The start time plus the readiness check is the price of every batch. (Containers and images)
  3. What capacity is left while the rollout runs, and is it above the traffic? If not, start new instances first or use a smaller batch. (Rolling deployments)
  4. Do the old and the new version work together for as long as both serve? (Rolling deployments)
  5. How many users can a bad version reach before it is noticed? Choose the share of the first step by that. (Blue/green and canary)
  6. Will the alert see this kind of failure, at this share of the traffic? (Rollback and detection)
  7. Who rolls back, and in how long? Automatic, or a person, and what the old fleet is kept for. (Rollback and detection)
  8. Is a rollback safe after the new version has written data? If not, plan to roll forward. (Rollback and detection)
  9. Can the risky part sit behind a flag, with a default of off? (Feature flags)
  10. Does the schema change go in expand, migrate and contract steps, with the contract last? (Zero-downtime schema changes)

Nine questions cover the whole module. Every option is explained, whether it is right or wrong.

Deployment: module quiz

This quiz needs JavaScript to check your answers.

Question 1 of 9

A team deploys `shop-api:latest`. Between two instance starts, the registry's `latest` is moved to a newer image.

What is the problem, and what avoids it?

Choose one answer.

Question 2 of 9

A fleet of 10 instances is replaced 2 at a time. Each batch takes 50 s to start and pass its readiness check, and the next batch starts when it is ready.

How long does the rollout take?

Enter a number and choose its unit.

Question 3 of 9

Which statement about a container is correct?

Choose one answer.

Question 4 of 9

A rolling deployment starts new instances first, 2 at a time, on a fleet of 10. Each batch of 2 extra instances is paid for during the 50 s that it takes to be ready, and there are 5 batches.

How many extra instance-minutes does the rollout cost?

Enter a number and choose its unit.

instance-minutes
Question 5 of 9

The fleet is 10 instances of 100 requests a second each, and the traffic is 900 requests a second. A rolling deployment takes 2 old instances out at a time.

What happens?

Choose one answer.

Question 6 of 9

A release is risky, traffic is high and an alert on the new version's error rate is trusted. The team wants the fewest users to meet a problem and can accept a slow rollout.

Which strategy fits best?

Choose one answer.

Question 7 of 9

A canary gets 5% of 600 requests a second. The alert needs 100 requests to the new version before it trusts a rate.

About how many seconds does it take to see 100 requests?

Enter a number and choose its unit.

seconds
Question 8 of 9

A new version has changed the format of data in the database, in a way the old version cannot read. A bug appears.

What is the safe way out?

Choose one answer.

Question 9 of 9

What is the right order for a change that removes a column?

Choose one answer.

A deployment strategy decides how a change reaches users. The next module takes a step back from a single service and asks how a whole system is divided into services: the architecture patterns. Ask the questions of this module of each of them: how does a change to one part reach users, who can undo it, and what is the database that all the versions share.

Your progress

Built by GhaziAlibi.

© ShardCraft. All rights reserved.