Building microservices with WebAssembly, Rust, and Spin - Radu Matei - Rust Linz May 2022

Discover WebAssembly microservices with true cross-platform capabilities. Learn about the component model and Spin's simplifications.

Key takeaways
  • The component model aims to standardize the execution of WebAssembly outside the browser, enabling scenarios like serverless platforms, scripting environments, and cross-language composition.
  • Building microservices with Rust and WebAssembly allows for true cross-platform and cross-architecture capabilities.
  • WebAssembly components can be used to make requests to external services, such as Redis, and return results to the client.
  • Spin is a project that uses the WebAssembly component model to build a framework for microservices, with robust support for SDKs and simplified component configuration.
  • The WebAssembly system interface (WASI) provides a way to access file systems, networking, and environment variables.
  • Interfaces generated by with bindgen can be used to consume or implement WebAssembly interfaces.
  • The spin CLI can be used to generate a new WebAssembly component and build it for production.
  • Finicky Whiskers is a manual load generator that demonstrates WebAssembly components and Spin in action.
  • WebAssembly provides isolation between components and environments, ensuring that code from different projects does not interfere with each other.
  • The WebAssembly component model enables composition of high-performance code from different languages, allowing for efficient and secure microservices.
  • Spin has built-in support for handling Pub/Sub with Redis for every new request.
  • The component model and Spin use Rust and the component model to build a framework for microservices with fast startup times and isolation.
  • WebAssembly exports can be accessed using Rust’s proc macro attributes.
  • Spin has excellent support for building microservices in Rust, with a simple way of defining components and configuring dependencies.