Appwrite Edge
See on GitHubAppwrite Edge runs customer code on a fleet of machines in six regions, with thousands of runtimes live at any moment. The router decides where each request goes, and the orchestrator runs the code.
The router
Every Sites domain needed something in front of it that knew which deployment to serve. I built that router for the Sites launch in 2025. It now handles millions of requests a day, and over half of them execute customer code.
A request comes in for a domain. The router looks up the deployment and its region, then finds a runtime to send it to. Preview deployments, redirect rules, custom error pages and cache invalidation all live here.
- executionp50 of millions a day 165ms
- wait for runtimewarm · ~98% ~3ms
- executecustomer code 158ms
- collect logs ~4ms
cold start on the other ~2%: create runtime, a few seconds
That's a median execution. The router spends a couple of milliseconds finding a warm runtime, and nearly all the rest is the customer's code. About 98 in every 100 executions find a runtime already running. The rest pay a cold start of a few seconds.
When a customer ships a new deployment, the region publishes an event and the edge drops its cached rule and runtime. Each project's runtimes scale on their own, and spare machines hold warm capacity for spikes.
open-runtimes/orchestrator
The old executor drove Docker on a single host. open-runtimes/orchestrator is the next generation orchestrator for Appwrite Functions and builds, and it already runs Appwrite Cloud's builds in production. That's over a thousand builds a day, each copied out to every region. I wrote the design docs and nearly all of the code in 2026.
One API runs four kinds of workload. Deployments serve traffic. Pools keep warm pods ready. Sandboxes run untrusted code alone. Jobs run builds. The same API runs on Docker Compose locally and on Kubernetes in production.
Build artifacts get the most interesting treatment. The orchestrator mounts them as filesystem images instead of extracting them. Mounting takes tens of milliseconds, about a tenth of the time it takes to download the same artifact. A mount agent on each machine does the mount, which means no pod running customer code needs a privileged container sitting next to it.
- download · ~10× slower Object storage
build.erofs - mount · tens of ms Mount agent
loop + mount on the machine - unprivileged Runtime pod
/usr/code (read-only)