Persistent Storage and 97% Faster Cold Starts for Edge Functions
Supabase Edge Functions can now mount any S3-compatible bucket, including Supabase Storage, as a POSIX-like directory under /s3, configured through four S3FS_* environment secrets. One example reads a SQLite backup from S3 into memory and pushes aggregates to Postgres. Cold starts improved after workers still doing initial script evaluation were moved off the shared cooperatively scheduled Tokio thread pool onto a dedicated blocking pool, so heavy startup work no longer stalls neighbouring functions. In the benchmark, average boot time fell from 870 ms to 42 ms and P99 from 15 s to 460 ms. Synchronous file APIs are now allowed during initial script evaluation only, not inside request handlers or timers.
Related posts
- Edge Functions are now available in Supabase
Supabase easyNoviceSupabase Edge Functions run TypeScript globally on the Deno runtime via Deno Deploy across 30+ data centers. Supabase chose functions-as-a-service over containers for simpler developer experience and faster start-ups, and global deployment over a single region, with Postgres-colocated Database Functions covering DB-heavy work. Requests pass through a Relay gateway that verifies JWTs, rate-limits and logs, then maps function metadata to a Deno Deploy deployment ID. Cold starts fetch code and secrets from Supabase, and logs flow through Logflare into the dashboard. Functions are POST-only, and static hosting is ruled out after phishing abuse on Supabase Storage got the domain denylisted.
- Supabase Edge Functions: Introducing Background Tasks, Ephemeral Storage, and WebSockets
Supabase mediumAdeptSupabase Edge Functions gain background tasks, ephemeral /tmp file storage, and inbound/outbound WebSocket support. `EdgeRuntime.waitUntil` keeps a worker alive until a promise resolves, for up to 150 seconds on free plans and 400 seconds on paid plans, and a `beforeunload` event signals impending shutdown. A worked example shows that streaming zip extraction hits memory limits above roughly 100MB, and avoids this by writing the archive to /tmp and extracting it in a background task. A second example builds an authenticated relay to the OpenAI Realtime API, passing the Supabase JWT via query params because browser WebSocket clients can't send custom headers.
- Supabase Edge Runtime: Self-hosted Deno Functions
Supabase mediumAdeptSupabase Edge Runtime is an MIT-licensed, Rust-based web server built on deno_core that self-hosts Deno Edge Functions (TypeScript, JavaScript, WASM) without code changes. A hyper HTTP server forwards requests to a Main Worker V8 isolate, which can create sandboxed User Worker isolates with restricted APIs and configurable memory (default 150 MB) and wall-clock (default 60s) limits. It also powers `supabase functions serve` for serving all functions locally with hot reload and Deno Deploy API parity, and a Fly.io walkthrough shows how to deploy it. Planned uses include replacing Kong as an API gateway, scheduled functions, and custom platform globals.
- Edge Functions are now 2x smaller and boot 3x faster
Supabase mediumAdeptSupabase Edge Functions that use npm modules now bundle roughly half as large and boot several times faster. Example boot times drop from 275ms to 25ms for supabase-js and from 459ms to 57ms for the OpenAI SDK. The gains come from three changes to eszip handling in Edge Runtime: per-entry SHA-256 integrity checks now run lazily when a module is actually loaded, npm package bytes are serialized with rkyv instead of JSON number arrays that doubled their size, and source checksums switched from SHA-256 to the non-cryptographic xxHash-3. Redeploying with a recent Supabase CLI picks up the improvements.
- Executing Dynamic JavaScript Code on Supabase with Edge Functions
Supabase mediumAdeptSupabase Edge Functions can execute arbitrary JavaScript sent in the request body by wrapping it in an async `new Function()` that receives a preconfigured service-role Supabase client, so business logic can change without redeploying. SQL helpers built on the pgsql-http extension let Postgres call the function directly. `edge.http_request` wraps the HTTP call, `edge.edge_wrapper` adds retries with backoff delays and rotation across allowed regions via an `x-region` header, `edge.get_secret` reads the service-role key from Vault, and `edge.exec` ties them together. Access is limited to callers presenting the service_role key, since the function would otherwise be an open remote code execution endpoint.