Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Danilo Chiarlone

Rating No ratings yet

“WebAssembly on the server is the future of computing.” –Solomon Hykes, founder of Docker Server-Side WebAssembly shows you how to harness the power of Wasm on the application back-end. By following the numerous practical examples and crystal-clear explanations, you’ll soon be seeing the benefits of reduced cold start times, improved security and performance, and the freedom of polyglot programming. Inside this book you’ll learn how to: • Develop and deploy server-side Wasm applications • Create and manage Wasm containers with OCI • Compile Wasm components from multiple languages • Scale Wasm applications using Kubernetes • Deploy Wasm applications across different environments • Integrate with databases and machine learning Server-Side WebAssembly lays out everything you need to take WebAssembly beyond its traditional browser domain. You’ll put on the hats of a systems architect, a backend developer, and even a DevOps engineer to get a full picture of WebAssembly development from both an architecture and development perspective. about the technology WebAssembly (Wasm) revolutionized frontend development by enabling secure, high-performance code in the browser. Now it’s doing the same for backend infrastructure as a platform for lightweight, portable applications that run anywhere. In this book, you’ll learn how to build production-grade server-side apps using Wasm. about the book Server-Side WebAssembly teaches you to use WebAssembly components and the WebAssembly System Interface (WASI) to build web back ends. You’ll start with Wasm fundamentals and then quickly start building a realistic content management system complete with data storage, HTTP servers, and AI-generated content. As you go, you’ll see how Wasm integrates code from multiple languages and connects naturally with databases, AI/ML systems, and deployment platforms like Kubernetes. about the reader For intermediate web developers. Code samples in Rust, JavaScript and Python.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on guide to running WebAssembly outside the browser: build portable, secure, polyglot back ends with Wasm components, WASI, and Kubernetes. Best for intermediate web developers comfortable with Rust, JavaScript, or Python who want a practical path into server-side Wasm. 【Book Arc】 - **Opening (~0%–10%)**: Frames why Wasm matters on the server—fast, safe, hardware- and language-independent—and situates it against IaaS, PaaS, and serverless. Introduces WASI and the guest-host model, then sketches the running SmartCMS project. - **Early (~10%–30%)**: Builds the first Wasm module in Rust and runs it inside a custom host (HelloWorldHost) atop Wasmtime, then explains WIT as the bridge from simple numeric types to richer interfaces. Also gives an honest performance and ecosystem reality check. - **Middle (~30%–55%)**: Moves from modules to the Component Model: cross-language portability, shared-nothing and only-what-you-need security, and componentized examples in JavaScript with a Python host, plus WIT-driven host functionality in Rust. - **Late (~55%–80%)**: Connects Wasm to the underlying system via WASI—CLI apps, libraries, HTTP proxies—and covers converting modules to components, managing capabilities, and composing components together. - **Ending (~80%–100%)**: Extends the SmartCMS story toward data storage, HTTP servers, AI-generated content, OCI-based Wasm containers, Kubernetes scaling, and multi-environment deployment. (Excerpts do not cover the final chapters in detail.) 【Key Takeaways】 - **Wasm’s server value is portability plus isolation, not raw speed** (Early): near-native execution, hardware independence, and language independence are the design goals that make it attractive beyond the browser. - **The guest-host split is the core mental model** (Early): a Wasm runtime (e.g., Wasmtime) plays the role the browser plays on the web, providing system access to guest applications through linear memory and explicit calls. - **WIT and the Component Model are the real leap** (Middle): core Wasm only knows numbers and linear memory; WIT adds language-agnostic interfaces, and components behave more like independently deployable microservices. - **Security comes from least privilege by construction** (Middle): components can only reach their declared imports, which matters because most vulnerable code in production lives in hidden dependencies rather than app logic. - **Performance claims need nuance** (Early): Wasm shines in cold-start and serverless-style scenarios, but can struggle in traditional PaaS workloads without multithreading; horizontal scaling via Kubernetes is the suggested mitigation. - **Ecosystem maturity is the main friction** (Early): not every package compiles to Wasm, and debugging tooling is uneven across languages—expect to make trade-offs or wait for proposals to land. - **WASI turns Wasm into a systems citizen** (Late): it enables CLI tools, libraries, and HTTP proxies, and underpins capability management and component composition. - **The book is project-driven** (Opening–Ending): a single SmartCMS application grows across chapters, integrating storage, HTTP, AI-generated content, OCI containers, and Kubernetes deployment. 【Reading Tips】 - Deep-read the guest-host and WIT/Component Model chapters; they are the conceptual hinge for everything later. - Skim the Rust “Hello, World” build steps if you already know Cargo and Wasm targets—focus instead on the memory-passing mechanics. - Treat the performance and ecosystem caveats as first-class content, not filler; they set realistic expectations for production use. - Follow the SmartCMS project in order and keep the companion GitHub/liveBook code open; the value is in running and modifying the examples. - If you come from a JavaScript or Python background, don’t skip the Rust host sections—they clarify how hosts and guests actually communicate. 【Coverage Limits】 This guide is based on stratified excerpts covering roughly the first half of the book; later chapters on OCI containers, Kubernetes scaling, databases, and AI/ML integration are described from the blurb and table of contents rather than detailed excerpt content.
Excerpt 1
e with data storage, HTTP servers, and AI-generated content. As you go, you’ll see how Wasm integrates code from multiple languages and connects naturally wi...
View in text
Excerpt 2
outside the web. In a browser, Wasm relies on the browser itself as its environment; outside the browser, a Wasm runtime—often referred to as a host—serves t...
View in text
Excerpt 3
making the ecosystem more capable and versatile over time. While these limitations are real, it’s important to understand that Wasm offers capa- bilities tha...
View in text
Excerpt 4
all the manual layout work. But WIT isn’t the whole story. It’s part of something bigger: the Wasm Component Model. The model uses 33 Benefits of Wasm compon...
View in text
Excerpt 5
e store has a value for guest-hello, everything works fine. But if it didn’t, and undefined were returned, the app would crash. To finish off, let’s run this...
View in text
Excerpt 6
y_lib" Change the package field under the [package.metadata.component] section to package = "composability:lib" Finally, our Cargo.toml file should look like...
View in text
Excerpt 7
ding byte representation using the to_ne_bytes method, and these bytes are then stored in the data_u8 vector: let mut data_u8 = Vec::with_capacity(data_f32.l...
View in text
Excerpt 8
ntation, allowing Wasmtime to support ONNX-based ML models. Now let’s move our attention to the smartcms_ml_guest project. We’ll be adding some dependencies...
View in text
Tags
AI categories
GoBackendCloud Native
ISBN: 1633436209
Publish Year: 2026
Language: English
Pages: 274
File Format: PDF
File Size: 4.5 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…