SaaS backend

The backend most SaaS products need: API, Postgres, sign-in, background jobs, cache, file storage and transactional email.

Good fit: B2B or B2C web apps from first customers to a few thousand paying accounts, built by a small team.

Infrastructure
$179/mo
$164 at half the usage · $239 at double
Payment fees (Stripe)
2.9% + 30¢ per transaction
≈ $234 at 200 payments · grows with your revenue, so it's not in the infrastructure total

How the parts connect

  1. API hosting$20/mo

    Railway · Pro

  2. Background jobs$99/mo

    Inngest · Pro

    ← enqueue from API hosting

  3. Database$19.43/mo

    Neon · Launch

    ← queries from API hosting · read / write from Background jobs

  4. Authentication$20/mo

    Clerk · Pro

    ← verify sessions from API hosting

  5. Cache & rate limits$6/mo

    Upstash · Pay as You Go

    ← cache, rate limits from API hosting

  6. File storage$0

    Cloudflare R2

    ← signed uploads from API hosting

  7. Transactional email$15/mo

    Postmark · Basic

    ← send from Background jobs

  8. Payments2.9% + 30¢

    Stripe · US cards

    ← checkout, webhooks from API hosting

Monthly cost

Estimate

Expected cost at the usage below, and the range from half to double that usage. Worked out from each vendor's current prices and free tiers; your real bill depends on your traffic.

PartPickExpected / moRange
API hostingRailway · Pro$20/mofixed
DatabaseNeon · Launch$19.43/mo$8.04–$20.48
AuthenticationClerk · Pro$20/mofixed
Background jobsInngest · Pro$99/mofixed
Cache & rate limitsUpstash · Pay as You Go$6/mo$1.50–$24
File storageCloudflare R2$0$0–$0.45
Transactional emailPostmark · Basic$15/mo$15–$54.60
Infrastructure total$179/mo$164–$239

Payment fees (Stripe · US cards): 2.9% + 30¢ per transaction

≈ $234 at 200 payments a month ($117–$468). Not in the infrastructure total: fees grow with your revenue, they aren't a cost of running the stack.

Show the arithmetic behind every number

API hosting · Railway · Pro

  • vcpu = app_vcpu = 0.5
  • ram_gb = app_ram_gb = 0.5
  • Pro list price $20.00/month
  • vCPU: 0.5 × 2,592,000 seconds × $0.00000772 = $10.01
  • RAM GB: 0.5 × 2,592,000 seconds × $0.00000386 = $5.00
  • usage $15.01 − included credit $20.00 = $0.00

Database · Neon · Launch

  • db_gb = monthly_active_users / 1000 * data_gb_per_1k_users = 2,000 / 1000 × 0.5 = 1
  • cu_hours = db_cu * db_active_hours = 0.25 × 720 = 180
  • compute CU-hours: 180 × $0.106 = $19.08
  • storage GB-month: 1 × $0.35 = $0.35
  • note: Launch has no base fee; the $15 on the page is a typical bill

Authentication · Clerk · Pro

  • mau = monthly_active_users = 2,000
  • Pro list price $20.00/month
  • monthly retained users: 2,000 − 50,000 free = 0 × $0.02 = $0.00

Background jobs · Inngest · Pro

  • executions = monthly_active_users * jobs_per_user_per_month * (steps_per_job + 1) = 2,000 × 20 × (2 + 1) = 120,000
  • job_runs = monthly_active_users * jobs_per_user_per_month = 2,000 × 20 = 40,000
  • job_compute_seconds = monthly_active_users * jobs_per_user_per_month * job_seconds = 2,000 × 20 × 2 = 80,000
  • Pro list price $99.00/month
  • executions: 120,000 − 1,000,000 free = 0 ÷ 1,000,000 × $50.00 = $0.00

Cache & rate limits · Upstash · Pay as You Go

  • commands = monthly_active_users * requests_per_user_per_month * cache_commands_per_request = 2,000 × 1,500 × 1 = 3,000,000
  • Pay as You Go: metered plan, no base fee
  • commands: 3,000,000 ÷ 100,000 × $0.20 (catalog: Pay as You Go) = $6.00

File storage · Cloudflare R2

  • storage_gb = monthly_active_users / 1000 * storage_gb_per_1k_users = 2,000 / 1000 × 5 = 10
  • write_ops = monthly_active_users * write_ops_per_user = 2,000 × 10 = 20,000
  • read_ops = monthly_active_users * read_ops_per_user = 2,000 × 50 = 100,000
  • storage GB-month: 10 − 10 free = 0 × $0.015 (catalog: Storage) = $0.00
  • Class A (write) ops: 20,000 − 1,000,000 free = 0 ÷ 1,000,000 → 0 (rounded up) × $4.50 (catalog: Class A Operations) = $0.00
  • Class B (read) ops: 100,000 − 10,000,000 free = 0 ÷ 1,000,000 → 0 (rounded up) × $0.36 (catalog: Class B Operations) = $0.00

