Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cloud-Native vNext with WebAssembly and Spin

Thorsten Hans
September 16, 2022

Cloud-Native vNext with WebAssembly and Spin

WebAssembly (Wasm) will change the way how software components are built and executed. This does not exclusively apply to the browser. It will also revolutionize the way how we build and host services in the cloud. In this talk, Thorsten Hans will explain and demonstrate how to leverage Fermyon’s Spin framework to build (micro)services using WebAssembly. Join this session and make yourself comfortable for the next-generation of cloud-native.

Thorsten Hans

September 16, 2022
Tweet

More Decks by Thorsten Hans

Other Decks in Technology

Transcript

  1. WebAssembly (Wasm) • It’s virutal machine that processes stack-based instructions

    • Instruction are in binary format • For us - as developers - It’s a compiler target. Meaning we compile our code into WebAssembly Introduction
  2. WebAssembly (Wasm) • Fast 🏃‍‍‍ • Near native execution performance,

    leveraging available hardware capabilities • Safe 💪‍ • Wasm is a sandboxed, memory-safe execution environment • Portable 🧊 • All major browsers support Wasm & multiple ”server” Wasm runtimes available Introduction
  3. WebAssembly System Interface (WASI) • Platform Integration 🧬 • WASI

    is a wrapper for underlying platform (OS) capabilities • Think of things like File::open() • Portable 🚀 • WASI could become the default compiling target for EVERYONE! • Secure 👮‍ • Permissions can be defined per app (module) Introduction
  4. WebAssembly Gateway Interface (WAGI) • Use WebAssembly modules as HTTP

    handlers • Think of a hyper-focused microservices runtime • Comman Gateway Interface (CGI) implementation • HTTP headers become environment variables • HTTP payloads are piped to stdin • HTTP responses must be written to stdout Introduction
  5. • A framework for building even—driven microservices using Wasm components

    • Wasm components -> WebAssembly component model • Spin comes with lightweight, tailored SDKs for Rust, TinyGo, Swift, C, Zig • You can use any language that compiles to wasm32-wasi • A runtime that runs Wasm components and links it configurable ”triggers” • A CLI that we –as developers – use to create, build, and run our microservices What is Spin
  6. Let’s give spin a spin 🚀 - Create a microservice

    with spin - Run microservices with spin Demo
  7. • A platform for running spin applications • Fermyon Platform

    uses Nomad as platform • HashiCorp Consul is used for service discovery • Bindle is used for storing our applications packages • HTTP traffic is proxied to the applications using Traefik • You can run Fermyon Platform in the public cloud, in private datacenters or on your bare metal Fermyon Platform