Exercise 2: Matching Workloads to Pricing Models — Possible Solution ==================================================================== (a) A batch video-transcoding job that checkpoints its progress and can safely restart if interrupted. -> SPOT / PREEMPTIBLE. Per the chapter, spot instances are "an excellent fit for fault-tolerant, interruptible workloads" -- this job explicitly checkpoints and can restart safely, which is exactly the property that makes the risk of reclamation acceptable. The deep discount is worth taking here because an interruption costs, at most, some lost progress since the last checkpoint -- not a failed job. (b) A database server that needs to run continuously for the next two years. -> RESERVED / COMMITTED USE. The chapter describes reserved pricing as "appropriate for predictable, always-on workloads," and a two-year continuous commitment is about as predictable as a workload gets. Using on-demand pricing here would mean paying the highest per-hour rate for something that was never going to change, while spot pricing would risk this database being reclaimed mid-operation -- a serious problem for a stateful, always-on service the chapter's own warn-box specifically flags spot instances as a bad fit for. (c) An unpredictable dev/test environment used only sporadically. -> ON-DEMAND. Reserved pricing requires a 1-3 year commitment, which doesn't fit a workload with no predictable, steady usage pattern -- committing to reserved pricing here would likely mean paying for capacity that sits unused much of the time. Spot pricing isn't obviously wrong here either, but on-demand's "full flexibility, no commitment" nature is the most natural fit for genuinely unpredictable, occasional usage where neither a long-term commitment nor an interruption risk buys anything. WHY THIS WORKS AS AN ANSWER ------------------------------ Each recommendation matches the workload's defining property directly to the pricing model the chapter associates with that property: interruption-tolerant -> spot, predictable/long-term -> reserved, genuinely unpredictable/short-term -> on-demand. The reasoning for (b) specifically also applies the chapter's own warn-box in reverse -- recognizing that a stateful, always-on service is precisely the case spot pricing was called out as being a poor match for.