Thomas Osayi

November 23, 2026 · 8 min read · Thomas Osayi

Vercel vs Railway vs Render for hosting a SaaS: servers, workers, databases and cost

Vercel vs Railway vs Render for a SaaS backend: serverless vs long-running servers, background workers, databases, websockets and pricing at the time of writing.

Hosting a marketing site is a solved problem. Hosting a SaaS is different, because a product has parts that do not fit neatly into a web request: a worker that sends emails in the background, a job that syncs data every hour, a websocket that keeps a dashboard live, a database that needs backups. Where those parts run is the real question behind Vercel vs Railway vs Render.

I deploy most of my Next.js work on Vercel, and I reach for a long-running server platform when a product needs one. This post compares the three for a SaaS backend specifically. If you are choosing hosting for a small business website instead, "Best hosting for a small business website in 2026" is the right read; this one assumes you are running an app with users, data and background work.

Vercel vs Railway: what is the real difference?

Vercel runs your code as functions that start for a request and stop when it finishes, while Railway runs your code as containers that stay up until you stop them.

That difference decides almost everything else. On Vercel, each route handler, server action or API route becomes a Vercel Function. It scales automatically and you pay for the CPU time and memory it uses. The limit is time: at the time of writing, functions on Hobby can run for up to 300 seconds, and Pro can raise that to 800 seconds, with an extended 1,800 second maximum in beta. When a function runs out of time, you get the FUNCTION_INVOCATION_TIMEOUT error that "Vercel function timeout (FUNCTION_INVOCATION_TIMEOUT): causes and fixes" covers.

On Railway, you deploy a service, often from a Dockerfile or a detected framework, and it keeps running. A Node server, a Python worker, a Redis instance and a Postgres database can all sit in one project and talk over a private network. There is no request timeout of the same kind, because the process is not tied to a single request.

Render works like Railway in this respect, with long-running web services, background workers, cron jobs and managed databases. The main difference from Railway is how you pay.

Vercel and Railway, option by option

Vercel is the strongest choice for the Next.js app itself, and Railway is the most flexible place for everything that needs to stay running.

Vercel

  • Best for: the Next.js front end, server-rendered pages, API routes that answer in seconds, and preview deployments for every branch.
  • Cost range: Hobby is free with hard usage caps you cannot buy past; Pro is $20 per developer seat a month with $20 of included usage credit, at the time of writing.
  • Pros: the smoothest Next.js deployment I know of; previews on every push; automatic scaling; a CDN in front of everything; cron jobs, queues and workflows built in.
  • Cons: functions have a maximum duration; long-lived connections and always-on workers are newer, beta features; databases come from Marketplace partners rather than Vercel itself.

Railway

  • Best for: API servers, queue workers, bots, websocket servers and databases you want next to your code.
  • Cost range: at the time of writing, Free is $0 with $1 of monthly credit after a 30-day $5 trial; Hobby has a $5 monthly minimum that includes $5 of usage; Pro has a $20 minimum that includes $20. Usage beyond that is billed by the second, roughly $20 per vCPU-month and $10 per GB of memory a month, plus $0.05 per GB of egress.
  • Pros: anything that runs in a container runs here; managed Postgres and Redis in the same project; private networking; per-second billing; an optional serverless mode that sleeps idle services.
  • Cons: no Next.js-specific previews and CDN features in the way Vercel has them; costs are usage-based, so set alerts; cron jobs must exit when finished.

Render, and how it compares

Render offers the same long-running model as Railway with fixed monthly instance prices, which some founders find easier to budget.

Render

  • Best for: teams that want predictable monthly bills for web services, background workers and Postgres, and products moving off a traditional server.
  • Cost range: at the time of writing, the Hobby workspace is $0 plus compute and Pro is $25 a month plus compute. Web services start free (512 MB), then $7 a month for under one CPU and 512 MB, and $25 a month for one CPU and 2 GB. Postgres starts free, then $6 a month for the smallest paid instance.
  • Pros: simple fixed pricing; web services, private services, background workers and cron jobs as first-class types; managed Postgres and a Redis-compatible Key Value store; websockets on long-running services.
  • Cons: free web services spin down after 15 minutes without traffic and take about a minute to wake; free Postgres databases expire 30 days after creation; background workers and cron jobs have no free tier.

Where should background workers and scheduled jobs run?

Anything that runs for minutes or must keep running belongs on a long-running service or a purpose-built job system, not inside a request handler.

Typical SaaS background work includes sending onboarding emails, generating reports, syncing data from Shopify or an ad platform, processing uploads and calling AI models in bulk. On Vercel, the options at the time of writing are cron jobs that call a function, Vercel Queues (public beta), Vercel Workflows for multi-step jobs that can pause and resume, and Vercel Daemons (public beta) for always-on workers running in production only. Each workflow step and each function call still has the function duration limit.

On Railway, a worker is just another service with a start command that never exits, such as a BullMQ consumer reading from Redis. Railway cron jobs start a service on a schedule, run it, and expect it to exit. The minimum interval is five minutes, only one run can be active at a time, and failed runs are not retried automatically.

On Render, a background worker is its own service type billed like a web service, and cron jobs are billed per minute of runtime, from $0.00016 a minute on the smallest instance at the time of writing.

"Cron jobs and background jobs in Next.js on Vercel" covers the scheduling side in more depth.

Where should the database live?

Put the database on a managed service close to where your code runs, and pick the host second if your database choice is already made.

On Railway and Render, managed Postgres sits in the same dashboard as your services, with private networking between them. That is convenient, and it keeps latency low between a worker and its data. Render lists point-in-time recovery of three days on Hobby and seven days on Pro and above at the time of writing.

On Vercel, you connect a database through the Marketplace or bring your own, such as Supabase, Neon or Firebase. The thing to watch is connection count. Functions scale out quickly, and each instance can open its own database connection, so use a pooled connection string or an HTTP-based driver.

Whichever you pick, test a restore before launch. "How to back up your Supabase or Firebase database (and test the restore)" walks through it. A backup you have never restored is a hope, not a plan.

Can you run websockets on each platform?

Railway and Render handle websockets naturally because the server stays up, while Vercel supports them in public beta with connections that end at the function's maximum duration.

At the time of writing, Vercel Functions can serve WebSocket connections on all plans with Fluid compute. A connection stays on the instance that accepted it, in-memory state is not shared across instances, and the connection closes at the function's maximum duration, so the client must reconnect. Vercel suggests Server-Sent Events when data only flows from server to client, such as streaming AI responses, and an external store such as Redis for presence and fan-out.

For a chat feature or a live dashboard on an MVP, I usually skip raw websockets altogether and use Firestore listeners or Supabase Realtime. "Realtime in a web app: Firestore listeners vs Supabase Realtime vs websockets vs polling" compares those options.

What does hosting a SaaS cost per month?

For a small SaaS MVP, a realistic budget is roughly $20 to $60 a month across app hosting, one worker and a managed database, before any heavy usage.

As an illustration, take a made-up B2B reporting tool with a few hundred users, a Next.js dashboard, a worker that pulls data from an ad platform every hour, and Postgres.

  • Next.js app on Vercel Pro: $20 a month for one developer seat, with $20 of usage credit that a small app may not exhaust.
  • Worker on Railway Hobby: a small Node process using a fraction of a vCPU and a few hundred megabytes of memory can stay near the $5 minimum, depending on how busy it is.
  • Postgres on Render: $6 a month for the smallest paid instance, or more for extra memory and storage.

That lands around $31 a month before growth. The same app entirely on Render, with a $7 web service, a $7 worker and $6 Postgres, would be about $20 a month plus the $25 Pro workspace fee if you need team features. "What does it cost to run an AI-built app per month? A real budget" breaks down the other line items, such as email and auth.

Which should you pick for your SaaS?

Choose by the shape of your workload: request-and-response apps fit Vercel, always-running processes fit Railway or Render, and many products use both.

  • Next.js SaaS with short requests and a managed database such as Supabase or Firebase: Vercel alone.
  • Next.js SaaS with heavy background work, long jobs or a websocket server: Vercel for the app, Railway or Render for the worker.
  • Non-Next.js backend, such as Express, Django or Rails: Railway or Render.
  • Founder who wants fixed monthly prices: Render.
  • Founder who wants to pay only for what runs, including sleeping idle services: Railway.

If you are moving an app off another platform, "How to move a Replit app to Vercel: code, env vars, database and build settings" shows the steps for the most common case.

The bottom line

Vercel, Railway and Render solve different halves of SaaS hosting. Vercel is the best place for a Next.js app and short functions; Railway and Render are better for servers, workers and databases that must keep running, with Railway billing by usage and Render by fixed instance. Start with the simplest setup that fits today's workload, add a worker platform when a job outgrows a function, and set spend alerts on day one. If you want it set up for you, my SaaS MVP package from $1,200 ships the app deployed with jobs and environments configured.

Questions, answered in one line

Is Railway better than Vercel?

Neither is better overall: Vercel is stronger for Next.js front ends and short requests, while Railway is stronger for servers, workers and databases that need to keep running.

Can I host a database on Vercel?

Vercel connects to managed databases through its Marketplace rather than running a database on your project directly, while Railway and Render both offer managed Postgres in the same dashboard as your services.

Does Vercel support websockets?

At the time of writing Vercel Functions support WebSocket connections in public beta on all plans, but each connection closes when the function reaches its maximum duration, so clients need reconnect logic.

Is Render free tier good enough for a SaaS?

Render's free web service is fine for demos, but it spins down after 15 minutes without traffic and takes about a minute to wake, and free Postgres databases expire after 30 days.

How much does hosting a SaaS MVP cost per month?

A small SaaS MVP commonly runs on roughly $20 to $60 a month across app hosting, a worker and a managed database on these platforms, depending on traffic and instance sizes.

Can Thomas Osayi set up hosting for my SaaS?

Thomas Osayi's SaaS MVP package, from $1,200 in about 21 days, ships the app deployed on hosting that fits it, with environment variables, domains and background jobs configured.

Sources

About the author

Thomas Osayi is a full-stack developer in Los Angeles studying computer science at Loyola Marymount University. He founded and built SQWAD, a SaaS platform Shopify brands use to run creator programs, and builds custom Next.js websites, SaaS MVPs and fixes for AI-built apps for businesses and founders.

See his work · Services and prices

Related articles

SaaS MVP and full-stack web app development

I build SaaS MVPs and full-stack web apps in Next.js, TypeScript and Firebase or Postgres: auth, dashboards, payments, roles and admin tools. Founder of SQWAD.

See the service