What is Edge Computing and How Do Isolates, WebAssembly (WASM), and Container Models Compare?
What Edge Computing Means
Edge computing moves code execution from centralized data centers to CDN nodes (Points of Presence) located near users. Instead of routing every request to origin servers hundreds of milliseconds away, edge nodes execute application logic locally. A user in Tokyo hits a Tokyo PoP that runs authentication, personalization, or A/B test assignment without crossing the Pacific. This eliminates 100-200ms of network latency per request.
Isolation Models
Running untrusted code at the edge requires strong isolation. Two primary models exist: containers and isolates. Containers use OS-level virtualization with separate kernel namespaces, providing strong isolation but requiring 50-500ms cold starts. Isolates use V8 engine instances (the JavaScript runtime) with lightweight memory isolation, achieving 0-5ms cold starts. Isolates share the same process but cannot access each others memory spaces, similar to how browser tabs isolate JavaScript execution.
WebAssembly at the Edge
WebAssembly (WASM) is a binary instruction format that runs in a sandboxed virtual machine. Originally designed for browsers, WASM enables running compiled languages like Rust, Go, or C++ at the edge with near-native performance. WASM modules execute in isolated linear memory spaces, preventing access to host system resources unless explicitly granted. Cold starts are 1-10ms, between containers and isolates. The tradeoff: WASM supports more languages but requires compilation, while isolates support only JavaScript/TypeScript but enable instant deployment.
Security Considerations
Edge execution introduces security attack surfaces. Side-channel attacks (exploiting timing or cache behavior to leak information) like Spectre and Meltdown (CPU vulnerabilities that allow reading protected memory through speculative execution) required architectural changes in isolate runtimes. JWTs (JSON Web Tokens, self-contained authentication tokens with cryptographic signatures) can be validated at the edge without origin roundtrips, but key rotation must propagate to all PoPs within minutes. Edge functions should never store secrets in code; use encrypted environment variables or edge-compatible secret managers with sub-second retrieval latency.