Chaya·Edu EDU.CHAYA.DEV

Sessions 25–26 · Notes 14

The Bill Arrives

The park runs. The robot can rebuild it from a file. The gauges are green. And then, on the first of the month, the one gauge nobody put on the dashboard reports in: the bill. The meter from Notes 01 was never off — tonight we finally read it like adults: where the money actually goes, how much park should exist, whether to rent from one landlord or two, and what it costs to rent a brain.

Week 14 Mon & Wed 30 Nov & 2 Dec 2026 16:00–17:50 Google Meet Instructor Prof. Yair Chaya This week capstone in progress — nothing due Reading ~20 min

01The Bill Arrives

Last week ended with a promise: the meter gets the last word. Here is why it always does. All semester you have been building in a park someone else owns — and back in Notes 01 we read the fine print on that deal: measured service. Everything is metered, by the second and by the gigabyte, and you pay for what you use. That one sentence is why the cloud exists at all. It is also why, while you were busy admiring your green gauges, a counter was quietly spinning behind every single thing you built.

Nothing about the bill is a betrayal. The meter never lied, never hid, never rounded up. It just counted — every hour a server existed, every gigabyte that sat in storage, every gigabyte that walked out the gate — and now it is showing you the total. The bill is not a punishment. It is a map. Every line on it is a design decision you made, with a dollar value attached, and tonight’s skill is learning to read that map the way you learned to read the gauges last week.

One warning before we start, and it’s the week’s whole theme: the bill never surprises you where you expect it to. The big servers you agonized over are rarely the problem. The money leaks out of the places nobody was looking — the machine nobody turned off, the data nobody deleted, and one line that shocks every single person the first time they see it. Let’s meet them.

Plate 1.1 — The gauge nobody put on the dashboardGreen gauges · one envelope
Three healthy dashboard gauges reading good latency, low errors, and comfortable CPU — and beside them an envelope containing the monthly bill for 420 dollars and 40 cents, labeled as the gauge nobody put on the dashboard p99 180 ms healthy errors 0.1% healthy CPU 40% healthy THE DASHBOARD: ALL GREEN. SLEEP WELL. $420.40 the monthly bill the gauge nobody put on the dashboard the meter was never off — it was counting every second of every green gauge

02Where the Money Actually Goes

Meet the bill we’ll use all night. It belongs to the photo shop you’ve been building all term, as it probably looks by week 14: two web servers, a database, a development copy of the park for trying things, 500 GB of customer photos, and customers downloading those photos. One note on the numbers, once: every price in these notes is a ballpark teaching number — real price lists vary by provider and region — but the arithmetic is exact, and the shape of this bill is painfully true to life. We’ll use a 30-day month throughout, same as Notes 13: 30 days = 720 hours.

the photo shop — monthly bill, line by line (30-day month = 720 h)
line         what the meter counted              charge
web servers  2 × $0.04/h × 720 h          $ 57.60
database     1 × $0.10/h × 720 h          $ 72.00
dev park     ($0.04 + $0.10)/h × 720 h    $100.80
storage      500 GB × $0.02/GB (hot)      $ 10.00
egress       2,000 GB out × $0.09/GB      $180.00
────────────────────────────────────────────────────
TOTAL                                     $420.40

Read it top to bottom and notice what’s strange. The web servers — the thing you think of as “the system” — are one of the smallest lines. The two biggest lines are a machine nobody uses at night and data nobody thinks of as costing anything. That’s the pattern on almost every real cloud bill, so let’s take the surprises one at a time.

Surprise 1 — The parked car with the engine running

In Notes 01 the per-second meter sounded like pure good news: no more buying servers for Black Friday that idle all year. But the meter cuts both ways. A cloud server is billed for existing, not for working. Your gauges (Notes 13) say the web servers sit at 12% CPU — meaning you are paying full price for machines that are seven-eighths asleep. A parked car with the engine running burns gas at zero miles per hour; an idle instance burns dollars at zero requests per second. Nothing is broken. No alarm will ever ring. The meter just counts the hours.

Surprise 2 — The forgotten dev park

