JAVA-290 · Lesson 10 of 12 · 33 min
Deployment
▶ Video coming soon A video version of this lesson is on the way.
The plan from May had promised Leif one image, one more host name in Caddy and the same alerts. Sprint 5, from Thursday, July 27 to Wednesday, August 9, 2028, was when the team had to keep that promise. Alongside the security fixes, they prepared version 1.6.0 of the booking service, the first to contain the website, rehearsed its deployment on staging on Thursday, August 3, and released it to production a week later, on Thursday, August 10, Leif's usual release night. This lesson follows that deployment, which the team ran themselves through the pipeline Hamza had built in the spring, with Leif watching rather than doing.
What a deployment of 1.6.0 changes
Because the website was an adapter inside the existing service, most of the deployment course's work applied unchanged. The release workflow builds the image from a version tag, checks the version, publishes it to the registry, waits for an approval and deploys blue-green, switching only after readiness and smoke tests pass. What was new had to be listed, because a deployment that changes more than its authors think is the kind that goes wrong.
| Area | Change in 1.6.0 | Risk if wrong |
|---|---|---|
| Image | Same Dockerfile; Thymeleaf templates and the style sheet inside the JAR | Low; tested by every pipeline run since June |
| Database | Migrations V7 to V11, all expand-only | Medium; first time on production data |
| Configuration | New site, reminder, waiting-list and rate-limit properties; the per-phone limit switched on | Medium; a missing value could disable a feature |
| Caddy | A new site block for book.secondgear.org pointing at the same upstream as the API | Low; certificate issued automatically |
| Scheduled jobs | Reminder sender, waiting-list offers, retention, outbox | Medium; jobs run in both colors unless guarded |
| Monitoring | New panels, a page objective and an outbox backlog alert | Low |
The row about scheduled jobs hid a real problem that the staging rehearsal would have exposed if Thierry had not thought of it first. During a blue-green deployment both colors run at once for a few minutes, and afterwards the previous color is kept running for a quick rollback. If both ran the reminder job, every reminder due in that window would be sent twice. The fix was a leader lock: each job takes a PostgreSQL advisory lock at the start of each run, and only the copy that gets it does the work. Whichever color is live, and even if both are, exactly one sends.
@Scheduled(fixedDelayString = "${outbox.poll-interval:PT1M}")
public void sendDue() {
// pg_try_advisory_xact_lock returns false at once if another copy holds the lock
Boolean leader = jdbc.queryForObject("select pg_try_advisory_xact_lock(290001)", Map.of(), Boolean.class);
if (!Boolean.TRUE.equals(leader)) return;
for (OutboxRow row : outbox.due(Instant.now(clock), 50)) {
sendOne(row); // marks the row sent, or failed with its reason (security finding S11)
}
}What this code does
The advisory lock is a lock on an arbitrary number, here 290001, held for the length of the job's transaction, so it needs no table and is released automatically if the copy crashes. The other color's attempt returns false at once and its run does nothing. Each run takes at most fifty rows, so a backlog after an outage drains steadily instead of in one burst that the SMS provider might refuse.
Configuration that fails fast
Version 1.6.0 added a dozen properties. The deployment course's rule was to keep configuration outside the artifact and to fail fast: a service with a missing or impossible setting should refuse to start, with a message naming the setting, rather than start and misbehave hours later when a customer finds the problem. Blue-green deployment makes this rule especially valuable, because a copy that refuses to start never becomes ready and never receives traffic. The team bound the properties to a validated record, and wrote down its checks in plain Java first.
import java.net.URI;
import java.time.*;
import java.util.*;
public class Main {
record SiteProperties(String baseUrl, int perPhoneLimit, boolean perPhoneLimitEnabled, LocalTime reminderAt,
Duration waitlistHold, int retentionDays, String smsSender, String shopPhone) {}
static List<String> validate(SiteProperties p) {
List<String> e = new ArrayList<>();
try {
URI u = URI.create(p.baseUrl());
if (!"https".equals(u.getScheme())) e.add("site.base-url must use https: " + p.baseUrl());
} catch (IllegalArgumentException ex) { e.add("site.base-url is not a URL"); }
if (p.perPhoneLimit() < 1) e.add("booking.per-phone-limit must be at least 1");
if (p.reminderAt() == null) e.add("reminders.send-at is missing");
if (p.waitlistHold().compareTo(Duration.ofMinutes(15)) < 0 || p.waitlistHold().compareTo(Duration.ofHours(6)) > 0)
e.add("waitlist.hold must be between 15 minutes and 6 hours: " + p.waitlistHold());
if (p.retentionDays() < 1 || p.retentionDays() > 90) e.add("retention.days must be 1 to 90 (N4 says 30)");
if (p.smsSender() == null || p.smsSender().isBlank()) e.add("sms.sender is missing");
if (!p.shopPhone().matches("\\d{3}-\\d{3}-\\d{4}")) e.add("site.shop-phone must look like 555-555-0100");
return e;
}
public static void main(String[] args) {
SiteProperties prod = new SiteProperties("https://book.secondgear.org", 2, true, LocalTime.of(18, 0),
Duration.ofHours(2), 30, "SecondGear", "555-555-0100");
SiteProperties typo = new SiteProperties("http://book.secondgear.org", 2, true, null,
Duration.ofMinutes(2), 300, "", "555 555 0100");
for (var p : List.of(prod, typo)) {
List<String> errors = validate(p);
System.out.println(errors.isEmpty() ? "configuration valid; starting"
: "refusing to start, " + errors.size() + " problem(s):\n " + String.join("\n ", errors));
}
}
}configuration valid; starting refusing to start, 6 problem(s): site.base-url must use https: http://book.secondgear.org reminders.send-at is missing waitlist.hold must be between 15 minutes and 6 hours: PT2M retention.days must be 1 to 90 (N4 says 30) sms.sender is missing site.shop-phone must look like 555-555-0100
What this code does
Every check produces a message that names the property and says what is allowed, so the person reading the start-up log knows exactly what to fix. The checks are collected rather than stopping at the first, because a configuration with five mistakes should not need five deployments to find them. The second set of values contains the kinds of slip seen in practice: plain HTTP, a missing value, minutes typed for hours and an extra zero.
In Spring Boot the same checks are annotations on a configuration properties record, validated when the application starts. A failed validation stops the start-up with a message listing each property, and in a blue-green deployment the new color never becomes ready, so the deployment script stops it and the old color carries on.
@Validated
@ConfigurationProperties(prefix = "site")
public record SiteProperties(
@NotNull @Pattern(regexp = "https://.+") String baseUrl,
@NotBlank @Pattern(regexp = "\\d{3}-\\d{3}-\\d{4}") String shopPhone,
@Valid @NotNull Reminders reminders,
@Valid @NotNull Waitlist waitlist) {
public record Reminders(@NotNull LocalTime sendAt) {}
public record Waitlist(@NotNull @DurationMin(minutes = 15) @DurationMax(hours = 6) Duration hold,
@Min(1) @Max(5) int addsPerNumberPerWeek) {}
}What this code does
@Validated makes Spring run Bean Validation on the record after binding the properties, and @Valid on the nested records validates them too. Durations are written in the configuration as values like 2h or PT2H and bound to java.time.Duration, and the Hibernate Validator annotations DurationMin and DurationMax check their range. A value that breaks a rule stops the application with a message naming the property, such as site.waitlist.hold.
site:
base-url: https://book.secondgear.org
shop-phone: 555-555-0100
reminders:
send-at: "18:00"
waitlist:
hold: 2h
adds-per-number-per-week: 3
booking:
per-phone-limit: 2
per-phone-limit-enabled: true
retention:
days: 30
sms:
sender: SecondGear
api-key: ${SMS_API_KEY} # from /run/secrets through configtree, never in this fileWhat this code does
Only values that are the same in every environment, or have safe defaults, live in the image's application.yml; this is the production profile's file, which overrides them. The SMS key is a placeholder filled from the secrets directory that the deployment course set up, so the file can be reviewed and committed safely. The per-phone limit flag, off by default since 1.5.0, is switched on here for production.
The new host name
Caddy needed one new block. The booking API's block already proxied api.secondgear.org to whichever color was live, through an upstream file that the switch script rewrites. The website's block uses the same upstream, so a switch moves both host names at once, which is exactly what one service with two adapters needs. Caddy obtains the certificate for the new name automatically the first time it is requested, which Leif triggered by hand on the afternoon of the release so that the first customer would not wait for it.
api.secondgear.org {
import upstream.caddy # rewritten by switch.sh: reverse_proxy booking-api-blue:8080 or -green
}
book.secondgear.org {
encode zstd gzip
header {
Strict-Transport-Security "max-age=31536000"
-Server
}
@management path /actuator/*
respond @management 404
import upstream.caddy
}What this code does
The website's block compresses responses, adds the HSTS header and removes the Server header, while the application sets the content security policy and the other headers from lesson 9. Actuator already listens only on the management port, which Caddy never proxies, and the respond line makes sure that even a misconfiguration could not expose it on the public name. Both blocks import the same upstream file, so a single switch moves the API and the website together.
Rehearsing on staging
On Thursday, August 3, the team rehearsed the release on staging, with Leif watching and Odile following on her phone. They tagged a release candidate, v1.6.0-rc.1, which the release workflow deployed to staging but not to production, because the workflow treats a tag with a pre-release suffix as staging only. The rehearsal had a script, written as a checklist in the repository, and each step had an expected result written down before it was run.
| Step | Expected | Result on Aug 3 |
|---|---|---|
| Tag v1.6.0-rc.1; release workflow runs | Image published; staging deployed blue-green | As expected; 11 min |
| Flyway applies V7 to V11 | Five migrations, seconds | 1.9 s on staging's 4,000 generated bookings |
| Smoke tests on the new color | All pass before the switch | Passed after a fix to the test itself |
| Book, cancel and join the waiting list from a phone | Texts arrive at the team's test phone | As expected; reminder at 18:00 the next day |
| Switch back to the previous color | Old version serves the website as a 404 and the API as before | As expected; 3 s |
| Switch forward again | New version serves both | As expected |
| Stop the database for one minute | Readiness DOWN, alert in 2 min, recovery without restart | Alert in 1 min 50 s; recovered |
| Check the outbox job in both colors | Only one color sends | As expected; leader lock held by green |
The smoke test fix was instructive. The new smoke test for the free-times page checked that the page contained at least one link to a start time, but for the rehearsal Thierry had generated a fully booked fortnight to exercise the waiting list, and the page showed Closed or fully booked under every day. The test had passed for a week only because the ordinary generated data always left some starts free. Hamza changed it to check the page's structure, its title and heading, and to fetch one known-free start from the API, so that it no longer depended on how full the shop was.
The migrations' timing deserved a thought too. Production held about 2,300 bookings, fewer than staging's generated 4,000, so the migrations would be fast; but Thierry checked that none of them would lock the table for long, because the API serves bookings during the deployment. Adding a column with a constant default is a quick change to the table's definition in PostgreSQL since version 11, without rewriting every row, and adding a CHECK constraint can be done with NOT VALID and validated separately if a table is large. At this size neither mattered, but the release notes for Leif recorded that the question had been asked.
Smoke tests for the website
The pipeline's smoke tests from the deployment course checked the API: readiness, the version on the info endpoint and a real slots request. The team added the website's own checks, which run against the new color before the switch. They check what only a deployed copy can show: that the templates are inside the image, that the security headers are set by the real configuration, that the staff pages really require a sign-in and that the management endpoints are not on the public port. The example runs the same checks against a small server standing in for the new color.
import com.sun.net.httpserver.*;
import java.net.*;
import java.net.http.*;
import java.util.*;
public class Main {
static HttpServer fakeNewColor() throws Exception {
HttpServer s = HttpServer.create(new InetSocketAddress("127.0.0.1", 0), 0);
s.createContext("/", ex -> {
String path = ex.getRequestURI().getPath();
Headers h = ex.getResponseHeaders();
h.set("Content-Security-Policy", "default-src 'self'; frame-ancestors 'none'");
h.set("X-Content-Type-Options", "nosniff");
int status; String body = "";
if (path.equals("/")) { status = 200; h.set("Content-Type", "text/html"); body = "<title>Book a repair - Second Gear Cycles</title><h1>Book a repair</h1>"; }
else if (path.startsWith("/staff")) { status = 302; h.set("Location", "/staff/login"); }
else { status = 404; body = "Not found"; }
byte[] b = body.getBytes();
ex.sendResponseHeaders(status, b.length == 0 ? -1 : b.length);
if (b.length > 0) try (var o = ex.getResponseBody()) { o.write(b); }
});
s.start();
return s;
}
record Check(String name, String path, int status, String headerOrBody, String expect) {}
public static void main(String[] args) throws Exception {
HttpServer green = fakeNewColor();
try {
String base = "http://127.0.0.1:" + green.getAddress().getPort();
HttpClient c = HttpClient.newHttpClient();
List<Check> checks = List.of(
new Check("free-times page renders", "/", 200, "body", "<h1>Book a repair</h1>"),
new Check("content security policy set", "/", 200, "Content-Security-Policy", "default-src 'self'"),
new Check("staff pages need sign-in", "/staff/today", 302, "Location", "/staff/login"),
new Check("actuator not public", "/actuator/health", 404, "body", ""),
new Check("unknown page is 404", "/wp-login.php", 404, "body", ""));
int failed = 0;
for (Check ch : checks) {
HttpResponse<String> r = c.send(HttpRequest.newBuilder(URI.create(base + ch.path())).build(), HttpResponse.BodyHandlers.ofString());
String actual = ch.headerOrBody().equals("body") ? r.body() : r.headers().firstValue(ch.headerOrBody()).orElse("");
boolean ok = r.statusCode() == ch.status() && actual.contains(ch.expect());
if (!ok) failed++;
System.out.println((ok ? "pass " : "FAIL ") + ch.name() + " (" + r.statusCode() + ")");
}
System.out.println(failed == 0 ? "smoke tests passed: switch traffic" : failed + " failed: keep the old color");
} finally {
green.stop(0);
}
}
}pass free-times page renders (200) pass content security policy set (200) pass staff pages need sign-in (302) pass actuator not public (404) pass unknown page is 404 (404) smoke tests passed: switch traffic
What this code does
The stand-in server behaves like a correctly configured new color: the free-times page with its heading, security headers on every response, a redirect to the sign-in page for staff paths and a 404 for anything else, including the management endpoints. Each check names the status it expects and either a header or a fragment of the body, and an empty expected fragment matches any body. The last check is there because the public site will be probed by automated scanners from its first hour, and a page that answered such paths with anything but 404 would be worth investigating.
Release notes
The deployment course had taught the team to write release notes from the commit history, grouped by type. For 1.6.0, which would be read by Odile, Tamsin, Kofi and the counter volunteers as well as Leif, the team grouped the notes by story instead, using the Refs footers, and added a short section in plain words at the top. A generator did the grouping; a person wrote the plain words.
import java.util.*;
import java.util.regex.*;
public class Main {
public static void main(String[] args) {
Map<String, String> storyTitles = new TreeMap<>(Map.of(
"US-01", "See free times", "US-02", "Book a repair", "US-03", "Find and cancel a booking",
"US-04", "Two upcoming bookings per phone", "US-06", "Staff day list and check-in",
"US-07", "Reminder texts", "US-08", "Waiting list", "US-09", "Weekly figures"));
String log = """
feat(site): free times page|Refs: US-01
feat(site): booking form with error summary|Refs: US-02
fix(site): keep typed values after an error|Refs: US-02
feat(app): cancel until two hours before|Refs: US-03
feat(site): staff day list with part warnings|Refs: US-06
feat(app): reminder texts at 18:00 the evening before|Refs: US-07
feat(app): waiting list with two-hour holds|Refs: US-08
fix(security): confirm phone before joining the waiting list|Refs: US-08
feat(site): weekly figures for managers|Refs: US-09
chore: bump Gradle wrapper|
fix(security): lock staff accounts after five failures|
""";
Pattern p = Pattern.compile("^(\\w+)\\(?([\\w-]*)\\)?: (.+)\\|(?:Refs: (US-\\d{2}))?$");
Map<String, List<String>> byStory = new TreeMap<>();
List<String> other = new ArrayList<>();
for (String line : log.strip().split("\n")) {
Matcher m = p.matcher(line.strip());
if (!m.matches()) continue;
String entry = (m.group(1).equals("fix") ? "Fixed: " : "") + m.group(3);
if (m.group(4) != null) byStory.computeIfAbsent(m.group(4), k -> new ArrayList<>()).add(entry);
else if (!m.group(1).equals("chore")) other.add(entry);
}
System.out.println("## 1.6.0 (2028-08-10)");
for (var e : byStory.entrySet()) {
System.out.println("### " + e.getKey() + " " + storyTitles.get(e.getKey()));
e.getValue().forEach(x -> System.out.println("- " + x));
}
System.out.println("### Other changes");
other.forEach(x -> System.out.println("- " + x));
}
}## 1.6.0 (2028-08-10) ### US-01 See free times - free times page ### US-02 Book a repair - booking form with error summary - Fixed: keep typed values after an error ### US-03 Find and cancel a booking - cancel until two hours before ### US-06 Staff day list and check-in - staff day list with part warnings ### US-07 Reminder texts - reminder texts at 18:00 the evening before ### US-08 Waiting list - waiting list with two-hour holds - Fixed: confirm phone before joining the waiting list ### US-09 Weekly figures - weekly figures for managers ### Other changes - Fixed: lock staff accounts after five failures
What this code does
Each line of the log is a commit subject and its Refs footer joined by a bar, which is how the release workflow's git log format prints them, and one regular expression splits out the type, scope, summary and story. Commits are grouped under their story's title in story order, fixes are marked, and chores, which matter to developers but not to the shop, are left out. A commit with no story, such as the lockout fix from the security review, goes under Other changes, so nothing user-visible disappears from the notes.
Release night
On Thursday, August 10, Hamza pushed the tag v1.6.0 at 18:40, after the repair night had begun in the workshop next door. The release workflow built and published the image, created the GitHub release with the notes, deployed it to staging and stopped at the production environment's approval. The approvers were Leif and, since the deployment course's review, Kofi. At 19:30 Leif approved it on his phone, standing by the workbench, and Kofi added a thumbs-up for form.
./deploy.sh 1.6.0pulling ghcr.io/second-gear/booking-api:1.6.0 digest sha256:c41f7e2a...b08d starting booking-api-green (1.6.0) flyway: migrating schema "public" from version 6 to 11 (5 migrations, 0.6 s) waiting for readiness on green ... UP after 11 s smoke tests on green: pass /actuator/health/readiness (200) pass /actuator/info version 1.6.0 (200) pass /api/v1/repair-slots?date=2028-08-12 (200) pass site: free-times page renders (200) pass site: content security policy set (200) pass site: staff pages need sign-in (302) pass site: actuator not public (404) switching api.secondgear.org and book.secondgear.org to green traffic now on green recorded: 1.6.0 green sha256:c41f7e2a...b08d (previous 1.5.0 blue)
What this code does
This is the release job's deployment step, the same script as in the deployment course, run on the shop server through the restricted deploy key. Blue was running 1.5.0, so 1.6.0 went to green; Flyway ran the five migrations when green started, and the smoke tests included the website's new checks. The output is representative of the real run, which was not recorded from the course machine.
After the switch, the team followed the checks they had written in the release checklist. Leif compared the recorded digest with the one the release workflow had published. Thierry opened the dashboard: the free-times page's p95 at 41 ms, no errors, the outbox empty. Noemi loaded every public page on her phone and on the shop's old counter computer. Kofi signed in to the staff page from the counter computer and found Saturday's bookings, the phone bookings from the past week, listed with the problems the counter had typed in. At 19:52 Hamza posted the release notes in the shop's channel, as the deployment course's review had asked.
The first real booking on the website arrived at 21:04 the same evening, from a repair-night regular who had been told about the site twenty minutes earlier, for a tune-up on Saturday morning. She ticked the reminder box. Odile, who had gone home, saw the booking on the staff page on her phone, and sent the team a message with three exclamation marks, which Ingrid said was the highest praise she had seen Odile give anything.
A soft launch
The website was live but not yet announced. The team and Odile had agreed on a soft launch: for the first weeks, the address would be shared only with repair-night regulars, on a card at the counter and on the shop's phone message, but not on the shop's social media or the main website. A small number of real users would find the problems that tests and the usability test had missed, at a volume the team could watch closely, before the public launch on Tuesday, September 26, after the autumn term began. Feature flags made one more step possible: the waiting list was switched off in production for the first week, so that the team could watch bookings and cancellations alone before adding offers to the mix.
| Date | Step | Flag or setting |
|---|---|---|
| Thu Aug 10 | 1.6.0 in production; address shared with repair-night regulars | booking.per-phone-limit-enabled = true |
| Sat Aug 12 | Card at the counter; phone message mentions the website | |
| Thu Aug 17 | Waiting list switched on after a week without problems | waitlist.enabled = true |
| Tue Sep 26 (plan) | Public launch: shop website, social media, newsletter |
Leif's last remark of the night was about what had not happened. Nothing had needed fixing by hand, nobody had connected to the server with SSH, and if 1.6.0 had failed its smoke tests, blue would have kept serving the API and the website would simply not have appeared. Rolling back was one command and three seconds, and because every migration was expand-only, version 1.5.0 would run happily on the new schema. That was the whole point of the spring's pipeline: a release night where the most interesting event was a tune-up booked online.
Exercises
Try it yourself
Fail fast on bad settings
Each setting is name=value. Complete problems so that it returns a message for each rule broken, in this order: base-url must start with https://; per-phone-limit must be an integer of at least 1; hold-minutes must be an integer from 15 to 360; sender must be present and not blank. A missing setting counts as broken.
import java.util.*;
public class Main {
static List<String> problems(Map<String, String> s) {
return List.of();
}
static Map<String, String> parse(String text) {
Map<String, String> m = new LinkedHashMap<>();
for (String line : text.split("\n")) { String[] p = line.split("=", 2); m.put(p[0].trim(), p.length > 1 ? p[1].trim() : ""); }
return m;
}
public static void main(String[] args) {
System.out.println(problems(parse("base-url=https://book.secondgear.org\nper-phone-limit=2\nhold-minutes=120\nsender=SecondGear")));
System.out.println(problems(parse("base-url=http://book.secondgear.org\nper-phone-limit=two\nhold-minutes=2\nsender=")));
System.out.println(problems(parse("base-url=https://book.secondgear.org\nhold-minutes=400")));
}
}Try it yourself
Group release notes by story
Each commit is subject|story, where story may be empty. Complete main so that it prints each story in order as ## US-NN, followed by its subjects as - subject, and then ## Other with the subjects that have no story, leaving out subjects that start with chore.
import java.util.*;
public class Main {
public static void main(String[] args) {
List<String> commits = List.of("feat(site): booking form|US-02", "feat(site): free times page|US-01",
"fix(site): keep typed values|US-02", "chore: bump wrapper|", "fix(security): lock staff accounts|",
"feat(app): reminder texts|US-07");
for (String c : commits) System.out.println(c);
}
}Common mistakes
MistakeAssuming a release changes only the code.
InsteadList every change: image, migrations, configuration, proxy, jobs and monitoring, with the risk of each.
MistakeRunning scheduled jobs in every copy during blue-green deployment.
InsteadGuard each job with a leader lock so exactly one copy does the work.
MistakeStarting with a missing or impossible setting.
InsteadValidate configuration at start-up and refuse to start, naming every bad property.
MistakeSmoke tests that depend on the data of the day.
InsteadCheck structure and known facts, not content that changes with how full the shop is.
MistakeAnnouncing a new site on its first night.
InsteadSoft-launch to a small group, watch closely and switch features on one at a time with flags.
MistakeRelease notes only developers can read.
InsteadGroup them by what users can do, add a plain-language summary and post them where the users are.
Summary and key terms
- Version 1.6.0 shipped the website through the existing pipeline: one image, migrations V7 to V11, new configuration, one more Caddy block and new monitoring.
- Scheduled jobs take a PostgreSQL advisory lock so only one color sends reminders during and after a blue-green switch.
- Configuration is bound to validated properties and the service refuses to start, naming each bad setting, so a misconfigured color never receives traffic.
- The Caddy block for book.secondgear.org imports the same upstream as the API, so one switch moves both, and blocks the management paths.
- A rehearsal on staging with a release candidate tested migrations, smoke tests, texts, switching back and forward, a database outage and the job lock, and fixed a smoke test that depended on the data.
- The website's smoke tests check rendering, security headers, sign-in redirects and that management endpoints are not public.
- Release notes were grouped by story with a plain-language summary.
- On August 10 the deployment ran without manual steps, the first real online booking came at 21:04, and a soft launch with feature flags led towards the public launch planned for September 26.
- Release checklist
- A written list of the changes in a release, the steps to deploy it and the checks afterwards.
- Leader lock
- A lock that lets only one running copy perform a job at a time.
- Advisory lock
- A PostgreSQL lock on a number chosen by the application rather than on a table or row.
- Fail fast
- Refusing to start, or stopping at once, when a required condition is not met.
- Release candidate
- A version tagged for final testing before the release, such as 1.6.0-rc.1.
- Rehearsal
- Running a deployment on staging with expected results written down in advance.
- Smoke test
- A few requests that prove a deployed copy works with its real configuration.
- Release notes
- A summary of what changed in a release, written for the people who use it.
- Soft launch
- Making a new service available to a small group before announcing it publicly.
- Feature flag
- A setting that switches a feature on or off without deploying new code.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Why would reminders have been sent twice without the leader lock?
Show answer
Both colors run during and after a blue-green switch, and each would have run the reminder job.
Why does failing fast on configuration suit blue-green deployment?
Show answer
A copy that refuses to start never becomes ready, so it never gets traffic and the old copy keeps serving.
What was wrong with the first website smoke test?
Show answer
It looked for text that disappears when every day is fully booked, so it depended on the data.
Why were the release notes grouped by story?
Show answer
Shop staff read them, and stories describe what users can do rather than how the code changed.
Why was the waiting list switched off for the first week in production?
Show answer
To watch bookings and cancellations alone before adding offers, so problems would be easier to trace.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.