wasmedge-db-examples is a collection of example applications demonstrating how to use database clients within the WasmEdge Runtime.
The project addresses the challenge of accessing databases from WebAssembly applications running in WasmEdge. It leverages WasmEdge's non-blocking network socket API and a Tokio-like async runtime to enable popular database drivers to run in the WebAssembly environment. The examples cover multiple database systems: MySQL, MariaDB, and TiDB for relational databases; GreptimeDB for time series data; Postgres for SQL workloads; Redis for key-value storage; and Qdrant for vector databases. This approach allows developers to build database-connected applications that compile to WebAssembly and execute within WasmEdge's sandboxed runtime.
Developers considering these examples should understand they serve as reference implementations for integrating specific database clients into WasmEdge applications. The repository is most useful for teams building microservices or event-driven applications in WebAssembly that need direct database connectivity. The examples demonstrate both standalone database access patterns and integration with larger architectures, including HTTP servers with database backends and Kafka-driven microservices. As an alternative approach, the project acknowledges that developers can use the Dapr SDK for Wasm to access databases through Dapr sidecars rather than direct client connections.
The project maintains working examples across multiple database systems, indicating active curation of the collection to keep pace with both WasmEdge runtime capabilities and the underlying database client libraries. The repository includes references to complete microservice demonstrations, suggesting the maintainers validate these patterns in realistic application scenarios beyond isolated examples.