Transactional email · Postmark · Basic

  • emails = monthly_active_users * emails_per_user_per_month = 2,000 × 4 = 8,000
  • Basic list price $15.00/month
  • emails: 8,000 − 10,000 free = 0 ÷ 1,000 × $1.80 = $0.00

Payments · Stripe · US cards

  • transactions = paying_customers = 200
  • volume_usd = paying_customers * avg_transaction_usd = 200 × 30 = 6,000
  • US cards: 2.9% + $0.30 per transaction (catalog)
  • percentage: $6,000.00 volume × 2.9% = $174.00
  • fixed: 200 transactions × $0.30 = $60.00
  • payment fees grow with revenue, so they are shown apart from the infrastructure total

The tools, and why

API hosting

$20/mo

Railway · Pro

API, workers and cron in one project with usage-based billing

railway.com ↗

Database

$19.43/mo

Neon · Launch

Serverless Postgres with a database branch per preview deploy

neon.com ↗

Authentication

$20/mo

Clerk · Pro

Prebuilt sign-in UI plus organizations and roles for B2B

clerk.com ↗

Background jobs

$99/mo

Inngest · Pro

Durable functions with retries, schedules and fan-out in your codebase

inngest.com ↗

Cache & rate limits

$6/mo

Upstash · Pay as You Go

Serverless Redis billed per command; ready-made rate limiting

upstash.com ↗

File storage

$0

Cloudflare R2

S3-compatible with no egress fees for downloads

cloudflare.com ↗

Transactional email

$15/mo

Postmark · Basic

Best-in-class deliverability for password resets and receipts

postmarkapp.com ↗

Payments

2.9% + 30¢ per transaction

Stripe · US cards

Subscriptions, invoices and hosted checkout with the lowest card fee here

stripe.com ↗

All costs are estimates. Prices are read from each vendor's pricing page and checked every 12 hours (last: Oct 30, 2026); your bill depends on your traffic.

The usage these costs assume

"Half" and "double" in the ranges scale these numbers.

Monthly active usersAn early-stage product with steady usage
2,000 users
API requests per userAbout 50 requests per active day
1,500 requests/user/month
Background jobs per userNotifications, webhooks and nightly tasks
20 jobs/user/month
Emails per userSign-in links, notifications and a receipt
4 emails/user/month
Database size per 1,000 usersTypical relational data without large blobs
0.5 GB
Files per 1,000 usersAvatars, uploads and exports
5 GB
Paying customersAbout 10% of active users pay
200 customers
Average chargeA typical SaaS subscription price
30 USD/month
Engineering assumptions (9)
API vCPUOne small API instance
0.5 vCPU
API RAMOne small API instance
0.5 GB
Database compute sizeThe smallest Neon compute
0.25 CU
Database active hoursAn API with steady traffic keeps it awake
720 hours/month
Steps per jobLoad data, then do the work
2 steps
Compute per jobShort tasks like sending a webhook
2 seconds
Redis commands per requestOne rate-limit check per API call
1 commands
File writes per userUploads and generated exports
10 writes/user/month
File reads per userAvatars and downloads
50 reads/user/month

How to build it

  1. 1

    API and database

    Set up the API project, connect Postgres, add migrations and a seed; deploy previews with their own database branch.

    Uses: API hosting, Database

  2. 2

    Sign-in and organizations

    Add sign-up/sign-in, an organizations model and roles; check the session on every API route.

    Uses: Authentication, API hosting

  3. 3

    Email

    Send verification, password reset and notification emails from templates; set up SPF, DKIM and DMARC.

    Uses: Transactional email

  4. 4

    Background jobs

    Move slow work (emails, webhooks, imports) into retried jobs; add a nightly cleanup schedule.

    Uses: Background jobs

  5. 5

    Uploads

    Let clients upload straight to object storage with signed URLs; record files in the database.

    Uses: File storage, Database

  6. 6

    Payments

    Create products and prices, send customers to hosted checkout, and process webhooks in a job so subscriptions stay in sync.

    Uses: Payments, Background jobs

  7. 7

    Protect and speed up

    Rate-limit by user and IP, cache the hottest reads, and add indexes for the slowest queries.

    Uses: Cache & rate limits, Database

Not covered by this estimate

  • Error monitoring (Sentry) and uptime checks: not in the catalog yet

Get this built for you

We'll adapt this blueprint to your product, set it up on your accounts and hand it over working, with the monthly bill you saw here.