Skip to content

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

Railway 15 min read Opinion mediumAdept

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

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.

Related posts

  • Serverless functions vs containers: CI/CD, database connections, cron jobs, and long-running tasks

    Railway mediumAdept

    Serverless functions and container platforms differ in execution model, which changes how you handle deploys, database access, cron jobs, rollbacks and long-running work. Serverless imposes execution limits of 30 seconds to 15 minutes, memory caps, cold starts and no persistent connections, so long jobs need checkpointing, chained invocations or streaming. Railway's containers avoid those limits and add automatic private networking, reference variables for credentials, and cron with skip-if-running semantics that requires jobs to close connections and exit. Rollbacks are similar on both, but schema migrations should stay backward compatible because rolling back code does not reverse them.

  • Going multi-cloud with an in-housed status page

    Railway mediumAdept

    Railway built its own status page, hosted on Railway itself, behind a Cloudflare Worker so the public page survives an origin outage. The Worker acts as a transparent proxy with its own stale-while-revalidate layer: it stamps cached responses with an x-cached-at header, refreshes in the background after 5 seconds, and serves the last good render for up to a week if origin disappears. During real incidents a Cloudflare KV flag switches the Worker to serve a self-contained incident page that on-call can edit live, while JSON pollers still get JSON. The page also adds a "Notice" state that acknowledges an issue before it is declared an incident, and the same distributed-routing approach now backs Railway's multi-region network plane.

  • Scaling a SaaS application on Railway

    Railway mediumAdept

    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.

  • 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.

  • Hello, World: We’re Railway

    Railway mediumAdept

    Railway launches US-East, EU-West and Southeast Asia regions alongside its original US-West GCP zone, with one-click region moves that need no URL or DNS changes. Getting there required several building blocks: private networking built on a WireGuard mesh with eBPF NAT and per-project IPv6 /64 address spaces, a global edge that splits Envoy edge proxies from regional routing proxies behind GeoDNS, and lazy-loading L4 TCP proxies that subscribe to a memdb-backed control plane for cache invalidation. Volumes use ZFS send/receive snapshots, orchestrated with Temporal, to move databases across regions with minimal downtime. The team also restructured a copy-pasted, module-less Terraform and Ansible stack so new regions are cheap to add.

The quest for software engineering knowledge.

Look:
Layout: