Skip to content
Back to Blog
Hosting Support8 min read

When to Use Serverless: 5 Real Decision Points

A practical decision tree for choosing between serverless, containers, and traditional hosting based on your workload patterns, budget, and team structure.

Written by Abdul AbrorTechnical Hosting Support Engineer
When to Use Serverless: 5 Real Decision Points
On this page

Over the last few years I've watched teams burn money on Lambda functions that could run on a $5 VPS, and I've seen a PHP app on shared hosting that should have been serverless from day one. The hype says serverless fixes everything. Reality is messier.

This isn't a sales pitch. It's a decision framework I use when consulting on hosting architecture — five concrete questions that cut through marketing and show you which platform fits your workload.

Decision Point 1: Traffic Pattern and Predictability

Serverless shines when traffic is bursty or unpredictable. An API that sits idle for hours then handles 10,000 requests in two minutes is exactly what Lambda was built for. You pay per invocation, scale happens automatically, and you never provision for peak load.

Traditional hosting (VPS, dedicated, even containers on a fixed cluster) forces you to size for the peak or suffer downtime. That's expensive when your peak is 20x your average. I've seen e-commerce clients pay for 8 GB of RAM year-round to handle Black Friday traffic that lasts three days.

But if your load is steady and predictable — a SaaS dashboard serving 500 concurrent users around the clock — a right-sized VPS or container is cheaper and simpler. You're paying for compute you actually use, not per-request overhead.

Ask yourself: Does my traffic spike unpredictably, or does it follow a known daily/weekly pattern I can provision for?

Workloads That Favor Serverless

  • Webhooks from third-party services (Stripe, GitHub, Slack)
  • Image processing or PDF generation triggered by user uploads
  • Scheduled jobs that run a few times per day
  • APIs behind a mobile app with irregular usage
  • Event-driven workflows (new S3 object → thumbnail generation)

Workloads That Favor Traditional Hosting

  • Always-on dashboards or admin panels
  • Real-time chat or multiplayer game servers
  • Long-running batch jobs (video transcoding that takes 20+ minutes)
  • Monolithic apps that weren't designed to boot in under a second

Decision Point 2: Cold Start Tolerance

Cold starts are the tax you pay for serverless auto-scaling. When a function hasn't run recently, the platform spins up a new container, loads your runtime, and initializes your code. For Node.js or Python that might be 100-300 ms. For Java or .NET it can hit 3-5 seconds.

If you're building a public API where every millisecond of latency matters, cold starts hurt. Users notice the lag. I once migrated a client's search API from Lambda back to a container cluster because the P99 latency from cold starts violated their SLA.

Some workarounds exist — provisioned concurrency (you pay to keep functions warm), smaller deployment packages, and runtime tricks — but they add complexity and cost. A container or VPS that's always running has zero cold start penalty.

Ask yourself: Can my workload tolerate 200-500 ms of added latency on the first request after idle time?

When Cold Starts Don't Matter

  • Async background jobs (email sending, log processing)
  • Infrequent admin tasks or cron jobs
  • Webhooks where the caller expects a 202 response immediately
  • Internal tools where humans won't notice half a second

When They Kill You

  • High-frequency trading or financial APIs
  • Real-time multiplayer game logic
  • Video streaming origin servers
  • Any API with a strict P95 latency SLA under 100 ms

Decision Point 3: State and Long-Running Processes

Serverless functions are stateless and time-limited. AWS Lambda caps at 15 minutes. Azure Functions max out at 10 minutes on the consumption plan. If your process needs to hold a connection open, keep data in memory across requests, or run for an hour, serverless isn't the right tool.

I see this mistake often: someone tries to run a web scraper that crawls 50,000 pages in Lambda. The function times out, they split it into smaller chunks, and now they're managing a complex queue system when a single long-running script on a VPS would have worked fine.

WebSocket servers, SSH tunnels, database connection pools that persist between requests — these all need traditional hosting. Serverless can call out to stateful services (Redis, RDS, DynamoDB), but the function itself is ephemeral.

Ask yourself: Does my workload need to maintain state between requests, or can each invocation start fresh?

Stateless Workloads (Good for Serverless)

  • REST APIs that fetch data, transform it, and return JSON
  • Image resizing or format conversion
  • PDF generation from HTML templates
  • ETL jobs that read from S3, process, and write back
  • CRUD operations against a managed database

Stateful or Long-Running (Need Traditional Hosting)

  • WebSocket servers for chat or live updates
  • Background workers that process a queue for hours
  • Machine learning model training (not inference)
  • Database migrations or bulk data imports
  • Video encoding jobs that take 30+ minutes

Decision Point 4: Team Experience and Operational Overhead

Serverless reduces operational burden — no SSH access, no OS patches, no server monitoring dashboards. For small teams or solo developers, that's a win. You write code, deploy, and the platform handles the rest.

