Search forkrail

Search documentation, comparisons, and CLI commands.

Function regions

Run a project’s functions next to its database. Pick one region or several, by Vercel’s names or AWS’s, with no router needed in that region.

Pick regions

A new project’s functions run in your install’s home region. Pick others where the function’s database or the APIs it calls are, so each call stays short:

forkrail project my-api --regions iad1 # Vercel's names or AWS's (us-east-1)
forkrail project my-api --regions us-east-1,fra1 # several: each visitor gets the nearest
forkrail project my-api --regions default # no setting: where production runs now

Or in vercel.json, which wins over the project’s setting, as on Vercel: "regions": ["fra1"]. The dashboard has it under Settings → Functions → Regions. It applies from the next deploy or redeploy.

The first time a project picks a region, forkrail sets it up: a code bucket and an encryption key there (about $1 a month). forkrail regions setup eu-central-1 does it ahead of time, and forkrail regions ls lists the regions in use.

Available regions

Vercel codeAWS regionLocation
iad1us-east-1Washington, D.C., USA
cle1us-east-2Cleveland, USA
sfo1us-west-1San Francisco, USA
pdx1us-west-2Portland, USA
yul1ca-central-1Montréal, Canada
gru1sa-east-1São Paulo, Brazil
fra1eu-central-1Frankfurt, Germany
dub1eu-west-1Dublin, Ireland
lhr1eu-west-2London, UK
cdg1eu-west-3Paris, France
arn1eu-north-1Stockholm, Sweden
bom1ap-south-1Mumbai, India
sin1ap-southeast-1Singapore
syd1ap-southeast-2Sydney, Australia
hnd1ap-northeast-1Tokyo, Japan
icn1ap-northeast-2Seoul, South Korea
kix1ap-northeast-3Osaka, Japan
hkg1ap-east-1Hong Kong (opt-in region)
cpt1af-south-1Cape Town, South Africa (opt-in region)
dxb1me-central-1Dubai, UAE (opt-in region)

Opt-in regions must be turned on for your AWS account first (AWS console → Account → AWS Regions).

How requests reach them

Visitors reach the router. The router runs the function in its own region if the project has one there; otherwise in the nearest region the project picked. In a region with no router, the router invokes the function there directly and the worker dials back to it.

Firewall, rate limits, the cache and the access log stay with the router the visitor reached, so a function region changes only where your code runs. Pick one region when the function’s data is in one place (a request’s calls to the database outweigh one hop between regions), and a region near each group of visitors when it isn’t.

Cost of crossing regions

Traffic between the router and a function in another region costs $0.02 per GB instead of $0.01, and stays on AWS’s own network. Vercel bills the same trip as Fast Origin Transfer. Spend limits count it.

New to forkrail? Install it in your AWS account and deploy your first app in about 20 minutes.
Quickstart