Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Railway 10 min read How-to mediumAdept

Scaling a SaaS application on Railway

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.

Related posts

  • Building a SaaS application on Railway

    Railway mediumAdept

    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. It covers the data model, routes for job seekers and hiring managers, resume uploads stored on disk, and a resource route for downloads. Deployment steps include a custom start command that runs migrations, attaching a persistent volume for resumes, provisioning Postgres with reference variables, and fronting the app with a Cloudflare custom domain for DDoS protection and caching.

  • Railway vs Cloudflare: How Their Architectures Differ and When to Use Each

    Railway mediumAdept

    Railway and Cloudflare's Developer Platform feel similar on the surface but rest on opposite compute models. Railway runs long-lived regional containers with stable in-memory state, persistent volumes and up to 32 vCPU/32 GB per instance. Cloudflare Workers are edge-first, single-threaded V8 isolates capped at 128 MB memory and CPU-time limits, with no filesystem or reliable global state, so state needs Durable Objects, KV, D1, R2 or external databases via Hyperdrive. The recommended pattern is to combine them, with Cloudflare as the global front door (CDN, caching, routing, security) and Railway hosting stateful backends, databases and long-running work.

  • How to Deploy and Scale Docker Containers on Railway in 2026

    Railway mediumAdept

    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. Services must bind to 0.0.0.0 (or :: for the IPv6 private network) and honor the PORT variable. Layer ordering, .dockerignore and multi-stage builds keep rebuilds cheap. Scaling is vertical via resource limits or horizontal via replicas across regions, but services with Volumes cannot use replicas, so state belongs in databases or object storage. Billing is usage-based ($10/GB RAM, $20/vCPU per month), and a small always-on API works out to roughly $6.50/month.

  • So You Think You Can Scale?

    Railway mediumAdept

    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. Under the hood, a Temporal-based orchestrator extends the data model to multiple deployment instances per service and fans out sub-workflows to place containers on hosts, using healthchecks to confirm readiness. Each replica gets a unique IPv6 address pushed through an event-based gRPC control plane, so private DNS returns multiple AAAA records for random load balancing, while public ingress uses round-robin via Envoy proxies updated through CDS. Custom autoscalers can be built today on the GraphQL metrics and replica APIs; multi-region failover, built-in autoscaling and scale-to-zero are planned.

  • The Best Multi-Region Hosting Platforms in 2026

    Railway easyNovice

    "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). Most teams need level 2 but believe they need level 3, which costs roughly an order of magnitude more in money and engineering complexity and requires application changes like idempotency keys and conflict semantics. Ten platforms are ranked against this framework, from Railway, Fly.io and Cloudflare for level 2 to AWS DynamoDB Global Tables/Aurora Global, Google Spanner, Azure Cosmos DB and CockroachDB for level 3, each with pricing and trade-offs.

The quest for software engineering knowledge.

Look:
Layout: