Skip to content

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

Linear 9 min read Case study mediumAdept

How we built multi-region support for Linear

Linear added an EU region by replicating its entire production deployment per region rather than sharding the database, keeping each region isolated and letting engineers keep writing against a single Postgres instance. The work came in three phases: Terraforming the previously hand-managed GCP infrastructure into region-parameterized modules, extracting a global authentication service that owns users, workspaces and their region mapping, and putting a Cloudflare Workers proxy in front of all traffic to route requests to the right region with a signed JWT. Shared records are created and deleted in the auth service first so uniqueness holds globally, updates propagate asynchronously through the sync engine, cross-service calls flow one way (auth to regions via Pub/Sub), and background jobs reconcile the two sides. Fallbacks and feature flags kept cut-overs late and mostly invisible to users.

Related posts

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

  • Sharding Infrastructure: The Regional Goval Project

    Replit mediumAdept

    Replit re-sharded the infrastructure that runs Repls (Goval) from a few unbalanced, multi-region clusters partitioned by user membership into uniformly sized, single-region clusters with Repls distributed by consistent hashing, shrinking failure domains and removing cross-region traffic. The clusters are now defined with CDK for Terraform in TypeScript as reusable modules, replacing a monolithic Terraform state, codegen tooling and Ansible-managed config, so clusters (including single-tenant ones in separate GCP projects) can be provisioned on demand. Migration happened with no downtime: new Repls were created in new clusters, existing Repls were lazily transferred on connection behind feature flags with rollback capability, and old clusters were deprovisioned while untransferred Repls stayed in storage.

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

  • The Future of Databases is Services

    Railway easyNovice

    Railway replaced its bespoke per-database Plugins (Postgres, Redis, Mongo, MySQL) with databases deployed as ordinary services, built from general-purpose primitives: ZFS-backed NVMe volumes, Docker image deploys, port-based TCP proxies per region, private networking, cross-service variable references, and a `${{ secret() }}` template function for generated passwords. Because TCP carries no Host header, the proxy routes by assigning a unique port per service. Combined into one-click templates, these primitives let users deploy any database, such as PGVector, Chroma, ClickHouse or Temporal, and Railway plans to add backups and high availability the same way.

The quest for software engineering knowledge.

Look:
Layout: