Skip to the build
Cost lab

UPI-style payments API

StretchBudget $3,550 a month
  1. Step 1 of 3: 1Fit the load
  2. Step 2 of 3: 2Hit the budget
  3. Step 3 of 3: 3Defend your bill

Catalogue

Compute

$1,770 a month

What runs your code.

Kind
Server size
How you pay

Reserved: a 1-year commitment, cheaper, paid all month. Spot: spare capacity, can be taken back with 2 minutes notice.

How many servers you run
Scaling

Fixed: the same number all month. Autoscale: follows the load, billed on the average (plus slack).

Database

$4,528 a month

Where the data lives.

Kind
Size

Rated for reads and writes per second; a write costs three times a read.

Read replicas

Copies that answer reads. They do not take writes and do not fail over automatically.

How you pay

Cache

$0.00 a month

Memory in front of the database (Valkey).

Nodes

More memory holds more of what is read again and again.

Logs and monitoring

$1,821 a month

Needs to be kept at least 90 days.

Retention (days)
Monthly bill
$8,322
₹7,90,545 at ₹95 per $
Budget
$3,550
₹3,37,250

Monthly bill $8,322 (budget $3,550) · meets peak ✗ · availability ✓ · latency ✗

$4,772 over budget, and 2 checks fail.

Checks

Handles the peakfailed
At peak 1,389 requests/s reach your servers (12 ms of CPU each, run at 60% load) = 27.8 vCPU. That is 7 x m6i.xlarge; you allow 12. At peak the primary does 868 writes/s (x3 weight) + 868 reads/s = 3,472 units; a db.m6g.2xlarge is rated 4,800, so 3,360 at 70% load. Each replica does 868.
Availability: 99.95% (survives a zone loss)passed
Servers in two zones, a standby database, no all-Spot fleet.
Latency: p99 under 150 msfailed
Every read goes to a disk-backed database, which cannot hold 150 ms at p99 under peak. Reads need memory in front of them.
Logs kept at least 90 dayspassed
Retention is 90 days.
The choices fit the workloadpassed
Nothing in the design contradicts the workload.
Within budget ($3,550 a month)failed
$4,772 over budget.

The bill, line by line

Compute

$1,770
  • m6i.xlarge servers, on-demand$1,770
    12 x m6i.xlarge x $0.202/h x 730 h = $1,770

Database

$4,528
  • PostgreSQL primary (db.m6g.2xlarge Multi-AZ)$1,320
    db.m6g.2xlarge x $1.81/h x 730 h = $1,320
  • Read replicas (3)$1,980
    3 x db.m6g.2xlarge x $0.904/h x 730 h = $1,980
    A replica takes reads. It does not take writes.
  • Database storage (gp3)$1,228
    1,875 GB (data + 25% room) x $0.262 + 3 replicas x 1,875 GB x $0.131 = $1,228

Monitoring

$1,821
  • Logs ingested$1,608
    2,400 GB x $0.67 = $1,608
  • Logs stored (90 days)$213.04
    2,400 GB x 90 / 30.4 days = 7,101 GB x $0.03 = $213.04

Network

$203.24
  • Load balancer$39.08
    730 h x ($0.0239 + 3.7 LCU x $0.008) = $39.08
    LCU: the larger of new connections (25 a second) or 1 GB an hour.
  • NAT gateways (one per zone)$104.16
    2 x $0.056/h x 730 h + 400 GB x $0.056 = $104.16
    Private servers reach the internet through it. It charges per hour and per GB.
  • Traffic between zones$60.00
    6,000 GB x 50% crossing x 2 x $0.01 = $60.00
    Servers in two zones talk across the zone line: $0.01 per GB each way.

Mumbai (ap-south-1), 730 hours a month. List prices checked 2026-10-19: the price table below has the sources and what is left out.

Where the prices come from