logo

Tutorial: Create and Deploy a Lightweight Microservice in WebAssembly - Tai Hung

2023-04-21

Authors:   Hung-Ying Tai, Vivian Hu


Summary

The presentation discusses the need for a lighter and more efficient way to manage microservices in the post-pandemic rise of lightweight microservices. The solution presented is the use of WebAssembly System Interface (WASI) to create a more lightweight and efficient infrastructure.
  • The rise of lightweight microservices has created a need for a more efficient way to manage them
  • Current technology is not efficient enough for the large number of microservices required by modern applications
  • WebAssembly System Interface (WASI) provides a more lightweight and efficient infrastructure for managing microservices
  • WASI enables non-blocking sockets, supports domain name lookup, and extends the current API to allow for more functionality
  • WASI can be integrated with various databases and frameworks, including MySQL, Maria DB, PostgreSQL, and Redis server
  • The use of WASI can lead to a more efficient and lightweight infrastructure for managing microservices
The speaker mentions a tweet from a well-known entrepreneur who took over Twitter and discovered over a thousand microservices within the application. This highlights the complexity of modern applications and the need for a more efficient way to manage microservices.

Abstract

As companies and dev teams adopt the microservice architecture on a large scale, it is now common for large applications to have hundreds or even thousands of microservices on the backend. Running, managing, and scaling those microservices in VMs and even Linux containers have become increasingly complex and expensive. The WebAssembly (Wasm) runtime provides a compelling alternative as a lightweight and secure “container” to run microservices. The Wasm containers are often only 1% the size of comparable Linux containers. Wasm container apps can start and stop instantly, enabling zero-cost scalability. In this hands-on tutorial, we will go over the basics and architecture of Wasm-based microservices. Using their own laptops and cloud VMs, participants will learn how to create database-backed and event-driven microservices in both Rust and JavaScript and enhance them with AI inference (PyTorch) features and rich web services like Dapr. We will then run these microservices in the WasmEdge Runtime and deploy the Wasm containers using Docker and K8s tools.

Materials:

Post a comment