---
title: "Scaling a SaaS application on Railway"
description: "A Remix and PostgreSQL job board on Railway is scaled up with a staging environment tied to a `stage` branch, automatic vertical scaling, and horizontal replicas."
url: "https://swe.quest/articles/scaling-a-saas-application-on-railway-5732010c40cc6710"
canonical: "https://blog.railway.com/p/scaling-a-saas-application"
source: "Railway"
published: "2024-12-13"
difficulty: "medium"
kind: "How-to"
reading_minutes: 10
tags: ["scalability","caching","cdn-edge","deployment","storage-systems"]
---

# Scaling a SaaS application on Railway

A post on [Railway](https://swe.quest/sources/railway.md), published 2024-12-13, 10 min read, How-to. Original: [https://blog.railway.com/p/scaling-a-saas-application](https://blog.railway.com/p/scaling-a-saas-application)

## Summary

A Remix and PostgreSQL job board on Railway is scaled up with a staging environment tied to a \`stage\` branch, automatic vertical scaling, and horizontal replicas. Replicas cannot be added while the service uses a persistent volume, so file uploads move to a self-hosted, S3-compatible MinIO bucket and resume downloads are served through pre-signed URLs. Costs are cut by caching job detail pages for an hour at Cloudflare using a Remix \`Cache-Control\` header plus a Cloudflare cache rule, sleeping the staging app when idle, and using private networking to avoid egress fees.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Scaling](https://swe.quest/tags/scalability.md) (Distributed systems)
- [Caching](https://swe.quest/tags/caching.md) (Backend & APIs)
- [CDN & edge](https://swe.quest/tags/cdn-edge.md) (Infrastructure)
- [Deployment](https://swe.quest/tags/deployment.md) (Reliability & operations)
- [Storage systems](https://swe.quest/tags/storage-systems.md) (Infrastructure)

## Prerequisites

- Remix basics
- HTTP caching headers ([easy posts on Caching](https://swe.quest/tags/caching.md?difficulty=easy))
- S3 object storage ([easy posts on Storage systems](https://swe.quest/tags/storage-systems.md?difficulty=easy))

## Keywords

Railway, Remix, Cloudflare, MinIO, PostgreSQL, AWS S3 SDK

## Related posts

- [Building a SaaS application on Railway](https://swe.quest/articles/building-a-saas-application-on-railway-c33704a725fc6e9e.md): Railway · 2024-12-13 · Medium · 12 min read · React, PostgreSQL, Deployment, TypeScript, Identity & auth
  A step-by-step tutorial for building a job board SaaS MVP with Remix, PostgreSQL via Drizzle ORM, Clerk authentication and shadcn/ui, then deploying it to Railway.
- [Railway vs Cloudflare: How Their Architectures Differ and When to Use Each](https://swe.quest/articles/railway-vs-cloudflare-how-their-architectures-differ-and-when-to-use-each-da6a8e4c1e4636fe.md): Railway · 2025-11-28 · Medium · 15 min read · Serverless, CDN & edge, Cloud platforms, System design, Containers
  Railway and Cloudflare's Developer Platform feel similar on the surface but rest on opposite compute models.
- [How to Deploy and Scale Docker Containers on Railway in 2026](https://swe.quest/articles/how-to-deploy-and-scale-docker-containers-on-railway-in-2026-de93e0655c267efc.md): Railway · 2026-09-30 · Medium · 18 min read · Containers, Deployment, Cloud platforms, Scaling
  Docker containers on Railway can be deployed either by having Railway build from a Dockerfile (via BuildKit with cache mounts, configurable with RAILWAY\_DOCKERFILE\_PATH) or by pulling a pre-built image from a registry such as Docker Hub, GHCR or ECR Public.
- [So You Think You Can Scale?](https://swe.quest/articles/so-you-think-you-can-scale-8f8ef734834859da.md): Railway · 2023-09-27 · Medium · 7 min read · Load balancing, Scaling, Scheduling, DNS, Cloud platforms
  Railway services can now be horizontally scaled with a single replica-count setting, with automatic load balancing over public and private networks, failover between replicas, and replicas spread across multiple machines.
- [The Best Multi-Region Hosting Platforms in 2026](https://swe.quest/articles/the-best-multi-region-hosting-platforms-in-2026-fbed8cd7b315a007.md): Railway · 2026-05-25 · Easy · 13 min read · Cloud platforms, Distributed databases, Replication, System design
  "Multi-region" covers three distinct problems: CDN static asset distribution (level 1), stateless compute in multiple regions with a single-region database (level 2), and multi-region writes for stateful data (level 3).

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
