Introduction
Let me start with a confession:
I have deployed a lot of containers in my career, and for most of that time, I never questioned the model. A container was simply the unit of deployment. It’s only when you put something radically lighter next to it that you realize how much you were paying — in cold-start latency, in image size, and in the sheer amount of operating system and dependencies you drag along just to run a few hundred lines of business logic.
This book is about that lighter thing.
We’re going to build real, production-shaped serverless applications on top of WebAssembly using Spin, the open-source framework that (in my very biased opinion) makes server-side WebAssembly genuinely pleasant to work with.
And we’ll do it in Rust, because Rust and WebAssembly grew up together, and the developer experience shows it.
Who This Book Is For
This book is for you if you’re a software engineer, architect, or tech lead. You know your way around HTTP, package managers, and the terminal.
You may have written Rust before, or you may just be curious about Rust; either is fine. I’ll explain the Spin-specific and WebAssembly-specific parts, and I’ll trust you on the rest.
What you do not need is prior WebAssembly experience. We start from first principles, and we lead with the “Why” before the “How.”
Who This Book Is Not For
This is not an introductory book on Rust.
While you don’t need to be an expert in Rust, we will move quickly. The code examples rely on standard Rust idioms, patterns, and ecosystem crates. We will dive deep into Spin-, Wasm-, and Component Model-specific patterns, but we won’t stop to explain basic Rust syntax, ownership, error handling with Result, or async traits.
If you are completely new to Rust, I recommend spending a weekend (or two) with The Rust Programming Language book first to get comfortable with the syntax. Once you can read basic Rust code, come back right here.
What We Will Build
Rather than a scattering of disconnected “Hello, World” examples, we build one sample application across the whole book and grow it chapter by chapter. I call it the Task-Engine — a small but functional task-management app. By the end, it consists of several independent, yet interconnected, WebAssembly components.
It grows real capabilities along the way:
- Persistence that uses the exact same code across different deployment targets.
- Outbound Networking with precise security controls in place.
- Background Worker to perform work on a schedule.
- WebAssembly Component Composition to encapsulate business logic and build reusable components.
Once we have the core features of Task-Engine implemented, we’ll dive into topics like automation and security hardening. From there, I’ll assist you in Going Live with the application by deploying it to two very different production targets (out to the global edge with Akamai Functions and onto Kubernetes with SpinKube) without rewriting a single line of application code or recompiling the application.
That portability is not a marketing slide; it’s the whole point, and you’ll feel it firsthand.
Finally, we explore how to Make Spin Your Own by authoring custom templates, developing CLI plugins, building custom trigger executors, and contributing to the open-source community.
How to Read This Book
It’s meant to be read front-to-back the first time; later chapters lean on earlier ones because we’re building one app, not twelve. Throughout, you’ll find short asides that look like this:
![]() |
These are the things I’d lean over your shoulder and tell you if we were pairing. Sometimes a shortcut, sometimes a landmine I’ve already stepped on so you don’t have to. |
![]() |
Crucial points, or pitfalls that might bite you in the long run, are highlighted using this prominent warning sign. |
![]() |
Last but not least, these highlights represent me taking care of your caffeine levels. |
AI Disclosure, Production Notes, and Version History
This book is written in Markua and the digital version is published via Leanpub. The code examples, configurations, and architecture diagrams are verified against the target environment below.
- Publication Date: October 2026
- Target Stack: Spin v4.1.0, Rust 1.98+, Spin SDK 7.0+, WASI Preview 3 (targeting
wasm32-wasip2) - Companion Code Repository: thorstenhans/task-engine
AI Disclosure
I want to be fully transparent about how I used generative AI while creating this book. The entire manuscript was written by hand, without any generative AI or agentic tools. That might sound unusual these days, but it is the honest truth.
I used AI (Google Gemini Pro) for basic proofreading before sending out review copies to ensure a smooth reading experience for everyone. Additionally, I used AI (Google Gemini Pro) to generate the book’s mascot and section illustrations, as creating visually appealing art is simply not a skill of mine.
All technical illustrations and diagrams were created by me without AI involvement using Figma.
Version History and Changelog
-
0.1.0(2026-10-13) - 1st Public Release- Incorporated review feedback
-
0.0.10(2026-10-10) - 3rd Review Delivery- Incorporated review feedback
- Updated illustrations and screenshots
-
0.0.9(2026-10-07) - 2nd Review Delivery- Hand out full manuscript to trusted reviewers
-
0.0.8(2026-09-11) - 1st Review Delivery- Hand out subset of the manuscript to trusted reviewers
Let’s get into why any of this matters before we write a line of code.


