Which workloads cannot run on an isolate-based edge runtime, and how do you check a function fits one before porting it?
answer
- the engine runs only its own code
- no fork, no disk, narrow sockets
- CPU time, not wall-clock
- build and test in the local emulator
basics
~20 sAn isolate-based edge runtime cannot run native binaries, spawn processes, use a general writable disk, open arbitrary raw sockets or do long CPU-bound work. Check by auditing dependencies, building for the target and measuring CPU time per request.
solid answer
~50 sAn isolate runtime executes only what its engine runs: code in the runtime's own language or compiled to WebAssembly, inside one shared process. So it rules out **native binaries and shared libraries**, **spawning processes**, a **general writable filesystem**, **raw sockets** beyond whatever narrow outbound API the runtime exposes, and **long CPU-bound work**, because each request has a CPU-time cap. Before porting, I audit the dependency tree, transitive packages included, for native add-ons, process spawning, filesystem and socket calls; build with the platform's bundler, which fails on unsupported modules; run the tests in the runtime's local emulator; and measure CPU time per request rather than wall-clock time. A database reached over its own wire protocol usually needs an HTTP data API or a connection proxy. Whatever does not fit stays in a regional function or container behind the edge function.
go deeper
Recall the list: no native binaries, no spawning processes, no general disk, narrow sockets, and a per-request CPU-time cap.
Explain why each restriction exists: many tenants share one process, so anything that could reach the process or host is removed or mediated.
Show a porting check you would actually run: transitive dependency audit, target build, emulator tests, CPU time per request and every outbound call traced.
Frame the split as a design rule: what belongs at the edge, what stays regional, and what recompiling to WebAssembly costs the team to maintain.
## Why an isolate runtime is narrow by design An **isolate-based edge runtime** packs many tenants' functions into one operating-system process, each in its own **V8 isolate**: a separate heap and execution context inside a shared runtime engine. That is what makes it start almost instantly and run in many edge locations at low cost. It is also why its surface is small. The engine can only run code it executes itself (scripts in its own language, or **WebAssembly** modules), and every capability that would let one tenant reach the shared process or host, such as forking, touching the disk or opening arbitrary sockets, is withheld or replaced by a narrow, mediated API. A microVM-based or container-instance platform has no such restriction: code there sees a whole machine or a whole process. The question an operator asks before moving a function to the edge is therefore not "is it fast?" but "does it use anything the isolate does not provide?" ## What does not run, and what to use instead | Requirement | Why it fails in an isolate | Usual alternative | |---|---|---| | Native binaries or shared libraries (image codecs, PDF renderers, compiled crypto) | The engine cannot load host machine code | Recompile to WebAssembly, or keep that step in a regional function | | Spawning processes or helper executables | One process is shared by many tenants; there is no fork | Rewrite as in-runtime code, or call a service that runs the tool | | A general writable local filesystem | There is no per-tenant disk, at most a small in-memory or virtual one | A key-value store, object storage or a cache service | | Raw TCP or UDP sockets | Outbound traffic goes through the runtime's HTTP client and, on some runtimes, a restricted socket API | An HTTP data API or a connection proxy for the database | | Long CPU-bound work | Each request has a **CPU-time cap**, separate from any wall-clock limit | A regional function or container for the heavy step | | Large in-memory working sets | Each isolate's memory cap is commonly far smaller than a VM-based sandbox's | Stream the data instead of loading it whole | | Server-runtime standard library modules | Only a partial compatibility layer may exist | Runtime-native APIs, or a library written for the web platform | Two of these catch teams most often: - **Transitive dependencies.** The function's own code may be clean while a logging, database or image library three levels down loads a native add-on or opens a socket. - **CPU time versus waiting time.** Waiting on a network call usually costs little or no CPU time, so a request that is slow because of I/O can be fine, while a request that is fast but computes hard (compression, large JSON transforms, cryptography in pure script) may hit the cap. ## How to check a function before porting it 1. **Audit the dependency tree**, transitive packages included, for native add-ons, process spawning, filesystem access and socket libraries. A lockfile scan is faster than reading code. 2. **Build with the target's bundler.** Unsupported modules usually fail at build time, which is the cheapest place to find them. 3. **Run the test suite in the runtime's local emulator**, not in a general server runtime, so missing APIs fail as they would in production. 4. **Measure CPU time per request** under a realistic payload, including the largest one you accept, and compare it with the platform's CPU-time cap. 5. **Trace every outbound call.** Each one must be reachable over HTTP or the runtime's socket API, and each one pays the distance from the edge location to the service; a single-region database turns every edge request into a long round trip, which is a placement question worth settling before the port. 6. **Check the bundle size** against the platform's deploy-size limit, since isolates load the whole script on start. ## What fits well, and how to split what does not Workloads that fit are short, I/O-light and request-scoped: redirects and rewrites, header and token checks, A/B routing, small personalisation from a key-value store, response transforms. A function that mostly fits can be **split**: the edge function does the request-scoped part and calls a regional function or container for the native-code or CPU-heavy step. That split is usually cheaper than forcing the heavy step into WebAssembly, unless the same step must run at the edge for latency reasons.
- Why can a request that takes a long time still fit an isolate runtime's CPU-time cap?Because the cap counts CPU time, not wall-clock time. A request that spends most of its life waiting for a network response uses little CPU while it waits, so it can be slow and still well under the cap. A request that computes hard, such as compressing or transforming a large payload, can exceed the cap while finishing quickly.
- When is recompiling a native library to WebAssembly worth it rather than calling a regional service?When the step must run at the edge, for example because its latency sits on every request, and the library compiles cleanly without threads, a filesystem or system calls. Otherwise calling a regional function or container is simpler: no toolchain work, no bundle growth, and the heavy step keeps a full machine's memory and CPU.
- How does a function on an isolate runtime usually reach a relational database?Through an HTTP-based data API or a connection proxy that holds the database's wire-protocol connections on the function's behalf, or through a restricted outbound socket API where the runtime offers one. The proxy also pools connections, which matters because many edge locations would otherwise open their own.
- An isolate runtime is just a faster container, so anything that runs in a container runs there.
- Only my own code matters; dependencies are bundled and therefore always supported.
- A request that takes a long time will always exceed the isolate's CPU-time cap.
- Native libraries work at the edge as long as they are shipped inside the script bundle.
- Tests passing in a general server runtime prove the function runs in the isolate.