Cost Architecture#

Cost is an architecture concern, not a finance concern. Every design decision — the database engine, the compute model, the replication strategy — has a cost implication. Engineers who understand cost architecture build systems that are both performant and economically sustainable. This section covers the principles, patterns, and organisational structures for cost-aware cloud design.


Cost-Aware Architecture Principles#

The Five Principles#

PrincipleWhat It Means
Cost is a first-class requirementTreat cost like latency or availability — it has targets, is measured, and is reviewed
Right-size, don’t over-provisionMatch resources to actual usage, not theoretical peak
Pay for what you usePrefer per-request/per-second pricing when workloads are variable
Design for cost visibilityEvery resource is tagged, every cost is attributable to a team/service
Review continuouslyCost optimisation is not a one-time project; it’s a recurring practice

Cost as a Non-Functional Requirement#

Just as you specify SLOs for latency and availability, specify cost targets:

Service: Booking API
├── Availability SLO: 99.95%
├── Latency P99: < 200ms
├── Cost target: < £0.50 per 1,000 bookings
└── Cost ceiling: £8,000/month at current volume

Architecture Trade-Offs with Cost Impact#

Every architecture decision has cost implications. The table below maps common decisions to their cost profile.

Compute Trade-Offs#

DecisionLower CostHigher CostWhen to Accept Higher
Serverless vs containersServerless at low trafficContainers at low trafficServerless wins below ~5M requests/month
Spot vs on-demandSpot (60–90% cheaper)On-demandOn-demand when interruption is unacceptable
ARM vs x86ARM (20–40% cheaper)x86x86 only for binary compatibility
Right-sized instancesSmaller, matched to usageOver-provisioned “just in case”Over-provision temporarily for launches

Data Trade-Offs#

DecisionLower CostHigher CostWhen to Accept Higher
Single-region vs multi-regionSingle-regionMulti-region (replication + egress)Multi-region for global latency or DR
Storage tieringCold/archive for old dataAll data on hot storageHot when all data is frequently accessed
Managed DB vs self-managedSelf-managed (lower per-unit)Managed (higher per-unit)Managed to save engineering time
Read replicasSingle instanceMultiple read replicasReplicas when read scaling is needed

Networking Trade-Offs#

DecisionLower CostHigher CostNotes
Same-AZ deploymentFree data transferReduced availabilityAcceptable for dev, not for prod
NAT Gateway vs NAT InstanceNAT InstanceNAT Gateway (~£30/mo + data)NAT Gateway for reliability
Private Link vs public endpointPrivate Link (avoid egress)Public (egress charges)Private Link also improves security
VPC endpointsFree (gateway endpoints for S3/DynamoDB)Paid (interface endpoints)Always enable gateway endpoints

Reserved Capacity Strategies#

Reserved capacity (Reserved Instances, Savings Plans, Committed Use Discounts) trades flexibility for lower unit cost.

Commitment Comparison#

ModelDiscountFlexibilityCommitment
On-demand0%FullNone
Savings Plan (AWS) / CUD (GCP)30–60%Medium (any instance family/region)1 or 3 years
Reserved Instance (specific)40–72%Low (specific type/region)1 or 3 years
Spot/preemptible60–90%High (but interruptible)None

Commitment Strategy#

Total compute spend
│
├── Baseline (always-on, predictable)
│   └── 70% covered by Savings Plans / CUD (1-year)
│
├── Steady growth
│   └── 20% covered by Savings Plans (flexible)
│
└── Variable/burst
    └── 10% on-demand + spot

When NOT to Commit#

SituationWhy
Workload may be retired in < 12 monthsYou’ll pay for unused capacity
Instance type is likely to changeGraviton migration, architecture change
Traffic is highly unpredictableYou’ll over-commit or under-commit
Organisation is early in cloud adoptionUsage patterns aren’t established

Spot Architecture Patterns#

Spot instances are the most powerful cost lever in cloud computing. Designing for spot requires embracing interruption as a feature, not a failure.

Spot-Friendly Workloads#

WorkloadSpot-Friendly?Why
CI/CD runners✅Short-lived, retryable
Batch processing✅Checkpointable, queue-driven
Data pipelines (Spark, ETL)✅Retryable stages, data in object storage
Dev/test environments✅Interruption is acceptable
Stateless web tier (with on-demand base)✅Mixed fleet: OD base + spot burst
Databases❌Stateful, interruption causes data risk
Real-time trading / payments❌Latency-sensitive, interruption unacceptable

Spot Savings Architecture#

Without Spot:
┌──────────────────────────────────────┐
│  10x m6i.xlarge (on-demand)          │
│  = 10 × £0.192/hr = £1.92/hr        │
│  = £1,382/month                      │
└──────────────────────────────────────┘

With Mixed Fleet (30% OD + 70% Spot):
┌──────────────────────────────────────┐
│  3x m6i.xlarge (on-demand)           │
│  = 3 × £0.192/hr = £0.576/hr        │
│                                      │
│  7x m6i.xlarge (spot, ~70% discount) │
│  = 7 × £0.058/hr = £0.406/hr        │
│                                      │
│  Total = £0.982/hr                   │
│  = £707/month (49% savings)          │
└──────────────────────────────────────┘

Cost Allocation Models#

Allocation Approaches#