The dev park is a copy of the shop for trying things safely — one web server plus one database, $0.14 an hour, $100.80 a month. The team touches it on weekdays, nine to six: about 180 of the month’s 720 hours. So the useful part of that line is 180 h × $0.14 = $25.20 — and the other $75.60 is an empty room with the lights on, every night and every weekend. Notes 12 warned you about this exact ghost: the forgotten test instance billing quietly since March. The meter doesn’t know the room is empty. It just counts.

Surprise 3 — Storage never deletes itself

Ten dollars for storage looks innocent — and this month it is. The trap is the trend: servers get turned off; data only accumulates. Every photo ever uploaded is still in the bucket, and most are never opened again. Providers know this, so storage comes in temperature tiers — the price drops the more patience you promise:

hot · $0.02/GB·mo

Opened daily

Instant access, full price. The 500 GB here: $10.00/month. This is where fresh photos belong — and where everything sits by default, forever, unless you act.

warm · $0.01/GB·mo

Opened monthly

Half price for data you touch now and then. The same 500 GB: $5.00. Slightly slower, slightly cheaper — the middle shelf.

cold · $0.004/GB·mo

Opened rarely

A fifth of hot’s price — 500 GB for $2.00 — but reads are slower and you pay a small fee to retrieve. For last year’s photos.

freezer · $0.001/GB·mo

Opened almost never

500 GB for $0.50 — but thawing takes hours and retrieval costs real money. For archives the law makes you keep, not for anything a customer waits on.

Run the shop’s numbers: of its 500 GB, about 400 GB are photos older than a year that nobody opens. Move those to cold and keep 100 GB hot: 100 × $0.02 = $2.00, plus 400 × $0.004 = $1.60 — $3.60 instead of $10.00. Small this month; decisive once the bucket holds ten terabytes.

Surprise 4 — Egress: leaving costs money

And now the line that shocks everyone. Look at the bill again: the single biggest charge — $180, about 43 cents of every dollar — is egress: data walking out of the park. The rule is beautifully one-sided: data walking in is free. Data walking out costs money — ballpark $0.09 per GB. Your customers downloaded 100,000 photos this month at about 20 MB each; that’s 2,000 GB walking out the gate, and the meter clicked $0.09 for every one of them. Uploads? Free. The landlord wants your data to move in.

Plate 2.1 — The turnstile only charges one wayIn free · out $0.09/GB
The park drawn as a box. A blue arrow of data enters from the left through an open gate marked free. An amber arrow of data exits on the right through a tollbooth charging nine cents per gigabyte. Beneath, the arithmetic: one hundred thousand downloads of twenty megabytes each equals two thousand gigabytes, which costs one hundred eighty dollars the park your shop · your bucket of photos 500 GB of photos DATA IN — FREE uploads, backups moving in — the landlord holds the door open the toll gate DATA OUT $0.09 / GB 100,000 downloads × 20 MB = 2,000 GB out → 2,000 × $0.09 = $180.00 the biggest line on the bill never appears on an architecture diagram
Why is leaving expensive?

Partly real cost — moving bytes across the internet isn’t free for the landlord either. But hold the thought for section 05: data that is expensive to move out is data that stays, and data that stays keeps you renting. The toll gate is also a moat. Remember it when someone says “we’ll just switch providers.”

03Shrinking the Bill Without Shrinking the Shop

Good news: every surprise has a counter-move, and none of them is “make the shop worse.” Each one is a sentence long, and each works for a reason you already know from earlier notes:

move 1 · right-size

Let the gauges pick the box

The gauges from Notes 13 say the truth: 12% busy means the box is too big. Halve it. Web servers $57.60 → $28.80. Saves $28.80.

move 2 · sleep schedule

Dev parks sleep at night

The robot (Notes 12) can tear the dev park down at 6 p.m. and rebuild it at 9 a.m. — it’s just a recipe. Pay for 180 h, not 720: $100.80 → $25.20. Saves $75.60.

move 3 · season ticket

Promise a year, pay less

