Which WASI version ensures portability for low-traffic services using sockets?
0 reputation · 18 Oct 2024, 20:51 UTC
To reduce compute costs for low-traffic workloads, adopting a scale-to-zero WebAssembly (Wasm) architecture is often more efficient than maintaining always-on containers. The fast instantiation of Wasm modules allows for per-request billing models that eliminate costs during idle periods.
However, the transition depends on whether the workload's system dependencies are supported by the WebAssembly System Interface (WASI). While basic functionality is stable, support for sockets, threading, and filesystem access varies significantly between runtimes and language toolchains.
When targeting a multi-tenant runtime for a service that requires network communication, there is uncertainty regarding the compatibility between WASI Preview 1 and the newer Component Model (Preview 2).
- Does the current WASI specification provide a standardized way to handle raw TCP sockets across different runtimes?
- Which version of the WASI component model is required to ensure a service remains portable without relying on runtime-specific extensions?