Elasticity and right-sizing
You pay for what you provision, so make it follow demand
A fleet sized for the peak runs 576 instance-hours a day; auto scaling needs 387. 33% of the fixed hours are idle.
In a data centre, idle servers were already paid for. In the cloud, every idle hour is a fresh bill. Here is one day of demand for a small service: ten servers at night, rising to 24 in the afternoon. With auto scaling, that is 387 instance-hours. A fleet sized for the peak and left running is 576. So 33% of what you pay for does nothing. Make capacity follow demand, right-size servers that are bigger than their work, and switch off what nobody is using.
Data transfer · Going deeper
Bytes come in free and pay to leave or cross a boundary
Data transfer is charged out to the internet, between zones and between Regions: here $1,016 a month, $400 of it between zones.
Purchase options
Commit for the floor, pay on demand for peaks, use Spot for what can wait
Savings Plans for the always-on floor, On-Demand for peaks, Spot for interruptible batch: $31.39 a day instead of $41.43.
Now split the same day by how certain each slice is. Ten servers run all day, every day, so commit to them with a Savings Plan and take the discount. The daytime extra comes and goes, so pay for it on demand. The night batch job can be interrupted and restarted, so run it on Spot capacity, at a fraction of the price. Matched like this, the day costs 24% less than paying on demand for everything. Commit only to the floor you are sure of.
Storage classes · Going deeper · 1 of 2
Rarely read data should not pay for instant access
100 TB for a year: $27,600 in S3 Standard, $1,188 in Glacier Deep Archive. Lifecycle rules move data down as it ages.
Commitments compared · Going deeper · 2 of 2
The deeper the discount, the less you may change
A Compute Savings Plan follows you across families, Regions, Fargate and Lambda; a Reserved Instance locks a configuration for a little more.
Observability
Metrics say something is wrong; traces say where the time went
Metrics, logs and traces answer different questions. This trace shows 170 of 240 ms in one external call.
You cannot operate what you cannot see. Metrics are numbers over time, and they raise the alarm. Logs record each event, for when you know what to search for. Traces follow one request through every service. Here is a trace of a checkout that took two hundred and forty milliseconds. Web, orders, inventory, payments, and the database write. And there it is: 170 milliseconds waiting on the card network. No amount of tuning the database would have helped. Alarm on what users feel, error rates and slow responses, and trace across services to find the cause.
SLOs and error budgets · Going deeper · 1 of 2
An SLO turns “reliable enough” into a budget you can spend
A 99.9% SLO over 30 days is an error budget of 43.2 minutes.
Tools on three clouds · Going deeper · 2 of 2
Nine operating questions, and the tool that answers each
CloudTrail says who changed it, Config what it looked like, Budgets whether you will overspend; Azure and Google have one of each.
The Well-Architected Framework
Six pillars, because a fix for one is often a cost to another
The six pillars: operational excellence, security, reliability, performance efficiency, cost optimization and sustainability.
Everything in this course comes together in one checklist. Operational excellence: can you change, watch and recover as a matter of routine? Security: is every layer protected, and every action traced? Reliability: does it survive failures and recover by itself? Performance efficiency: are the resources the right kind and size as demand changes? Cost optimization: do you pay only for what delivers value? And sustainability: does it use the least energy and hardware for the work? The value is in the trade-offs between them, made on purpose.
Design review
A review turns “is it good?” into a ranked list of risks
Walk a design through every pillar, record the risks, and fix the high ones first.
Here is a real review. The design is one server in a public subnet, running both the application and its database, with a nightly snapshot. Pillar by pillar, the findings appear. Security: the SSH port is open to the internet, and access keys sit in the code. Reliability: one server in one zone, and the backups have never been restored. Performance: the app and the database fight over one machine. Cost: it is sized for the peak and paid on demand. Operations: every change is made by hand. Sustainability: it idles all night. Each finding has a fix you now know, and the high risks come first.
Lesson complete
You finished “Cost, operations and reviewing a design”
Nicely done.