Traffic is predictable and consistently moderate-to-high
You have DevOps experience or want to learn
Budget is tight β VPS offers the best performance per dollar
You need specific OS-level packages or configurations
VPS Pros & Cons
Pros
Cons
Complete control
You manage everything (OS updates, security)
Best performance per dollar
Manual scaling (add more VPS, load balancer)
No vendor lock-in
SSH and command-line required
Predictable pricing
No built-in monitoring or logging
2. PaaS (Platform as a Service)
PaaS providers manage the infrastructure. You just push code.
Provider
Starting Price
Features
Railway
$5/mo
Quick deploy, built-in Postgres, auto HTTPS
Render
$7/mo
Auto deploy from Git, managed Postgres/Redis
Fly.io
Free tier
Edge compute, global regions, WireGuard VPN
Heroku
$7/mo (eco)
Mature ecosystem, add-ons marketplace
DigitalOcean App Platform
$5/mo
Integrated with DO VPS ecosystem
Deploying to Railway (Example)
# 1. Install Railway CLInpm install -g @railway/cli# 2. Login and initrailway loginrailway init# 3. Set environment variablesrailway variables set NODE_ENV=productionrailway variables set DATABASE_URL=...# 4. Deployrailway up# 5. Open the deployed apprailway open
Sporadic traffic β a few requests per hour, or bursty
Background jobs β image processing, email sending, webhooks
Prototyping β no cost when idle
Microservices β each function is a small, independent unit
Serverless Pros & Cons
Pros
Cons
Pay per request (cheap at low volume)
Cold starts (100msβ1s delay)
Auto-scales infinitely
15-minute timeout (AWS Lambda)
No server management
Stateless β no local filesystem
Built-in fault tolerance
Debugging is harder (no SSH)
4. Comparison Matrix
Feature
VPS
PaaS
Serverless
Setup time
Hours
Minutes
Minutes
DevOps skill needed
High
Low
Medium
Monthly cost (low traffic)
$5β10
$5β7
$0 (free tier)
Monthly cost (10K req/s)
$50β200
$200β1000+
$500+
Cold start
None
1-5s (if sleep)
100msβ1s
Max request duration
Unlimited
Unlimited (with config)
15min (Lambda)
Database options
Any
Managed (limited)
External only
Custom domain + SSL
Manual
Auto
Auto
Monitoring
DIY
Built-in
Built-in
5. Docker-Based Deployment
A Docker container can run on any of these platforms:
FROM node:22-alpineWORKDIR /appCOPY package*.json ./RUN npm ci --productionCOPY . .EXPOSE 3000CMD ["node", "app.js"]
# Run on VPSdocker build -t my-api .docker run -d -p 3000:3000 --name my-api my-api# Deploy to Railway (auto-detect Dockerfile)railway up# Deploy to AWS ECS / Google Cloud Rungcloud run deploy my-api --source .
Making the Choice
Ask these questions to decide:
How much traffic? Low β PaaS/Serverless. High β VPS.
Do you want to manage servers? No β PaaS or Serverless. Yes β VPS.