14 ms·
A complete microservice backed by MySQL, written in Rust and compiled into WASM
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
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.
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.
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
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
The microservice also features an async MySQL client to interact with backend databases. Even more examples: https://github.com/WasmEdge/wasmedge-db-examples
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.
- metadat 4y agoClickable links: https://github.com/second-state/microservice-rust-mysql https://github.com/second-state/microservice-rust-mysql -- https://github.com/KWasm/podman-wasm https://github.com/KWasm/podman-wasm https://github.com/WasmEdge/wasmedge_hyper_demo https://github.com/WasmEdge/wasmedge_hyper_demo https://github.com/WasmEdge/wasmedge-db-examples https://github.com/WasmEdge/wasmedge-db-examples
- 3Sophons 4y agoOh thanks a lot. Seems there's no edit button. Need to make sure it is clickable next time