aicalcus.com
Tech & Developer4 min read

Database Scaling Costs in 2025: When to Scale and What It Actually Costs

A PostgreSQL instance that costs $50/month at 10K users costs $800/month at 500K users and $8,000/month at 5M users. Here's the scaling curve — and how to flatten it.

AMAlex Morgan·
Database Scaling Costs in 2025: When to Scale and What It Actually Costs

Database costs are the surprise that hits most startups between $10K and $100K MRR. Compute costs are predictable. Database costs scale non-linearly — storage, read replicas, and connection pooling all add up in unexpected ways.

Managed Database Pricing (2025)

PostgreSQL — AWS RDS Pricing

Instance sizevCPUsRAMStorageMonthly cost
db.t3.micro21 GB20 GB$15-25
db.t3.small22 GB20 GB$30-45
db.t3.medium24 GB100 GB$65-90
db.m5.large28 GB200 GB$130-180
db.m5.xlarge416 GB500 GB$260-350
db.m5.2xlarge832 GB1 TB$520-700
db.r5.2xlarge864 GB2 TB$800-1,100

Add to these: Multi-AZ adds ~2x cost. Read replicas add the same cost per replica. Data transfer out (reads to application) billed additionally at $0.09/GB.

PlanetScale (MySQL-compatible, serverless)

PlanStorageRow reads includedCost
Hobby5 GB1B/monthFree
Scaler10 GB10B/month$29/month
Scaler Pro10 GB+100B/month$99/month
EnterpriseCustomCustomCustom

Supabase (PostgreSQL managed)

PlanStorageRow readsCost
Free500 MB5M/month$0
Pro8 GBUnmetered$25/month
Team100 GBUnmetered$599/month

Supabase Pro at $25/month is exceptional value for startups — includes auth, realtime, storage, and APIs in addition to PostgreSQL.

The Scaling Cost Curve

A typical web application's database costs at different user scales:

Monthly active usersRecommended instanceEst. monthly DB cost
0-10,000db.t3.small (single) or Supabase Pro$30-45
10,000-50,000db.t3.medium + read replica$150-200
50,000-200,000db.m5.large + 2 read replicas$400-550
200,000-1,000,000db.m5.xlarge + 3 replicas$800-1,200
1,000,000-5,000,000db.m5.2xlarge + 5 replicas$2,500-4,000
5,000,000+db.r5.2xlarge cluster$8,000-15,000+

These are guidelines, not guarantees — actual costs depend heavily on query patterns, indexing, and whether you've optimized before scaling hardware.

The Optimization Sequence (Before Scaling Up)

Hardware scaling is expensive and permanent. Optimization is one-time work with permanent savings. Always exhaust optimization first:

1. Query optimization (0-cost, biggest impact)

Unindexed queries on large tables are the #1 database performance killer. Tools:

  • EXPLAIN ANALYZE in PostgreSQL — shows query execution plan
  • pg_stat_statements — identifies slowest queries
  • AWS RDS Performance Insights — visual query performance

One missing index on a high-frequency query can cause 100x query time. Adding it costs nothing.

2. Connection pooling (0-cost, major impact)

Each database connection uses ~5-10 MB RAM. A Rails/Node app without pooling might open 100+ connections per instance.

PgBouncer or pgcat (connection pooler) can reduce required database connections by 10-20x — allowing a smaller instance to handle the same load.

3. Read replicas (moderate cost, major scalability)

For read-heavy workloads (most web apps), directing read queries to read replicas allows the primary to focus on writes. A single read replica effectively doubles your read capacity.

Cost: same as primary instance (≈ 2x total cost), but avoids moving to the next instance tier.

4. Caching layer (moderate cost, major impact)

Redis or Memcached for frequently-accessed data:

  • Cache database query results for 60-300 seconds
  • Eliminates repeated identical queries
  • ElastiCache Redis: $15-200/month depending on size

For most applications, a proper caching layer reduces database load by 50-80%.

5. Vertical scaling (last resort)

Only scale instance size after: queries are optimized, connection pooling is in place, read replicas are directing read traffic, and caching is active.

Estimated Savings from Optimization

A company spending $800/month on RDS at 200K users with unoptimized queries:

OptimizationDB load reductionMonthly savings
Query optimization40-60%$200-400
Connection pooling20-30%$100-200
Caching layer30-50%$150-300
Read replicas (instead of bigger primary)Avoids 2x jump$200-400

Total: $650-1,300/month savings — often allowing a smaller (cheaper) primary instance.

Use the Cloud Cost Calculator to estimate database costs at different scale levels.

Get weekly AI cost benchmarks & productivity data

Join 4,200+ founders, developers, and creators. No spam, unsubscribe anytime.

#database#scaling#aws#postgresql#cloud-costs