As WebAssembly is increasingly used in the cloud, it is now a universal runtime for cloud-native applications. Compared with Linux containers, WebAssembly runtimes achieve higher performance with lower resource consumption.
- No need for Linux containers. WasmEdge could be a secure container without tons of dependencies.
- Node.js compatible. See the status here.
- Use Rust to implement JS APIs. See the tutorial here.
- Networking sockets shows how to create non-blocking (async) HTTP clients, including the
- Node.js compatibility describes Node.js APIs support in WasmEdge QuickJS.
- ES6 modules shows how to incorporate ES6 modules in WasmEdge.
- Node.js and NPM modules shows how to incorporate NPM modules in WasmEdge.
- React SSR shows example React SSR applications, including streaming SSR support.
A note on v8
First of all, QuickJS is a lot smaller than v8. It only takes 1/40 (or 2.5%) of the runtime resources v8 consumes. You can run many more QuickJS functions than v8 functions on a single physical machine.
Second, for most business logic applications, raw performance is not critical. The application may have computationally intensive tasks, such as AI inference on the fly. WasmEdge allows the QuickJS applications to drop to high-performance WebAssembly for these tasks while adding such extensions modules is more challenging with v8.
Third, WasmEdge is itself an OCI-compliant container. It is secure by default, supports resource isolation, and can be managed by container tools to run with Linux containers in a single k8s cluster.
In the end, running v8 in a cloud-native environment often requires a whole stack of software tools consisting of "Linux container + guest OS + node or deno + v8", which makes it much heavier and slower than a simple WasmEdge + QuickJS container runtime.