---
title: "Granular Routing"
description: "Granular routing on Fly.io. Pick the region, Machine or app that handles each request by setting the fly-replay header, and we replay the request there."
---

# *Granular Routing* on Fly.io

Does your load balancer point traffic at a server and hope for the best? Most do. Instead Fly.io lets you control exactly where each request goes. Which region, which Machine, and even which app. Route writes to your primary database, reads to replicas, or bounce requests between apps like some kind of software orchestral conductor.

[Dive into the docs!](https://docs.fly.io/networking/dynamic-request-routing)

![Fly-Replay Header](https://fly.io/phx/ui/images/routing_1-4f5657e86ec90c9a6a10d4259f9d41dc.png?vsn=d)

## The Fly-Replay Header: Your Remote Control

Need to send a request somewhere specific? Simply set the `fly-replay` header in your response! We'll pick up that request and replay it to whatever region, Machine, or app you specify. It's like a forwarding address for HTTP requests, except it actually works.

- Route to specific regions (us, eu, apac)
- Target individual Machine instances
- Forward to other apps in your org

- Handles requests up to 1MB
- Tracks replay metadata automatically
- Supports JSON for complex routing

## You Don't Have To Be A Cloud Guru to Build Multi-Region Apps

Deploy your app globally, but keep your database in one place. When a write request hits Tokyo, replay it to Virginia where your primary database lives. Reads stay local, writes go where they need to. No eventually-consistent hand-waving, no "just use CRDTs bro." Just working software.

**Database writes to primary:** Route POST/PUT/DELETE to your write region automatically

**Reads stay fast:** Serve from read replicas in every region

**Geographic aliases:** Use "us", "eu", "apac" instead of memorizing airport codes

**Fallback routing:** Prefer a region, but use another if it's unavailable

[Deploy your app!](https://fly.io/app/sign-up)

![Multi-Region Routing](https://fly.io/phx/ui/images/routing_2-b4f4d35d937e0a8c120214cd056e7ea5.png?vsn=d)

## Cross-App Routing: The Platform Builder's Secret Weapon

Want to build a routing layer? A function-as-a-service platform? A custom API gateway? Route requests between apps in your organization like they're all part of one big application. Build platforms on platforms. It's turtles all the way down.

Route between apps in your organization

Build custom routing layers and API gateways

Create FaaS architectures on your own terms

Implement sticky sessions across machines

Private network routing within your org

## Read the Docs

- [Dynamic Request Routing](https://docs.fly.io/networking/dynamic-request-routing): The complete guide to routing requests with Fly-Replay

- [fly-replay Header Reference](https://docs.fly.io/networking/dynamic-request-routing): Technical documentation for the Fly-Replay header

- [Multi-Region with Fly-Replay](https://docs.fly.io/blueprints/multi-region-fly-replay): Build globally distributed apps with regional routing

- [Machine-Specific Routing](https://docs.fly.io/blueprints/supercronic): Route requests to specific Machine instances

## Route Requests Like You Mean It

![Granular Routing Control](https://fly.io/phx/ui/images/routing_3-74557f43449d7223b50c93eed08cac31.png?vsn=d)

Traditional load balancers make decisions for you. Fly.io gives you the controls and gets out of your way. The only limit is your imagination (and the 1MB request size limit).

[Get Started](https://fly.io/app/sign-up)
