Architecture
Serverless vs containers: which architecture fits your SaaS?
Start serverless, move to containers when the data tells you to. Serverless costs $0-$20/month at launch but scales to $500-$5,000/month at 100K users. Containers cost $50-$150/month upfront but stay at $300-$2,000/month at scale. The crossover point is around 10,000 users for most SaaS products.
Serverless and containers solve different problems. Picking the wrong one costs you months of rework. A SaaS product that starts on Kubernetes when it has 50 users burns $2,000/month on infrastructure it doesn't need. A product that starts serverless and hits 100K requests/second discovers cold starts are destroying its P99 latency. Both mistakes are expensive to reverse.
This guide breaks down serverless vs containers with real cost numbers, specific tradeoffs, and a decision framework you can apply to your cloud architecture today.
What serverless means in practice
Serverless architecture means you write functions, deploy them, and let the cloud provider handle servers, scaling, and availability. You don't provision instances. You don't patch operating systems. You don't configure load balancers.
The three dominant serverless platforms in 2026 are AWS Lambda, Vercel Functions, and Cloudflare Workers. Each works differently under the hood:
- AWS Lambda runs your code in isolated containers that spin up on demand. You pay per invocation ($0.20 per 1M requests) plus execution time ($0.0000166667 per GB-second). Cold starts range from 100ms to 3 seconds depending on runtime and package size.
- Vercel Functions wraps AWS Lambda with a better developer experience. Deploys happen on git push. You get preview URLs for every branch. The free tier covers 100K function invocations/month.
- Cloudflare Workers runs on V8 isolates at the edge, not containers. Cold starts are under 5ms. You pay $0.50 per million requests after the free tier of 100K requests/day.
The pricing model is the same across all three: you pay for what you use. Zero traffic means zero cost. This makes serverless for SaaS products attractive at launch, when traffic is unpredictable and every dollar matters.
What containers mean in practice
Docker containers package your application code, runtime, and dependencies into a single image that runs the same way on any machine. You build the image once, push it to a registry, and deploy it wherever you want.
Container orchestration is the layer that manages those images in production. Kubernetes is the dominant orchestration platform, but it's not the only option:
- Docker + single server works for early-stage products. Run your containers on a $20/month VPS with Docker Compose. No orchestration overhead. You handle restarts and deploys manually or with a simple script.
- AWS ECS / Google Cloud Run gives you managed container orchestration without the full Kubernetes complexity. You define your containers, set scaling rules, and the platform handles the rest. Cloud Run charges per request like serverless but runs full containers.
- Kubernetes (EKS, GKE, self-hosted) gives you complete control over scheduling, networking, and resource allocation. It requires a dedicated DevOps engineer or a team familiar with YAML manifests, Helm charts, and ingress controllers.
- Fly.io / Railway offers a middle ground: deploy Docker containers with a simple CLI, get automatic scaling, and pay based on resource usage. No Kubernetes knowledge required.
The cost model for containers is different from serverless. You pay for compute time whether requests come in or not. A container running 24/7 on ECS costs $30-$150/month depending on CPU and memory allocation. But the cost stays predictable as traffic grows, while serverless bills can spike with sudden traffic bursts.
Serverless vs containers: the comparison
| Factor | Serverless | Containers |
|---|---|---|
| Cost at low traffic | $0-$5/month. Pay per invocation. | $20-$150/month. Containers run 24/7. |
| Cost at high traffic | $500-$5,000+/month. Scales linearly with requests. | $200-$2,000/month. Fixed compute, predictable bills. |
| Cold starts | 100ms-3s (Lambda), <5ms (Cloudflare Workers) | None. Containers stay warm. |
| Scaling | Automatic, instant, to thousands of concurrent instances | Horizontal scaling with rules. Takes 30-90s to spin up new instances. |
| Debugging | Hard. Distributed traces, no local replication of prod environment. | Easier. SSH into container, reproduce locally with same image. |
| Vendor lock-in | High. Lambda code doesn't port to Cloudflare Workers without rewriting. | Low. Docker images run anywhere. |
| Team skill requirements | Low. Write functions, deploy. No infra knowledge needed. | Medium to high. Docker basics minimum; Kubernetes needs dedicated expertise. |
| Deployment complexity | Simple. Git push or CLI deploy. | Medium. Build image, push to registry, update service. Kubernetes adds YAML configuration. |
When serverless wins
Serverless architecture is the right choice when your workloads are event-driven, your traffic is unpredictable, and your team wants zero infrastructure management.
Event-driven workloads. A webhook endpoint that processes Stripe payment events. An image resizer that triggers when users upload files. A notification service that fires on database changes. These workloads run for milliseconds, happen unpredictably, and sit idle most of the time. Paying for a container to wait for these events wastes money.
APIs with variable traffic. A SaaS product that gets 100 requests/hour during the night and 10,000 requests/hour during business hours benefits from serverless auto-scaling. You don't pay for the quiet hours, and you don't scramble to scale during the busy ones.
Startups that want zero ops. If your team is two founders and a designer, spending time on Docker configurations and Kubernetes manifests takes time away from building features. AWS Lambda and Vercel let you deploy with a git push and focus on your product.
When containers win
Docker containers are the right choice when your workloads run for extended periods, your traffic is predictable, or your architecture requires fine-grained control over resources.
Long-running processes. A video transcoding service that processes files for 10-30 minutes per job. A machine learning inference server that loads a 2GB model into memory. A WebSocket server that holds persistent connections. Serverless functions time out after 15 minutes on Lambda (less on other platforms). Containers run as long as you need them.
Predictable traffic patterns. A B2B SaaS product with 500 enterprise users generates consistent traffic during business hours. Container costs stay flat at $100-$300/month. The same traffic on Lambda might cost $400-$800/month because you're paying per-request instead of per-hour.
Complex microservices. When you have 10+ services that need to communicate over internal networks, share databases, and maintain persistent connections, container orchestration gives you service discovery, health checks, and network policies that serverless platforms don't offer.
GPU workloads. ML model training, real-time inference, and image/video processing require GPU access. AWS Lambda doesn't support GPUs. Containers on GPU-enabled instances (ECS, GKE, or bare metal) give you direct hardware access.
The hybrid approach: use both
The best cloud architecture for most SaaS products in 2026 isn't purely serverless or purely containerized. It's a hybrid.
Serverless for your API layer. Your REST or GraphQL API handles variable traffic, runs short-lived request/response cycles, and benefits from automatic scaling. Deploy it on Vercel, Lambda, or Cloudflare Workers. Cost at launch: $0.
Containers for background jobs and workers. Your email queue processor, report generator, data pipeline, and cron jobs run as Docker containers on ECS, Fly.io, or a simple VPS. These workloads run continuously, process data in bulk, and don't need per-request scaling. Cost: $20-$100/month for a single worker container.
This hybrid pattern keeps your infrastructure bill under $50/month at launch while giving you the flexibility to scale individual components independently. Your API scales to 10,000 concurrent users without any configuration changes. Your background workers scale by adding more container replicas when queue depth increases.
Cost comparison at different scales
Real numbers matter more than theoretical pricing models. Here's what serverless vs containers costs at three growth stages for a typical SaaS product with an API, a database, and background job processing.
0-1,000 users: the launch phase
Serverless: $0-$20/month. Vercel's free tier covers your API. A managed Postgres database on Neon or Supabase costs $0-$25/month. Total infrastructure: under $25/month.
Containers: $50-$150/month. A small ECS task or Fly.io instance runs your API ($20-$50/month). A managed database adds $25-$50/month. A background worker adds another $20-$50/month.
Winner: serverless. At this stage, you're burning cash on product development, not scaling. Every dollar saved on infrastructure goes toward building features.
1,000-10,000 users: growth phase
Serverless: $100-$500/month. Lambda invocations scale linearly. Database costs increase to $50-$200/month. You start paying for Vercel Pro ($20/month) to get higher limits.
Containers: $150-$400/month. Your API container scales to 2-3 replicas ($60-$150/month). Database costs are the same. Background workers might need a second instance ($40-$100/month).
Winner: depends on traffic pattern. If your traffic is spiky (consumer app), serverless still wins. If your traffic is steady (B2B SaaS), containers pull ahead because you stop paying the per-request premium.
10,000-100,000 users: scale phase
Serverless: $500-$5,000/month. Lambda costs grow fast at high request volumes. Vercel Enterprise pricing kicks in. You start hitting concurrency limits and need to request increases from AWS.
Containers: $300-$2,000/month. Your API runs on 4-8 container replicas with a load balancer. Costs grow with CPU and memory allocation, not per-request. The cost curve flattens because adding a container replica handles thousands more requests per second.
Winner: containers. At this scale, the per-request pricing model of serverless works against you. A single container handling 1,000 requests/second costs $50/month. The same throughput on Lambda costs $500+/month.
What Savi recommends for most SaaS products
Start serverless. Move specific workloads to containers when the data tells you to.
For 90% of the SaaS products we build at Savi, the right architecture at launch is: Next.js on Vercel (serverless) + managed Postgres on Neon or Supabase + a single background worker container on Fly.io or Railway. Total infrastructure cost: $0-$50/month.
This setup handles 0-10,000 users without architectural changes. When you hit 10K users, you have revenue, usage data, and specific bottlenecks you can identify. Then you move the bottleneck, and only the bottleneck, to a container. Maybe your API endpoint that generates PDF reports takes 30 seconds and times out on Lambda. Containerize that one endpoint. Keep everything else serverless.
This approach works because it optimizes for the constraint that matters most at each stage. At launch, your constraint is time and money. Serverless gives you both. At scale, your constraint is cost efficiency and latency. Containers give you both.
Red flags: when teams pick the wrong architecture
Don't adopt Kubernetes until you have 50+ microservices or specific compliance requirements that mandate it. Kubernetes is a powerful tool for orchestrating large-scale distributed systems. It's also a full-time job to maintain. A startup with 3 services running Kubernetes is paying $500-$1,500/month in managed cluster costs and spending 10-20 hours/week on DevOps work that a Vercel deploy would eliminate.
Don't stay serverless when your Lambda bill exceeds $1,000/month. At that point, run the numbers on containers. You'll often find that 3-4 container replicas at $200/month handle the same load that costs $1,000+ on Lambda.
Don't pick a cloud architecture based on what Netflix or Uber uses. Those companies have 500+ engineers, dedicated platform teams, and traffic volumes that require custom infrastructure. Your SaaS product with 2,000 users and 3 engineers needs a boring, predictable stack that ships features fast.
Don't confuse container orchestration with Docker. Docker is simple. You write a Dockerfile, build an image, and run it. Kubernetes is complex. It adds networking, service discovery, secrets management, ingress controllers, and a steep learning curve. You can use Docker without Kubernetes. Most early-stage products should.
The goal of your cloud architecture isn't to be impressive on a whiteboard. It's to keep your product running, your bills predictable, and your team shipping features instead of fighting infrastructure.
Frequently asked questions
Is serverless cheaper than containers for a SaaS product?
At launch (0-1,000 users), serverless costs $0-$20/month vs. $50-$150/month for containers. At scale (10,000-100,000 users), containers win: $300-$2,000/month vs. $500-$5,000/month for serverless. The crossover point is around 10,000 users, where per-request pricing starts working against you.
What are serverless cold starts and do they matter?
Cold starts happen when a serverless function spins up after being idle. AWS Lambda cold starts range from 100ms to 3 seconds depending on runtime and package size. Cloudflare Workers stay under 5ms. Cold starts matter for latency-sensitive APIs but not for event-driven workloads like webhook processing or image resizing.
When should I use containers instead of serverless?
Use containers for long-running processes (video transcoding, ML inference), predictable traffic patterns (B2B SaaS with steady usage), GPU workloads, or systems with 10+ microservices. Serverless functions time out after 15 minutes on Lambda. Containers run as long as you need them and cost less at high, consistent traffic volumes.
Can I use both serverless and containers together?
Yes, and most successful SaaS products do. Run your API on serverless (Vercel, Lambda) for automatic scaling at $0 launch cost. Run background jobs, queues, and workers as containers on Fly.io or ECS for $20-$100/month. This hybrid keeps infrastructure under $50/month at launch while scaling individual components independently.
Should my startup use Kubernetes?
Not until you have 50+ microservices or specific compliance requirements. Kubernetes costs $500-$1,500/month in managed cluster fees and consumes 10-20 hours/week in DevOps work. A startup with 3 services should use simpler options like Fly.io, Railway, or Docker Compose on a $20/month VPS.
Related reading
CI/CD for startups: ship faster without breaking things
Manual deploys work at 2 engineers. They break at 5. Here's the minimum CI/CD pipeline every startup needs, with free tools and a setup that takes one afternoon.
When to migrate from a monolith to microservices (and when not to)
Most startups adopt microservices too early. Most enterprises wait too long. Here's how to know when your monolith has outgrown itself, and how to migrate without a rewrite.
Supabase vs Firebase vs custom backend: which one for your startup
Supabase gives you Postgres for free until 500MB. Firebase scales to millions but locks you into Google's ecosystem. A custom backend costs $3,000-$8,000 upfront but gives you full control.
Need help with your cloud architecture?
We design infrastructure that scales with your product, not ahead of it. 30-minute call.
Talk to our team