Skip to main content

Dev & engineering · free calculator

Database cost calculator

RDS, Aurora Serverless, PlanetScale, Supabase, Neon, Atlas — monthly DB cost with storage + reads + writes.

Database

Monthly DB cost

$77

Annual: $927 · $1 per 1M queries

Storage + backup

$15

Base: $62 · Replicas: $0

Show the work

  • Base instance$62
  • Storage$6
  • Reads$0
  • Writes$0
  • Backup$10
  • Read replicas$0
  • Total / month$77

Database cost calculator — RDS vs Aurora vs serverless

Database is usually the second-biggest infrastructure line item after compute, and the fastest-growing as your app accumulates data. Each provider prices differently — per-instance (RDS), per-capacity-unit (Aurora Serverless), per-query (PlanetScale, Dynamo), or hybrid (Supabase, Neon). This calculator shows rough monthly cost across the major managed DBs so you can compare before committing.

The pricing models

  1. Fixed instance (RDS, Supabase, MongoDB Atlas): Pay for the machine size, 24/7. Cheapest for steady load. Storage priced separately at $0.10-0.25/GB-month. Over-provisioning wastes money.
  2. Serverless / on-demand (Aurora Serverless, Neon): Pay per capacity unit scaled up and down with load. Scales to zero or minimum in idle periods. Cheaper for bursty workloads, 2-3x more expensive for steady load.
  3. Per-query (PlanetScale, DynamoDB on-demand, Cosmos DB): Pay per read/write. Linear scaling with usage. Storage priced high ($1.50-2.50/GB-mo). Great for predictable workloads where you can model query volume.

Storage: the sleeper cost

Storage starts small and accumulates. A typical SaaS database grows 2-5GB/month per 1,000 active users. After 2 years:

  • Users: 5,000 (2-3x growth)
  • Storage: 80-200GB (20-40x growth)

Why the mismatch? Every user creates records forever unless you actively delete:

  • Events / audit logs: Often 100- 1000x the size of core user data. Biggest sleeper.
  • Soft-deleted rows: Never actually removed unless you hard-delete periodically.
  • Denormalized data: Duplicated in multiple tables for read performance.
  • Historical versions: JSON blobs of past states, webhook payloads, cached computed data.

Reads vs writes (for per-query DBs)

Providers price reads and writes separately because writes are much more expensive operationally (durable storage, replication, indexes updated):

  • PlanetScale: $1.00 per 1M reads, $1.50 per 1M writes
  • DynamoDB on-demand: $0.25 per 1M reads, $1.25 per 1M writes (4-8 KB units)
  • Aurora Serverless: ~$0.20 per 1M IOPS (unified)

Typical SaaS read:write ratio is 10:1 to 100:1. Most queries are reads (pageviews, dashboards, search). Optimizing reads via caching (Redis, application-level) pays back fast on per-query pricing models.

Read replicas: when and why

A read replica is a copy of your primary database that accepts read queries but not writes. Uses:

  • Scale read throughput: Route reads across N replicas to handle N × primary capacity.
  • Isolate analytics: Heavy analytical queries on a dedicated replica don't slow transactional traffic.
  • Geographic latency: Replica in EU serves EU users with 5ms vs 150ms cross- Atlantic.
  • Failover target: If primary fails, promote replica to new primary.

Cost: each replica = ~1x primary cost (same size instance + same storage). Don't add replicas proactively — only when primary CPU is consistently > 70% from read traffic, or as explicit HA requirement.

Backup and retention

Most managed DBs include automated backups but charge for retention beyond default:

  • RDS: 7-day retention included, $0.095/GB-mo for longer retention
  • Aurora: 1-day free, $0.021/GB-mo beyond
  • Supabase: 7-day in Pro, 30-day in Team
  • Compliance-required retention (HIPAA, SOC 2) often demands 1-7 years: budget for it

Point-in-time recovery (PITR) is critical for production — lets you restore to any moment in the retention window. Usually small incremental cost over snapshot-only backups.

Cost optimization patterns

  1. Right-size instances: Most teams run 2-4 class sizes too large. Monitor CPU and memory usage, downsize if consistently < 50% utilized.
  2. Reserved instances: RDS/Aurora 1-year or 3-year RIs drop cost 40-60%. Commit when production load is stable.
  3. Archive old data: Move data > 90 days to S3 (Parquet) + Athena for analytics. Drop DB storage by 50-80%.
  4. Partition large tables: Time- series or event tables partitioned by date let you drop old partitions cheaply.
  5. Index audit: Unused indexes eat storage + write throughput. Drop them. PGpg_stat_user_indexes shows usage.
  6. Connection pooling: PgBouncer / RDS Proxy reduces connections, letting you use smaller instances. Critical at scale.
  7. Cache aggressively: Redis in front of DB cuts query volume 50-80% for read-heavy apps. Pay once for caching infrastructure, save multiples on DB.

Common DB cost mistakes

  • Over-provisioning "for safety": Teams often run db.r5.xlarge when t4g.medium would suffice. 4x the cost for the same workload.
  • Ignoring IOPS / throughput costs: RDS gp2 with provisioned IOPS can cost more than the instance. Move to gp3 (cheaper baseline) or right-size provisioned IOPS.
  • Running full Multi-AZ in dev/staging: Multi-AZ doubles cost. Only use for production.
  • Unused read replicas: Replicas created for a burst event and never removed. Audit monthly.
  • No data archival: Events tables at 500M rows. Should be < 50M on primary with rest archived. Common across SaaS.

Related calculators

Keep the math moving