Reserved (committed-use) pricing: promise the landlord the database runs all year and get ~40% off the gate price. $72.00 → $43.20. Saves $28.80.

move 4 · standby ticket

Cheap seats, revocable

Spot instances: ~70% off, but the landlord can take the seat back on minutes’ notice. Perfect for thumbnail workers — their notes wait on the door (Notes 11). Never for checkout.

move 5 · lifecycle rule

Storage cools on a timer

One written rule — “untouched for 90 days → cold” — and the robot enforces it forever. Storage $10.00 → $3.60. Saves $6.40 now; saves a fortune at scale.

move 6 · cache at the gate

Stop paying the toll

The CDN from Notes 05 keeps copies of popular photos at the edge. Nine of ten downloads never cross the toll gate: 1,800 GB × $0.02 + 200 GB × $0.09 = $54. Saves $126.

Now watch what the six sentences do to the bill. Same shop, same customers, same photos, nothing a user could notice:

the same bill, after the six moves — same shop, same traffic
line         what changed                        charge
web servers  right-sized: 2 × $0.02/h × 720 h   $ 28.80
database     season ticket: $72.00 × 0.6        $ 43.20
dev park     sleeps nights: $0.14/h × 180 h     $ 25.20
storage      lifecycle: 100 hot + 400 cold      $  3.60
egress       CDN: 1,800 GB edge + 200 GB toll   $ 54.00
────────────────────────────────────────────────────
TOTAL        was $420.40                        $154.80
saved        28.80+75.60+28.80+6.40+126.00      −$265.60

That’s about 63% of the bill gone, and not one customer can tell. This is why cost work is engineering, not accounting — the inputs are your gauges, your robot, and your architecture. (Real companies now give this work a job title, FinOps, which is just “someone reads the map every week instead of once, in horror, in December.”)

Your turn. The shop had a good press week and the evening peak is now 600 requests per second. Below is the park with all six moves as switches. The mission: a bill under $250 that still FITS the peak — enough capacity for 600 req/s, but not more than 900 (peak + 50% headroom; more than that and you’re back to paying for parked cars). The verdict sign is watching.

Plate 3.1 — The bill explorerInteractive · serve 600 req/s under $250
web size:
web plan:
2 workers:
database:
storage:
cdn:
the itemized bill, live

    
FITS
Monthly total
—target: under $250
Web capacity
—vs 600 req/s peak
Vs target
—$250 budget

Two things to notice while you drive it. First, the cheapest FITS configurations all look alike: small boxes, several of them — big boxes overshoot the peak in expensive 400 req/s jumps, small ones let you land right on it. Second, the standby ticket is only offered where it’s safe: workers can be interrupted because their notes wait patiently on the door; the database can’t, because it is the memory (Notes 09). The explorer won’t even show you that trap, but real consoles will.

04How Much Park Should Exist?

The bill explorer kept asking one question in disguise: how much capacity should you buy? That question has a name — capacity planning — and it is older than the cloud. Notes 01’s 2004 retailer had it worst: buy for Black Friday, watch the fleet idle at 15% the other 360 days. The cloud shrank the timescale from “order hardware in March” to “click a button,” but it did not repeal the underlying problem, because traffic is a curve and capacity is a line.

Here’s the whole dilemma in one picture. Customers arrive in a daily rhythm — quiet at 4 a.m., a sharp spike at 9 when everyone opens the app, a long busy evening. Whatever flat amount of park you provision, the curve disagrees with it twice:

Plate 4.1 — A curve versus a lineThe gap above = turned away · the gap below = money burned
A daily traffic curve with a morning spike and a tall evening peak, crossed by one flat provisioned-capacity line. Where the curve rises above the line, customers are turned away. Where the curve sits below the line, paid-for capacity idles midnight 9 a.m. 7 p.m. midnight what you provisioned — a flat line the gap above = customers turned away an outage, during the busiest hour the gap below = money burned paid-for park, asleep at 4 a.m. a flat line loses both ways — the only choice is which way you’d rather lose, and by how much