ModelHow It WorksBest For
Direct attributionEach resource tagged to a team/service; cost = usageIaaS, per-service databases
Proportional splitShared resources divided by usage metric (requests, CPU)Shared clusters, shared networking
Fixed allocationFlat fee per team/service regardless of usageSimplicity, platform teams
ShowbackTeams see their cost but don’t payEarly-stage cost awareness
ChargebackTeams pay for their usage from their budgetMature organisations, accountability

Tagging for Cost Allocation#

Every resource must have:
├── Team: platform / bookings / search / payments
├── Environment: dev / pre / prod
├── CostCentre: CC-1234
├── Application: booking-api / search-indexer
└── ManagedBy: terraform / manual

Cost Explorer / Billing Dashboard
├── Filter by Team=bookings, Environment=prod
│   └── Shows: £12,430/month
│       ├── EC2: £5,200
│       ├── RDS: £3,800
│       ├── S3: £430
│       └── Data Transfer: £3,000
└── Filter by CostCentre=CC-1234
    └── Shows: £45,000/month (entire department)

FinOps Team Structure#

FinOps (Financial Operations) is the practice of bringing financial accountability to cloud spend. It’s a cross-functional discipline, not a finance task.

FinOps Team Model#

┌─────────────────────────────────────────────────────────────┐
│                     FinOps Practice                           │
│                                                               │
│  ┌─────────────────┐  ┌─────────────┐  ┌────────────────┐  │
│  │ Engineering      │  │ Finance     │  │ Leadership     │  │
│  │                 │  │             │  │                │  │
│  │ • Cost tools    │  │ • Budgets   │  │ • Priorities   │  │
│  │ • Architecture  │  │ • Forecasts │  │ • Trade-offs   │  │
│  │ • Optimisation  │  │ • Reporting │  │ • Investment   │  │
│  │ • Tagging       │  │ • Variance  │  │   decisions    │  │
│  └─────────────────┘  └─────────────┘  └────────────────┘  │
│                                                               │
│  Cadence: Weekly cost review, Monthly deep-dive,             │
│           Quarterly commitment planning                       │
└─────────────────────────────────────────────────────────────┘

FinOps Maturity Phases#

PhaseFocusActivities
CrawlVisibilityEnable cost allocation, tagging, basic dashboards
WalkOptimisationRight-sizing, reserved capacity, spot adoption, waste elimination
RunOperationsUnit economics, automated recommendations, engineering culture change

Unit Economics#

Unit economics measure cost efficiency in business terms, not infrastructure terms. They answer: “how much does it cost to serve one customer / process one transaction / store one GB?”

Defining Unit Metrics#

BusinessUnit MetricTarget
E-commerceCost per order£0.12 per order
SaaS platformCost per active user per month£1.50 per user/month
Data pipelineCost per GB processed£0.03 per GB
API serviceCost per 1,000 API calls£0.08 per 1K calls
Media platformCost per hour of video streamed£0.002 per hour

Unit Economics Dashboard#

┌─────────────────────────────────────────────────────────────┐
│                   Cost Per Booking                            │
│                                                               │
│  £0.55 ┤                                                     │
│        │     ╱╲                                              │
│  £0.45 ┤    ╱  ╲        Target: £0.50                       │
│        │   ╱    ╲─────────────────────── £0.42               │
│  £0.35 ┤  ╱                                                  │
│        │ ╱                                                   │
│  £0.25 ┤╱                                                    │
│        ├─────┬─────┬─────┬─────┬─────┬─────┬─────           │
│        Jan   Feb   Mar   Apr   May   Jun   Jul               │
│                                                               │
│  Trend: Improving (right-sizing + Graviton migration)        │
└─────────────────────────────────────────────────────────────┘

Why Unit Economics Matter#

MetricWhat It Tells You
Total cloud spendHow much you’re spending (but not if it’s efficient)
Cost per serviceWhich services are expensive (but not if they’re worth it)
Cost per business unitWhether cloud spend scales efficiently with business growth

The goal: As the business grows, total spend increases but cost per unit decreases (economies of scale). If cost per unit increases, your architecture doesn’t scale economically.


Cost Optimisation Quick Wins#

ActionEffortTypical SavingsFirst Step
Delete unused resourcesLow5–15%List unattached EBS volumes, unused EIPs, idle LBs
Right-size instancesLow10–30%Review Compute Optimizer / recommendations
Savings Plans / CUDLow20–40%Analyse 30-day usage, commit for baseline
Storage tieringLow20–60% on storageEnable lifecycle policies on S3 / GCS
Spot instancesMedium40–70% on batch/CIStart with CI/CD runners, expand to batch
Graviton / ARM migrationMedium20% on computeTest on non-production, migrate compatible workloads
NAT Gateway optimisationLow10–30% on networkingRoute S3/DynamoDB through VPC gateway endpoints
Data transfer reductionMediumVariableCompress payloads, cache at edge, use Private Link

Key Takeaways#

  • Treat cost as a first-class architecture requirement alongside latency, availability, and security
  • Every architecture decision has a cost implication — evaluate compute, data, and networking trade-offs explicitly
  • Cover baseline compute with reserved capacity (Savings Plans, CUD); use spot for burst and batch workloads
  • Tag every resource for cost allocation; without tags, you cannot attribute, optimise, or budget
  • FinOps is cross-functional: engineering provides optimisation, finance provides budgets, leadership provides priorities
  • Measure unit economics (cost per transaction, per user, per GB) — total spend is meaningless without business context
  • Cost optimisation is continuous, not a one-time project; review weekly, deep-dive monthly, plan commitments quarterly