Cloud cost

Buying for the peak leaves half the capacity idle

servers needed each monthJanFebMarAprMayJunJulAugSepOctNovDecbought up front for the busiest month: 51% of it sits idle over the yearin the cloud you pay only for the purple barsCapEx buys capacity for the peak, years ahead. OpEx pays for what is used, month by month.Capital expenditure (CapEx) is a large purchase made up front. Operating expenditure (OpEx) is a runningcost. Moving to the cloud turns the first into the second. Total cost of ownership (TCO) is the faircomparison: it counts everything, including power, space, staff and idle capacity.

CapEx buys for the peak and leaves 51% idle. OpEx pays for what is used. TCO compares them.

Cloud cost · Going deeper

What TCO counts

What total cost of ownership countsOn-premisesIn the cloudHardwarebought up front, replaced every few yearsnone; included in the priceBuilding, power, coolingyours, every monthincludedStaff to run the platformyour own teamsmaller; Google runs the platformIdle capacitypaid for whether used or notnot paid forUsage chargesnonethe main cost, and it variesThe cloud bill is easy to see. The on-premises bill is spread across many budgets, so it looks smaller.TCO adds them up. The trade is predictability for flexibility: OpEx varies, so it has to be managed.

TCO adds hardware, space, power, staff and idle capacity to the comparison.

Resource hierarchy

One tree, and rules flow down it

OrganizationFoldersProjectsResourcesexample.comFinanceEngineeringpayrollshop-prodshop-testdatabaseVMbucketEngineeringshop-prodshop-testVMbucketa role granted herereaches all belowEverything sits in one tree, and a rule set on a branch is inherited by all that hangs from it.Resources live in projects, projects are grouped in folders, and the organization node is the root. Grantaccess or set a policy once, high up, and every project beneath follows it.

Organization, folders, projects, resources: a policy set above is inherited below.

Resource hierarchy · Going deeper

Levels and benefits

The four levelsOrganization nodeThe root: the whole company. Company-wide policies are set hereFolderA group of projects, usually a department, team or environmentProjectHolds resources; the unit for billing, permissions and enabled servicesResourceA thing you use: a virtual machine, a bucket, a datasetWhat the hierarchy givesAccess controlGrant roles at the level that matches a team's jobInheritanceA policy set above applies to everything below, automaticallySecurity and complianceCompany rules are enforced centrally and cannot be skippedVisibility and auditingCosts and activity roll up by project, folder and organizationEvery resource belongs to exactly one project. That is what makes each cost traceable to an owner.

Access control, inheritance, compliance and visibility.

Check yourself

organizationfolder Afolder Broleproject 1project 2project 3

A role is granted on folder B. Which projects does it apply to?

Consumption controls

A budget warns you. It does not stop the spending

spending so far this month, against a budget of $3,000day 1day 3050%alert, day 1690%alert, day 25100%alert, day 27the line keeps rising: a budget warns, it does not stopA budget sends alerts at thresholds you choose. It does not switch anything off.Here spending doubles on day 11, and alerts arrive on days 16, 25 and 27. To cap usage itself, set aquota. To see where the money went, open Cloud Billing reports.

Budget alerts warn at thresholds, quotas cap usage, and Cloud Billing reports show where money went.

Consumption controls · Going deeper · 1 of 2

Five consumption controls

Five consumption controlsItHowCloud Billing reportsshowscharts of cost by project, service and label, over timeBudget threshold ruleswarnsalerts when spending reaches set shares of a budgetResource quota policiescapslimits how much of a resource a project may useSpot VMssavesspare capacity at a deep discount, for work that can be interruptedDynamic Workload Schedulerschedulesruns AI and batch jobs when the GPUs they need are freeShows, warns, caps, saves, schedules: one verb for each control.A quota also protects you from a runaway script or a stolen key, because it limits the damage.

Reports show, budgets warn, quotas cap, Spot VMs save, the scheduler schedules.

Consumption controls · Going deeper · 2 of 2

Financial governance