So capacity planning is not “guess right.” It is choosing your losses on purpose. Provision above the peak and the gap below is headroom — deliberately purchased insurance, the industry habit being peak plus 15–50% depending on how badly a turned-away customer hurts. Provision at the average and you’ve scheduled an outage for every evening. Neither is wrong until you pick one by accident.

Notes 03 taught you the modern answer: autoscaling — let the capacity line copy the curve, with a little headroom. It genuinely works, and it is genuinely not magic, so here are its honest limits — the three sentences every vendor slide leaves out:

limit 1 · reaction time

Scale-up takes minutes

A new server must be created, booted, and warmed. The 9 a.m. spike takes seconds. If the spike is faster than the reaction, customers are turned away while help is still lacing its boots.

limit 2 · the memory

Databases don’t autoscale gracefully

Stateless shop fronts copy beautifully (Notes 08’s manager does it all day). The database is the park’s memory, and memory is sticky — growing it is a planned event, not a reflex (Notes 09).

limit 3 · the big day

Black Friday is planned, not autoscaled

A 20× day isn’t “more autoscaling” — quotas, warm capacity, and the landlord’s own limits are negotiated months ahead. You literally call ahead. Autoscaling absorbs weather, not earthquakes.

Now drive the trade yourself. Same shop, one simulated day of its traffic (the evening peak hits 300 req/s). In flat mode, pick where the line sits and watch what each choice costs — in turned-away customers and in idle dollars. Then switch to autoscale and give the autoscaler a realistic reaction delay: watch the morning spike slip through before capacity arrives.

Plate 4.2 — Choose your lossesInteractive · flat line vs autoscaler with a reaction delay
capacity:
demand — one day, peak 300 req/s capacity (what you pay for) turned away paid-for idle
Peak demand
300req/s, at 7 p.m.
Turned away
—requests / day
Idle spend
—per month, burned

Three experiments worth your time. Flat at 150 (about the daily average): millions of requests turned away every day — provisioning for the average schedules an outage nightly. Flat at 300: nobody turned away, and a steady idle bill all night — that’s what headroom costs, and sometimes it’s worth every cent. Autoscale with a 45-minute delay: the evening hill is handled beautifully, but the sharp 9 a.m. spike beats the autoscaler to the door — capacity arrives after the customers did. That morning miss is why real teams schedule a scale-up at 8:30 instead of waiting for the gauges: the calendar knows about 9 a.m. before the CPU does.

05One Landlord or Several?

Somewhere around week 14 of every cloud course, a hand goes up: “Aren’t we dangerously dependent on one provider? Shouldn’t we run on two?” That instinct deserves a straight answer, because the question is real and the popular answer is usually wrong. Running on more than one provider has a name — multi-cloud — and it sounds like freedom. Here is what it costs:

First, the toll. Your two parks have to talk to each other, and every byte between them walks out one toll gate and into the other park. Egress between clouds isn’t an occasional moving fee — it’s a permanent tax on your own internal traffic. Second, everything is built twice. Each landlord’s managed services — the rented memory, the notes on the door, the manager — have different names, different APIs, different failure modes. One shop, two sets of plumbing. Third, the team pays too: two consoles, two security models, two sets of 2 a.m. instincts. Expertise doesn’t copy-paste.

Plate 5.1 — Two landlords, one tenantThe toll bridge · everything twice · the clean exits
Two cloud parks side by side, each containing its own copy of the shop, queue, and database, connected by a toll bridge charging for every gigabyte in both directions. Below, the three clean exits: containers, the robot's recipe, and open standards LANDLORD A shop queue database its own names, APIs, console, quirks, and 2 a.m. instincts LANDLORD B shop queue database the same shop, built again, with different plumbing $0.09/GB each way everything built twice · a permanent toll on your own traffic · two of every skill THE CLEAN EXITS — WHAT KEEPS ONE LANDLORD HONEST the box containers run anywhere the recipe Terraform speaks every landlord open standards Postgres, S3 API, SQL, HTTP most teams: one landlord, clean exits, good sleep

