When I started, most of my apps lived on a single server — often a Heroku dyno or a small VPS. It worked fine for MVPs, but as traffic grew, things broke: downtime during deployments, slow queries, or servers crashing under spikes.
By 2024, I had designed infra that could handle real production loads — moving from single boxes to scalable, monitored, and resilient systems.
Here’s what I learned.
First, I separated concerns:
API Servers (Rails/Node)
Frontend Hosting (React/Next.js on Vercel/Netlify or Nginx)
Database Server (Postgres on AWS RDS)
Redis Server (for caching & background jobs)
Result → Stability improved immediately.
Once traffic increased, I introduced load balancers:
[ Load Balancer ]
/ \
[ API Server 1 ] [ API Server 2 ]
\ /
[ Database + Redis ]
AWS ELB / Nginx for routing traffic.
Auto-scaling groups spun up extra servers during traffic spikes.
Health checks ensured failing servers were taken out of rotation.
Caching was critical for performance:
Rails cache + Redis → cached expensive DB queries.
API response caching → repeated calls served instantly.
CDN (CloudFront) → cached static assets (JS, CSS, images).
This cut DB load by 60–70%.
Scaling isn’t just adding servers — it’s knowing what’s happening.
NewRelic / Datadog → tracked API response times.
Prometheus + Grafana → dashboards for CPU, memory, DB queries.
Slack alerts → when error rates or CPU crossed thresholds.
Result → Issues were detected before users complained.
Vertical first, then horizontal → cheaper to scale up DB before splitting it.
Every fix shifts the bottleneck → fix DB, API slows; fix API, frontend bundle size hurts. Always measure.
Keep it simple for startups → AWS RDS, Redis, S3, CloudFront solved 80% of problems without exotic infra.
Automation saves lives → auto-scaling + CI/CD meant no 2am manual restarts.
Vertical first, then horizontal → cheaper to scale up DB before splitting it.
Every fix shifts the bottleneck → fix DB, API slows; fix API, frontend bundle size hurts. Always measure.
Keep it simple for startups → AWS RDS, Redis, S3, CloudFront solved 80% of problems without exotic infra.
Automation saves lives → auto-scaling + CI/CD meant no 2am manual restarts.
Scaling infrastructure isn’t about copying Google or Netflix. It’s about finding bottlenecks and reinforcing them step by step.
By mid-2024, I had moved from single-server deployments to modular, load-balanced, cached, and monitored systems that could handle production traffic without constant firefighting.