Financial governance: who keeps cloud cost under controlPeopleFinance, engineering and the business share one view of cost; each cost has a named ownerProcessBudgets are agreed, reviewed on a schedule, and tied to who may create resourcesTechnologyBilling reports, budgets, quotas and labels make cost visible and enforce the rulesVariable cost needs an owner. Cost ownership means the team that spends is the team that answers for it.On-premises, finance approved one large purchase. In the cloud, every engineer can spend, so thecontrol has to move to where the spending happens.

People, process and technology, with a named owner for every cost.

Reliability

A measurement, a target and a promise

99.0%99.5%100.0%availableSLI: 99.95%what you measuredSLO: 99.9%the target you set yourselfSLA: 99.5%the promise to customersThe indicator is a measurement, the objective is a target, and the agreement is a promise.An SLI (service level indicator) is the number. An SLO (service level objective) is the level the teamaims for. An SLA (service level agreement) is a contract, with compensation if it is broken. The SLOis set tighter than the SLA, so the team is warned before a customer is owed anything.

The SLI is measured, the SLO is the internal target, and the SLA is the promise to customers.

Reliability · Going deeper

Downtime, and designing for it

Downtime allowed in a 30-day month99%7.2 hours99.9%43.2 minutes99.99%4.3 minutesDesigning for itRedundancyMore than one of everything, so one failure is not an outageReplicationCopies of data kept in other zones or regions, kept up to dateScalable infrastructureCapacity grows with demand, so a surge does not become a failureBackupsPoint-in-time copies to restore from after loss or corruptionEach extra nine cuts the allowed downtime tenfold. High availability is designed in, not added.

Redundancy, replication, scalable infrastructure and backups.

Check yourself

99.5%: promised to customers99.7%: measured this month99.9%: team target99.0%100%

What has happened this month?

Observability

Five products, each answering one question

Checkout is slow for some customers. Each product answers one question.Cloud Monitoringis something wrong?metrics and alertsCloud Loggingwhat happened?every event, in orderCloud Tracewhere is the delay?one request, each hopCloud Profilerwhich code is costly?CPU and memoryError Reportingwhat is failing?errors, groupedThe four signals to watch on any serviceLatency: how slowTraffic: how much demandSaturation: how fullErrors: how many failObservability means you can tell what a system is doing from the outside, without guessing.Google Cloud Observability is the family of five. Monitoring raises the alarm, Logging and Trace findthe place, Profiler and Error Reporting find the cause. Operational excellence is running servicesthis way: measured, reliable, and improved after every incident.

Monitoring, Logging, Trace, Profiler and Error Reporting, watching the four signals.

Observability · Going deeper · 1 of 2

Operations terms

Operations termsOperational excellenceRunning services efficiently and improving them continuouslyReliabilityThe service does what users expect, consistentlyHigh availabilityThe service stays up through the failure of a partLatencyHow long a request takesTrafficHow much demand the service is receivingSaturationHow close the service is to its capacityErrorsHow many requests failSLI, SLO, SLAMeasurement, internal target, external promiseThe four signals are the usual SLIs. An SLO is a target for one of them.

Reliability, high availability and the four signals.

Observability · Going deeper · 2 of 2

Clue words for cost and operations

When the question saysThe answer isBecause it is"large up-front purchase"CapExcapital expenditure"pay as you go", "monthly"OpExoperating expenditure"compare all costs of both options"TCOtotal cost of ownership"apply a policy to many projects"Folder or organizationinheritance"unit of billing and permissions"Projectholds resources"alert at 90% of planned spend"Budget threshold rulewarns"limit how much can be used"Quotacaps"see cost by service over time"Cloud Billing reportsshows"metrics, dashboards, alerts"Cloud Monitoringis something wrong"follow one request across services"Cloud Tracewhere is the delay"contract", "credits if missed"SLAexternal promise"internal reliability target"SLOthe team's goalSection 6 is 10% of the exam: the smallest section, and mostly these twelve.

The smallest section: 10% of the exam.

Check yourself

Symptomone request takes four secondsPathit passes through six servicesNeedsee which service used the time

A team describes a problem as shown. Which product answers it?

Lesson complete

You finished “Controlling cost and running reliably”

Answer the questions along the way to see your score here.

Open in a new tab