Is lock-in real, then? Completely. The toll gate is a moat (section 02’s aside), and every house-brand service you adopt digs it deeper — moving 10 TB out is 10,000 GB × $0.09 = a $900 moving van, once, plus the rewrite. But notice the honest comparison: the moving van costs $900 once; running two parks costs extra every month, forever. So real engineers mostly don’t buy two apartments to avoid a moving fee. They keep the exits clean instead: the shop lives in containers (the box from Project 2 runs anywhere), the park is written as the robot’s recipe (Terraform speaks every landlord’s language — Notes 12), and the memory speaks an open standard (Postgres, not a house brand) where it matters. Lock-in you chose, with a priced exit, is a trade. Lock-in you drifted into is a trap.

When multi-cloud is actually right

It exists for reasons — a regulator or a huge customer demands it, one landlord has the only great version of a service you need, or a merger hands you a second cloud whether you like it or not. Fine. Just notice those are business reasons with a budget attached — not an engineer avoiding commitment. Most teams pick one cloud, keep their exits clean, and sleep fine.

06Renting a Brain

One shelf left in the landlord’s catalog, and it’s the newest: managed AI services. The deal is the same one this whole course has been about, applied to intelligence. You never built your own power plant — you rented compute. You never built your own database engine — you rented a memory (Notes 09). Now the landlord will rent you a brain, by the call: send a photo, get back labels (“beach, sunset, two people”); send audio, get back text; send text, get a translation; send a prompt to a large language model, get back a paragraph. You could wire any of these into your capstone tonight, with an API key and twenty lines of code.

The other end of the spectrum is training and hosting your own model. That end is the “running your own power plant” end: you need mountains of labeled data, GPUs by the rack, and people who do this for a living — and then you own a power plant that must be fed, patched, and upgraded forever. Between the two ends, the decision is not philosophy. It’s the same meter arithmetic as everything else this term. Worked example, photo shop edition:

The shop wants automatic captions on uploads. The rented vision service costs $2 per 1,000 calls — $0.002 a call. The shop gets 20,000 uploads a month: 20,000 × $0.002 = $40 a month. Self-hosting an open model needs a rented GPU box at about $0.95/hour — $0.95 × 720 = $684 a month, before a single hour of anyone’s expertise. The lines cross at $684 ÷ $0.002 = 342,000 calls a month. Below that volume, renting wins and it isn’t close. Above it, building starts to pay — if you have the people. Slide the traffic and watch:

Plate 6.1 — Rent a brain or build one?Interactive · the crossover lives at 342,000 calls
RENT
Rent-a-brain
—$0.002 × every call
Build your own
$684.00GPU box, $0.95/h × 720 h
Lines cross at
342,000calls / month ($684 ÷ $0.002)

Now the part that bites, and it is this course’s most elegant trap: per-call pricing means the bill grows with success. At 20,000 calls the captions cost $40 — a rounding error. If the feature goes viral and hits a million calls, the same line reads $2,000 a month — your happiest month is your most expensive one, and nothing broke, so no alarm you wired last week will ring. LLM APIs sharpen this further: they meter per token — roughly per word in and out — so a chatty feature’s bill scales with how much your users love talking to it. The defense is nothing new. You learned it in Notes 13:

A budget alarm is just another gauge

Spend-per-day is a metric like any other. Chart it, then wire the alert: IF this month’s spend crosses the expected line → ticket. IF it doubles overnight → page. The golden rule still holds — a surprise bill is something the customer (you, this time) feels. Every provider will run this alarm for you; you just have to ask.

And one sentence for the room, because it’s true: several of your capstones are standing at exactly this crossover right now — caption it, transcribe it, summarize it: rent or build? In week 15 I’ll ask you to defend your answer in one sentence, and “we rented, because 20,000 calls costs $40 and a GPU box costs $684” is a perfect one.

07Self-Check

Six quick questions. Pick an answer to see whether you’re right and why. Nothing is recorded; this is for you.

Score 0 / 0

08Before Session 27 — December 7

No new deliverable this week — the capstone is the deliverable. These are working items for it, and the list remembers your progress on this device. Presentations run December 7 & 9.

Bring to Session 27