But it's not zero ops. You trade server management for vendor lock-in, distributed tracing complexity, and a learning curve around IAM policies, event sources, and cold start optimization. I've watched junior devs spend a week debugging a Lambda permission issue that would have been obvious on a VPS with direct file system access.

If your team already runs Kubernetes or manages a fleet of VMs, adding serverless might introduce more complexity than it removes. If you're a startup with two engineers and no DevOps experience, Lambda's simplicity can accelerate development.

Ask yourself: Does my team have the expertise to manage servers, or would we rather offload that entirely?

Serverless Makes Sense When

  • Team is small (< 5 engineers) with no dedicated ops person
  • Nobody wants to SSH into servers or rotate security patches
  • You're prototyping and want to move fast
  • You're already deep in a cloud provider's ecosystem (AWS, Azure, GCP)

Traditional Hosting Makes Sense When

  • Team has strong Linux/container experience
  • You need full control over the runtime environment
  • Compliance requires you to audit the entire stack
  • You're running open-source software that wasn't designed for serverless

Decision Point 5: Cost Structure and Budget Predictability

Serverless pricing is pay-per-use: you're billed for execution time (measured in GB-seconds) and request count. For low-traffic workloads, this is cheap. The first million Lambda requests per month are free on AWS. A hobby project might cost $2/month.

But once you hit sustained high traffic, the math flips. A function that runs 10 million times per month at 512 MB and 200 ms average duration will cost more than a $40/month VPS that could handle the same load.

I built a calculator for a client comparing Lambda vs. a container cluster. Below 5 million requests/month, Lambda was cheaper. Above that threshold, containers on a dedicated host were 60% less expensive.

Serverless also has unpredictable spikes. A DDoS attack or a sudden traffic surge can balloon your bill in hours. Traditional hosting gives you a fixed monthly cost — your bill doesn't change if traffic doubles.

Ask yourself: Do I need predictable monthly costs, or can I tolerate variable billing based on usage?

When Serverless Is Cheaper

  • Traffic is < 5 million requests/month
  • Average execution time is under 500 ms
  • Workload is idle most of the time (nights, weekends)
  • You don't need provisioned concurrency

When Traditional Hosting Wins

  • Sustained high traffic (millions of requests per day)
  • Long average execution times (> 1 second per request)
  • Budget requires predictable fixed costs
  • You already own or lease dedicated hardware

Hybrid Approaches: You Don't Have to Pick Just One

Most production systems I work on use a mix. The main application runs on containers or a VPS for predictable performance and cost. Serverless handles the edges:

  • A Lambda function resizes user-uploaded images and writes them to S3
  • CloudFront triggers a Lambda@Edge function to rewrite URLs
  • A scheduled Lambda runs nightly backups or log rotation
  • Webhooks from Stripe or SendGrid hit API Gateway → Lambda

This hybrid model gives you the reliability of traditional hosting for core workloads and the elasticity of serverless for bursty, event-driven tasks.

Don't force everything into one paradigm. Use the right tool for each piece of your architecture.

What patterns point toward serverless?

After walking through those five decision points, here's the pattern I see most often: serverless works best for event-driven, stateless, short-duration workloads with unpredictable traffic. It's a great fit for glue code between services, async background jobs, and APIs that sit idle most of the time.

Traditional hosting (VPS, containers, dedicated) wins for always-on services, long-running processes, workloads with strict latency requirements, and high-traffic applications where per-request pricing gets expensive.

The decision isn't ideological. Run the numbers for your specific workload. Measure your traffic patterns, calculate your costs, and test cold start latency with a prototype. Most teams end up with a hybrid architecture because most real-world systems have a mix of workload types.

FAQ

Can I run WordPress on serverless?
Technically yes (AWS has a reference architecture), but it's overkill for most WordPress sites. Shared hosting or a small VPS is simpler and cheaper unless you're serving millions of page views per month.

What about databases — should those be serverless too?
Serverless databases (Aurora Serverless, DynamoDB on-demand, Cosmos DB) make sense for the same reasons: unpredictable load and infrequent access. For steady database traffic, provisioned capacity is cheaper.

How do I test serverless functions locally?
Tools like LocalStack, SAM CLI, or the Serverless Framework let you run functions locally. They simulate the cloud environment but aren't perfect — eventually you have to test in a real cloud account.

Can serverless handle WebSockets?
AWS API Gateway supports WebSocket APIs with Lambda, but it's not the same as a persistent connection on a traditional server. Each message is a separate invocation. For real-time apps with high message frequency, a dedicated WebSocket server is simpler.

What's the biggest mistake teams make with serverless?
Using it for everything because it's trendy. I've seen codebases where every CRUD endpoint is a separate Lambda function when the whole app could run on a single container with better performance and lower cost.