Architecture
How Sypnia Run is built: its parts, where Rust and TypeScript run, and how they connect.
Run has two planes. The control plane decides: it keeps apps, deploys and environments, runs builds and tells AWS what to create. The data plane serves: CloudFront, S3, Lambda and Fargate answer your visitors without passing through the control plane, so a control-plane outage stops new deploys but never takes your app offline.
- The CLI, CI or an agent calls the Run API.
- The API records the deploy and queues a build.
- The builder runs your build in an isolated CodeBuild machine and writes artifacts.
- The deployer turns artifacts into AWS resources and switches the environment at the edge.
- Visitors reach CloudFront, which serves S3 files or calls the deploy’s Lambda or Fargate service directly.
Read this diagram as text
The CLI, CI or an agent call the Run API, which stores apps, deploys and environments in Postgres and queues work in SQS. The builder runs builds in AWS CodeBuild and writes artifacts to S3. The deployer creates Lambda versions, Fargate services, EventBridge schedules and SQS queues, and updates the edge router’s key-value store. Visitors reach CloudFront, whose edge function reads that store and sends each request to the right deploy’s files in S3 or to its Lambda or Fargate service.
| Part | Language | Runs on | Open source |
|---|---|---|---|
| Run API | Rust (axum) | AWS Lambda | yes |
| Builder | Rust orchestrator + build images | AWS CodeBuild | yes |
| Deployer | Rust | AWS Lambda, driven by SQS | yes |
| Framework adapters | TypeScript (@sypnia/run) | inside the build | yes |
| Edge router | JavaScript (CloudFront Functions) + CloudFront KeyValueStore | CloudFront | yes |
| Console | TypeScript (React) | Sypnia Cloud | no |
Functions or containers
Run has two ways to run the server part of an app, and they are for different things.
- Functions, by default. Every app runs on functions (AWS Lambda) unless it asks otherwise. A function runs only while it answers a request: you pay per request and for the time it takes, and when nobody visits, it scales to zero and costs nothing.
- A container, only when the app asks for it. An always-on container (AWS Fargate) is for what a function cannot do: work that takes longer than 15 minutes, WebSockets or other connections that stay open, workers that must always be running, or a container image of your own that needs a long-lived process.
A container is billed for every hour it is on, whether or not anyone visits, so it is a choice each app makes, never the default. An app opts in with kind = "container" and runtime = "fargate" in its table of sypnia.toml (The configuration file); without runtime = "fargate", even a container image runs as a function that scales to zero (Containers).
The containers of a cell share one load balancer, the one that takes their traffic from CloudFront. No app pays for a load balancer of its own.
What happens, call by call, for a deploy, a release and a visitor's request.
The control plane's tables: projects, apps, environments, deploys, builds, releases, variables and domains.
Reference implementation on AWS
Every AWS service Run uses, what for, and how it is set up.
How builds and apps of different customers are kept apart in Sypnia Cloud.
What happens when each part fails, and how Run grows with traffic.
How the open-source repository is organized.