Your capstone, as far as it’s gotten, and your one-sentence build-vs-rent defense. Next week is the last one: Notes 15 — architecture review and trade-offs — we put whole parks on the table and argue about them like engineers — and then your capstone presentations, December 7 & 9. Bring the park. Bring its bill.

09Key Terms

Egress
Data walking out of the park, billed per GB (~$0.09). Walking in is free. The bill line that shocks everyone — and the moat behind lock-in.
Idle spend
The parked car with the engine running: servers billed for existing, not for working. No alarm rings; the meter just counts the hours.
Storage tiers
Hot / warm / cold / freezer — the price per GB drops as the patience you promise rises. The freezer charges to thaw.
Lifecycle rule
A written policy the robot enforces forever: “untouched 90 days → cold.” How storage cools itself without anyone remembering to.
Right-sizing
Letting the gauges (Notes 13) pick the box size. A server at 12% busy is a bill at 100%.
Season ticket (reserved / committed use)
Promise the landlord a year and pay ~40% less than the gate price. For the steady core of the park, never the spiky edge.
Standby ticket (spot / preemptible)
~70% off, but the landlord can take the seat back on minutes’ notice. For interruptible work whose notes wait on the door — never for checkout, never for the memory.
Cache at the gate (CDN)
Copies of popular files at the edge (Notes 05) so most downloads never cross the toll gate. The single biggest egress cut.
Capacity planning
Deciding how much park should exist. Traffic is a curve, capacity is a line, and the flat line loses both ways.
Peak vs. average
Provision for the average and you schedule an outage every evening; provision for the peak and you pay for sleep. Pick your losses on purpose.
Headroom
Capacity above expected peak, bought deliberately — insurance with a known premium, usually peak +15–50%.
Autoscaling’s honest limits
Scale-up takes minutes, the database doesn’t copy itself, and Black Friday is negotiated months ahead. It absorbs weather, not earthquakes.
Multi-cloud
Renting from more than one landlord. Usually costs more than it saves: a toll on your own traffic, everything built twice, two of every skill.
Lock-in
The cost of leaving a landlord — the egress moving fee plus every house-brand service you’d have to rewrite. Real, and manageable if priced in advance.
Clean exits
Containers (the box runs anywhere), the robot’s recipes (Terraform speaks every landlord), and open standards. What keeps one landlord honest.
Rent-a-brain (managed AI service)
Vision, speech, translation, LLMs — intelligence by the call, usable tonight. The opposite end from training your own (data + GPUs + experts).
Per-call / per-token pricing
The meter applied to AI: every call (or roughly every word, for LLMs) clicks the counter. The bill grows with success.
Build-vs-rent crossover
The volume where renting stops being cheaper: fixed self-host cost ÷ per-call price. In our example, $684 ÷ $0.002 = 342,000 calls/month.
Budget alarm
Spend charted as a metric, wired to an alert (Notes 13). Crosses the expected line → ticket; doubles overnight → page.
FinOps
The job title for reading the bill as engineering, weekly — instead of once, in horror, in December.

10The Meter Gets the Last Word

Step all the way back, because this is the last ordinary lecture of the course. Fifteen weeks ago you were handed a strange deal: build whatever you want, in a park someone else owns, and a meter will watch everything you do. Since then you’ve rented rooms and memory, hired a manager, left notes on doors, taught a robot to rebuild the whole park from a text file, wired gauges to everything — and tonight you read the bill for all of it without flinching.

Notice what the meter turned out to be. Not a villain — the villain was the 2004 world, where capacity was a twelve-week bet and the price of being wrong was your launch. Not a tax — a contract, the most honest one in engineering: you only pay for what you use, so everything you use is a choice, and every choice has a number on it. The meter is why a student with a laptop can rent, for an evening, what used to take a datacenter and a loading dock. It was never the price of the dream. It was the thing that made the dream rentable.

So let it have the last word. It earned it — it’s been saying the same thing, every second, since September 2:

“You only pay for what you use.”

— the meter, Notes 01, and every second since. Spend accordingly, measure what you spend, and build something worth metering. See you at the architecture review — and then it’s your turn to present.