Looking for this year's edition? Please visit WASM I/0 2024

Session

Look who's talking!

Detail illustration WASM I/O Detail illustration WASM I/O
Michael Yuan
blend-mode

Build Database Driven Applications in Wasm

Michael Yuan - Second State

Slides

Wasm has emerged as a secure, portable, lightweight, and high-performance application runtime for cloud-native workloads such as microservices and serverless functions. However, the standard Wasm sandbox does not readily support database connections. The Wasm community has created several solutions to address the diverse use case scenarios for database applications. There are three important approaches.

  • Use host functions, such as Spin framework and the upcoming component model framework, to handle database connections outside of the VM and expose the data through APIs to Wasm guest apps.
  • Support existing database client libraries and drivers in Wasm guest apps through WASI-like socket APIs.
  • Embed the Wasm VM into a data pipeline and exchanged data with the Wasm guest app through shared memory space.

Each of these approaches has pros and cons. In this talk, we will present examples of Wasm apps connecting to MySQL, TiDB, and Redis, databases. We will also discuss database UDF and ETL use cases built on Wasm functions.

View all sessions