SESSION details

Name: Doing Server Side WebAssembly - The Hard Way

Date/time: Thursday, October 5, 2023, 2:45 PM - 3:30 PM Pacific Time


We initially believed that the linear byte-streams flowing into and out of the WebAssembly sandbox would seamlessly align with the synchronous request/response pattern of HTTP. Thus, when our NGINX Unit team embarked on implementing a server-side module for WebAssembly, we anticipated a straightforward process. Our plan was to connect our HTTP server implementation to Wasmtime and let the bytes traverse effortlessly. However, what ensued was a journey filled with challenges, primarily due to the necessity of performing direct memory access using low-level languages. The truth became evident: carrying HTTP metadata in and out of the Wasm runtime proved to be a formidable task. The allure of enhanced productivity and memory safety offered by high-level languages seemed to evade us. In this presentation, we will delve into our eventual triumph in bridging the gaps and share the invaluable insights we gained regarding server-side WebAssembly along the way. Moreover, we will explore the WASI HTTP project, which aims to address the same difficulties, thereby combining the scalability of HTTP with the performance and portability of WebAssembly. Join us to discover how we overcame these obstacles and the exciting prospects that lie ahead.