Serverless vs Traditional Server: Cost and Maintenance Perspective
Why Serverless Became Popular
The reason serverless became popular is clear. No server management needed. Easy setup, automatic scaling. Especially platforms like Vercel - just git push and deployment is done.
But after using both serverless and traditional servers for several years, I realized the choice should differ based on the situation.
Cost Comparison: Real Numbers
Case 1: Small Blog/Portfolio
5,000 monthly visitors, mostly static content
Vercel (Serverless):
- Hobby Plan: $0/month
- Includes 100GB/month bandwidth
- Includes 100GB-Hours serverless functions
Traditional Server (VPS):
- Cheap VPS: $5~10/month
- Self-management required (SSL, security patches, etc.)
Conclusion: Serverless wins. Can operate sufficiently for free.
Case 2: Medium-sized SaaS
1,000 daily active users, many API calls
Vercel (Serverless):
- Pro Plan: $20/month
- Additional bandwidth: $0.15/GB
- Additional function execution: $0.18/GB-Hour
- Estimated cost: $20~100/month (varies with traffic)
Traditional Server (VPS):
- Mid-tier VPS: $20~40/month
- Fixed cost (regardless of traffic)
- Self-management required
Conclusion: Similar but consider variability. VPS might be favorable if traffic is predictable.
Case 3: High-Traffic Service
50,000 daily visitors, lots of images/videos
Vercel (Serverless):
- Pro Plan: $20/month
- Additional bandwidth (over 500GB): ~$60/month
- Additional function execution: ~$50/month
- Estimated cost: $130+/month
Traditional Server (VPS + CDN):
- High-tier VPS: $40/month
- Cloudflare free: $0
- Estimated cost: $40/month (fixed)
Conclusion: Traditional server wins. Higher traffic means rapidly increasing serverless costs.
Maintenance Perspective
Serverless Advantages
1. Zero Infrastructure Worries
Serverless:
- OS updates? Automatic
- Security patches? Automatic
- Scaling? Automatic
- Monitoring? Built-in
Traditional Server:
- OS updates: Do it yourself
- Security patches: Check and apply manually
- Scaling: Configure yourself
- Monitoring: Build yourself
2. Simplified Deployment
# Vercel
git push origin main # Done
# Traditional Server
git push origin main
ssh user@server
cd /var/www/app
git pull
npm install
npm run build
pm2 restart all
# If something goes wrong, rollback...
Traditional Server Advantages
1. Predictable Costs
This matters in client projects. Telling clients "monthly costs vary with traffic" makes them anxious.
Client: "Why is this month's server bill 3x higher?"
Me: "It went viral..."
β To avoid this, fixed-cost infrastructure is better.
2. More Control
Possible things:
- Custom runtime settings
- Background jobs (cron)
- WebSocket/real-time connections
- Local filesystem access
- Long-running processes
Serverless has execution time limits (Vercel default 10s, Pro 60s), making it unsuitable for certain tasks.
3. No Cold Start
Serverless functions "sleep" when unused for a while. Waking up takes time (Cold Start).
Typical API response times:
- Traditional Server: 50~100ms (consistent)
- Serverless: 50~100ms (warm) / 500~2000ms (cold)
For user experience-sensitive services, Cold Start can be problematic.
My Selection Criteria
Choose Serverless
- Low or unpredictable traffic
- MVP or early startup
- Frontend + simple API
- Don't want to spend time on deployment/ops
- Client has no technical background
Choose Traditional Server
- High and predictable traffic
- Need long-running processes
- Cost predictability is important
- Real-time features (WebSocket, etc.)
- Already have server management experience
Hybrid Approach
In practice, I often mix both.
My common setup:
Frontend: Vercel (Serverless)
βββ Static pages
βββ ISR/SSG
βββ Simple API Routes
Backend: Railway or VPS
βββ NestJS API server
βββ Cron jobs
βββ WebSocket
βββ Long-running tasks
Database: Supabase or self-hosted
Specific Examples
This blog's setup:
- Next.js frontend: Vercel (free)
- PostgreSQL: Vercel Postgres (paid plan)
- Images: Vercel Blob
Monthly cost: ~$25 (mostly DB costs)
Client project example:
- Next.js frontend: Vercel Pro ($20)
- NestJS backend: Railway ($20)
- PostgreSQL: Included in Railway
- Redis: Included in Railway
Monthly cost: $4060 (fixed)
Cost Optimization Tips
1. Maximize CDN Usage
Images, JS, CSS β Cloudflare CDN (free)
Reduced origin server load β Serverless cost savings
2. Utilize ISR/SSG
SSR in serverless costs money. Make as many pages static as possible.
// Expensive approach
export default async function Page() {
const data = await fetch("...")
return <Component data={data} />
}
// Cost-saving approach
export default async function Page() {
const data = await fetch("...", {
next: { revalidate: 3600 } // 1 hour cache
})
return <Component data={data} />
}
3. Set Usage Alerts
Both Vercel and AWS allow cost alert settings. Prevents unexpected billing surprises.
Vercel settings:
Settings β Billing β Spend Management β Set alerts
Conclusion
Serverless vs Traditional Server isn't about "which is better."
- Serverless: Buying time with money
- Traditional Server: Buying money with time
As a solo developer, if time is your most precious resource, serverless is right. But if cost is important and you're confident in server management, traditional servers are also a good choice.
In my case, most projects start with serverless (Vercel). When traffic increases and costs become burdensome, I migrate to traditional servers then. This approach has been most efficient.