Search forkrail

Search documentation, comparisons, and CLI commands.

How forkrail works

A router in your AWS account takes every request, answers what it can by itself, and runs your code on AWS Lambda workers that keep a connection open to it.

The path of a request

A request, from visitor to function
visitor ──▶ *.example.com (DNS) ──▶ forkrail router (EC2, your account)
│
┌──────────────┬──────────────────┼──────────────────┬───────────────┐
▼ ▼ ▼ ▼ ▼
firewall redirects and static files cached pages your function
and rules routing rules (S3, memory) (ISR, s-maxage) (AWS Lambda)
  1. 1
    DNS sends the visitor to the router

    *.<your domain> points at the router’s fixed address. Custom domains point there too, with a CNAME or A record.

  2. 2
    The router decides

    It terminates TLS, finds the deployment by hostname, runs the firewall and deployment protection, then the project’s redirects and routing rules.

  3. 3
    It answers what it can

    Static files come from S3 (the busiest from memory) and cached pages from its own cache. Neither wakes a function.

  4. 4
    Everything else runs your code

    The request goes to a worker of the deployment’s Lambda function. The response streams back through the router to the visitor.

Workers that dial back

A Lambda worker opens a connection back to the router when it starts and keeps it open while it runs. With concurrent compute on (the default), the router sends one worker up to 10 requests at once over that connection, so an API that spends most of its time waiting on a database pays for one environment instead of ten.

  • Idle costs nothing. Every deployment is a published Lambda version. Previews and old releases cost nothing until someone opens them.
  • Warm before it’s live. Before production moves to a new deployment, forkrail starts a few of its environments so the first visitors don’t wait for a cold start.
  • Keep warm, if you want it. A project can ask the routers to keep environments ready around the clock. See Function settings.

The parts in your account

PartRuns onWhat it does
RouterEC2 (Graviton)TLS, routing, firewall, static files, response cache, rate limits, metering for spend limits.
WorkersAWS Lambda (arm64)Your functions. One Lambda function per project, one version per deployment.
BuilderAWS Lambda (container image)Builds every deploy from source, on the same Linux your functions run on.
ControlAWS LambdaPublishes deployments, promotes, rolls back, and holds the rights to decrypt env vars.
StorageS3 and DynamoDBPackages, static files, the routing table, project settings and deployment records.
LogsClickHouse on EC2Every request, app log line, outgoing call and Web Analytics event.
DashboardA forkrail projectThe web app your team signs in to, deployed like any other project.

Regions and failover

An install has one router, in the region you pick when you install. Each project then picks the regions its functions run in, from 20 AWS regions, with no router needed there: the router invokes the function in that region, so a function can sit next to its database wherever that is. See Function regions.

The router can also run in several regions at once, behind two anycast addresses (AWS Global Accelerator) that send each visitor to the nearest healthy router and move them to another region in under a minute if one stops answering. Setting up a second router region is a manual step today; the installer sets up one. Router updates start the new router beside the old one, so restarts have no gap.

Who can read what

  • Environment variable values are encrypted with a KMS key that only the control function and your administrators can use. The routers, the dashboard and your apps can’t read other projects’ values.
  • The builder can’t reach the install’s state, secrets or other projects. It reads its source and writes its output through URLs signed for that one build.
  • Project settings and team data live in DynamoDB tables whose resource policies refuse everyone but the services that need them, with point-in-time recovery for 35 days.
  • Every change is recorded with who made it.
New to forkrail? Install it in your AWS account and deploy your first app in about 20 minutes.
Quickstart