Build a SaaS on AWS or Vercel without paying for an architecture you don't need yet
A first SaaS needs four pieces of infrastructure: somewhere to run the code, a managed database, object storage and a queue. Here is the minimal version of each on Vercel and on AWS, and the specific signal that tells you each upgrade has earned its cost.
Search for how to build a SaaS app on AWS and you get two kinds of answer. One is a reference architecture drawn for a company with five hundred engineers: multiple accounts, a VPC per environment, EKS, an event bus, three availability zones. The other is a one-click Vercel template that deploys a login page in ninety seconds and says nothing about where the background jobs go. Neither tells you what a first SaaS actually needs, or when it is time to pay for the next piece.
That middle ground is what I want to cover. The minimal architecture is the same on both platforms: four pieces. What changes is how each piece looks, where its limits are, and which signal tells you an upgrade has earned its cost. If you are still deciding what goes into the product itself, what a SaaS MVP actually costs covers the build budget. This post is only about where it runs.
The four pieces every first SaaS needs
- 1Somewhere to run the code. One app server, or a set of serverless functions. Not both, and not a cluster.
- 2A managed database. Postgres or MySQL with automated backups and point-in-time recovery switched on. Never a database you installed on the app server yourself.
- 3Object storage. For uploads, exports and anything a user can download. Files never live on the app server's disk.
- 4A queue and a scheduler. Emails, webhooks, report generation and model calls run in the background, and nightly tasks run on a timer you would notice stopping.
That is the whole list. No cache layer, no search cluster, no second environment beyond a cheap staging copy. Each of those has a trigger, covered below. Here is how the four pieces map onto each platform.
| Piece | Minimal on Vercel | Minimal on AWS |
|---|---|---|
| Compute | Next.js routes and server actions as Vercel Functions | One EC2 instance running the app and its queue worker |
| Database | A managed Postgres from the Vercel Marketplace or any provider with pooled connections | RDS Postgres or MySQL, single instance, automated backups on |
| Object storage | Vercel Blob, or S3 if you already have an AWS account | S3, with uploads going straight from the browser via signed URLs |
| Queue and scheduler | Vercel Cron for timers; Workflows or Queues for background work | Your framework's queue on the database or Redis to start, SQS once volume justifies it; cron on the instance |
The minimal version on Vercel
Vercel is the shortest path from a Next.js repository to a production URL with preview deploys on every pull request. For a React product that mostly reads and writes records, take that advantage. The constraints are about time and size, and they shape the architecture more than the price does.
- Function duration is capped. As of November 2026, Vercel's documentation lists a 300 second maximum on Hobby and 800 seconds on Pro, with a longer limit in beta. A PDF export over a large account or a multi-step model call does not belong in a request; it belongs in a background workflow.
- Request bodies are capped too. The default limit is 4.5 MB, so file uploads should go directly from the browser to object storage with a signed URL, never through a function.
- Connections are the database's problem. Functions scale out quickly, and each instance that opens its own database connection can exhaust a small database. Use a provider with a connection pooler from the first day.
- Background work has a home now. Vercel Workflows has been generally available since April 2026, and Vercel Queues was still in public beta in November 2026. Check the status before you depend on a beta for billing-critical jobs.
On price, the structure matters more than the headline. As of November 2026, Pro is $20 per developer seat per month and includes $20 of usage credit; beyond that, functions, data transfer and image optimisation are billed by usage, and new Pro teams get a default on-demand budget that you can change and set to pause projects. Set that budget on the first day. Usage pricing is cheap for a product with ten customers and painful for a product with one bot hammering an uncached route.
Here is the signed upload pattern that keeps large files off your functions. It works the same whether the app runs on Vercel or AWS.
// app/api/uploads/route.ts: hand the browser a short-lived URL to S3.
import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3";
import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
const s3 = new S3Client({ region: process.env.AWS_REGION });
export async function POST(req: Request) {
const user = await requireUser(req); // your auth
const { contentType } = await req.json();
const key = `tenants/${user.tenantId}/uploads/${crypto.randomUUID()}`;
const url = await getSignedUrl(
s3,
new PutObjectCommand({ Bucket: process.env.UPLOAD_BUCKET, Key: key, ContentType: contentType }),
{ expiresIn: 300 }, // five minutes is plenty
);
return Response.json({ url, key });
}Note that the tenant is in the key. Storage is one of the isolation boundaries that leak when nobody thinks about it, and the key prefix is the cheapest place to enforce it.
The minimal version on AWS
AWS has every component you could need, and most tutorials nudge you towards a production layout before you have production traffic. For a first SaaS on a framework like Laravel, Rails or Django, the minimal layout is one instance, one managed database and one bucket.
- One EC2 instance running the web server, the queue worker and the scheduler. Deployed from a pipeline, never by hand, and rebuilt from a script so it is replaceable.
- RDS, single instance, with automated backups and point-in-time recovery on. Multi-AZ can wait for a measured reason; a restore you have practised cannot.
- S3 for every file, with signed URLs for uploads and downloads.
- The framework's own queue on the database or a small Redis to start. SQS is excellent, but your framework's queue driver gives you retries, failure handling and a dashboard for free.
Lambda is a reasonable alternative to the instance if your team already thinks in functions, and as of November 2026 AWS lists a 30 minute maximum timeout, which is generous. But a framework built around a long-lived worker and scheduler is simpler on one server. Pick the shape your framework expects.
Which one to start on
- Mostly a Next.js app, little background work: Vercel, with a managed Postgres and a queue product for the slow parts.
- Laravel, Rails or Django, or heavy background jobs: one server on AWS, or a managed platform that gives you a persistent worker.
- A Next.js frontend with a separate API: frontend on Vercel, API and workers on AWS, in the same region as the database. Put them in different regions and every request pays the round trip.
Whichever you choose, the parts that decide whether the product survives its first month are the same: deploys you can roll back, failed jobs that alert you, backups you have restored. The launch checklist covers those, and none of them depends on the platform.
Upgrades: what triggers each one, and what it costs you
Every upgrade below is a good idea at some point. The mistake is buying it on a feeling, or because the reference architecture had it. Each one should wait for a trigger you can measure.
| Upgrade | What triggers it | What it costs you |
|---|---|---|
| Connection pooler for the database | Connection errors or the database's connection count near its limit during traffic spikes, common with serverless functions | A small extra service or plan tier, and a check that your ORM's transactions work through it |
| Separate worker server | Queue wait time rising while web requests slow down, because jobs and requests share one CPU | A second instance to patch and deploy; the deploy pipeline now has two targets |
| Second app server and a load balancer | Sustained high CPU on the app server at normal traffic, or a customer contract that requires no single point of failure | The load balancer's hourly charge, shared sessions and cache, and scheduled tasks that must run on one server only |
| Redis for cache and sessions | The same expensive queries showing up at the top of your slow query log, or the database queue struggling under job volume | Another managed service and another thing that can be down; cache invalidation bugs |
| SQS or a managed queue | Job volume or fan-out that the database queue cannot keep up with, or jobs triggered by other AWS services | Different failure semantics to learn: visibility timeouts and dead-letter queues |
| Read replica | Reports and exports slowing down the queries customers wait on | Roughly another database instance, plus replica lag your code must tolerate |
| Multi-AZ database | A contract or SLA that needs automatic failover, or downtime that is now costing real revenue | Roughly double the database line, for a standby that serves no traffic |
| CDN in front of object storage | Download traffic becoming a visible line on the bill, or users far from your region complaining about speed | Cache rules to configure, and signed URLs that work through the CDN |
| Containers on ECS or similar | More than one service with different runtimes, or a team big enough that deploy conflicts slow people down | Image builds, a registry, task definitions and more networking to understand |
| Multi-region | Data residency requirements in a market you sell into, or latency you have measured for a real customer base | Data replication, conflict handling and roughly double the infrastructure |
| Kubernetes | Several teams deploying many services independently, and someone whose job is running the cluster | A permanent operations workload; the cluster becomes a product of its own |
Name the metric that is hurting
CPU, queue wait, slow queries, connection errors, a contract clause
Is it measured, not felt?
↳ No: add monitoring and wait a fortnight
Can a code fix solve it?
An index, a missing eager load, a job that should be batched
↳ Yes: fix the code first
Does the upgrade cost less than the problem?
↳ No: live with it and keep measuring
Buy the smallest upgrade that moves the metric
Most performance triggers on a young SaaS end at the second check: a missing index is cheaper than a read replica.
What I would not pay for in the first year
- Separate AWS accounts per environment. Good practice at scale; a single account with a separate staging database and bucket is enough to start.
- Infrastructure for traffic you are hoping for. Size for the traffic you have, plus the headroom a resize gives you in minutes.
- Private networking you cannot explain. If nobody on the team can say why a subnet is private, it is costing you a NAT gateway for nothing.
The bill for an oversized architecture is not on the AWS invoice. It is in the hours your developers spend running it instead of building the product.
Four pieces, one region, a written trigger for each upgrade. That carries most products a long way past launch, on either platform, and it leaves the budget for the work customers actually see. If you want a SaaS built on that footing, or a second opinion on an architecture that already feels heavier than the product, I scope the build up front with a fixed price. Get a fixed-scope build quote.
Questions people ask
Should I build my SaaS on AWS or Vercel?
Use Vercel if the product is a Next.js app whose work fits inside a request and you want deploys with no servers to look after; use AWS if you need long-running background workers, a framework that expects a persistent server, or tight control over networking. Many products end up using both: the frontend on Vercel and the API and workers on AWS.
What is the minimum AWS architecture for a SaaS?
One compute instance running the app and its queue worker, a managed database on RDS, an S3 bucket for uploads and a queue, which can live in the database or SQS to begin with. Add a load balancer, a second server, read replicas and containers only when a measurement says you need them.
Can you run a production SaaS on Vercel?
Yes, as long as you design around how functions work: each invocation has a maximum duration, request bodies have a size limit, and anything slow belongs in a queue or a workflow rather than a request. A paying product belongs on the Pro plan for spend management, longer log retention and team access.
How much does it cost to host a SaaS on AWS or Vercel?
For a new product with modest traffic, hosting is usually a small monthly line on either platform; the bill grows with usage rather than with time. The surprises come from things you switch on rather than traffic you serve: NAT gateways, idle redundancy, image optimisation and uncapped usage-based pricing.
When should a SaaS move to Kubernetes or microservices?
When you have several teams that need to deploy independently and an operations person to run the cluster, which for most products is years after launch. Before that point, both add more running cost and engineering time than they save.
Building something like this?
I design and ship these systems for clients: retrieval over private data, agents that complete real tasks, and the Laravel platforms underneath them.