DEV Community

Atlas Whoff
Atlas Whoff

Posted on

From Side Project to SaaS: The Moment You Need Real Infrastructure

The Infrastructure Trap

Most indie hackers over-engineer early and under-engineer late.

They spend week 3 setting up Kubernetes when they have 5 users. Then they're shocked when they get 500 users in a week and their SQLite database collapses.

Here's a map of when to add each piece of infrastructure.

Stage 1: 0-100 Users (Prototype)

Stack:
  Frontend: Next.js on Vercel (free tier)
  Database: Supabase free tier (PostgreSQL)
  Auth: NextAuth.js (free)
  Payments: Stripe Checkout (pay per transaction)
  Email: Resend free tier
  Monitoring: None (you'll check logs manually)

Cost: $0-5/month
Focus: Does anyone want this?
Enter fullscreen mode Exit fullscreen mode

The entire stack is free. Do not add anything else.

Stage 2: 100-1,000 Users (Early Revenue)

Add:
  ✓ Error monitoring (Sentry — free tier)
  ✓ Analytics (PostHog — free tier)
  ✓ Proper logging (Vercel logs or pino)
  ✓ Upgrade Supabase to Pro ($25/month)

Maybe add:
  ? Redis/caching (if you see specific slowness)
  ? Background jobs (if sync operations are too slow)

Cost: $30-60/month
Focus: Reduce churn, improve retention
Enter fullscreen mode Exit fullscreen mode

Stage 3: 1,000-10,000 Users (Product-Market Fit)

Add:
  ✓ Background job queue (BullMQ + Redis)
  ✓ File storage (S3 or Supabase storage)
  ✓ CDN (Cloudflare — free tier does a lot)
  ✓ Uptime monitoring (Better Uptime — $20/month)
  ✓ Database backups (automated)

Maybe add:
  ? Dedicated database server (if Supabase is slow)
  ? Email queue (if sending 10k+ emails/day)
  ? Multi-region (only if latency is user-reported)

Cost: $100-300/month
Focus: Reliability, scale the growth channel
Enter fullscreen mode Exit fullscreen mode

Stage 4: 10,000+ Users (Scaling)

Add:
  ✓ Database read replicas
  ✓ Connection pooling (PgBouncer)
  ✓ Advanced caching strategy
  ✓ Kubernetes or container orchestration
  ✓ On-call rotation (PagerDuty/OpsGenie)
  ✓ Staging environment with prod-like data

Now consider:
  ? Multi-region deployment
  ? Data warehouse (BigQuery, Snowflake) for analytics
  ? Dedicated security review

Cost: $1,000-5,000/month
Focus: Availability, compliance, enterprise features
Enter fullscreen mode Exit fullscreen mode

The Signals to Watch

// Add Redis when:
// - DB query time > 200ms for common queries
// - Same data fetched > 100x/minute

// Add background jobs when:
// - HTTP responses > 3 seconds
// - You're making API calls to slow services in request path

// Add CDN when:
// - Static assets loading slowly globally
// - Bandwidth costs climbing

// Scale database when:
// - CPU > 70% sustained
// - Connection pool exhausted
// - Queries timing out randomly
Enter fullscreen mode Exit fullscreen mode

The Anti-Patterns

Too early:

✗ Microservices at 100 users
✗ Kubernetes at 1,000 users
✗ Multi-region at < $10k MRR
✗ ML pipeline before product-market fit
Enter fullscreen mode Exit fullscreen mode

Too late:

✗ No monitoring until after an outage
✗ No backups until after data loss
✗ No caching until users complain
✗ No background jobs until timeouts cause missed payments
Enter fullscreen mode Exit fullscreen mode

The Right Question

For every infrastructure addition, ask:
"What specific user problem does this solve?"

If the answer is "it's better architecture" rather than "users are experiencing X," wait.

Infrastructure is a response to problems, not a prevention of hypothetical ones.


Start with the right foundation and add infrastructure as you grow: Whoff Agents AI SaaS Starter Kit is built for Stage 1-3 and scales from there.

Top comments (0)