Here is a complete microservice backed by a MySQL database. It is written in Rust, compiled into WebAssembly and runs entirely in the WasmEdge sandbox. Why & how? https://github.com/second-state/microservice-rust-mysql<p>WasmEdge is a cross-platform WebAssembly runtime for cloud native apps. For Rust and JS apps, it is a much lighter, faster, and more secure alternative to Linux containers. It is perfect for microservices and serverless functions.<p>In the context of microservices, WasmEdge can be managed by existing container toolchains. In a Kubernetes cluster, WasmEdge apps can run side-by-side with Linux container apps.<p>WasmEdge apps can be managed by container tools like
Podman and the Docker Desktop and CLI (more on this next week!). Here is how to use Podman to start / manage WasmEdge: https://github.com/KWasm/podman-wasm<p>Now back to the microservice itself. It provides a lightweight yet very fast web server to handle JSON over HTTP requests. It is based on the popular Rust tokio, hyper, and serde libraries. See more examples: https://github.com/WasmEdge/wasmedge_hyper_demo<p>The microservice also features an async MySQL client to interact with backend databases. Even more examples: https://github.com/WasmEdge/wasmedge-db-examples<p>This WasmEdge-based microservice utilizes high-performance non-blocking networking on both the HTTP service & the database client. It is a faster, lighter & more secure alt to Linux container-based microservices.