import Image from "@components/Image.astro"; import LightLogo from "@img/icon/light/golang.png"; import DarkLogo from "@img/icon/dark/golang.png";
SurrealDB can be run as an embedded database within your Go application, allowing you to use SurrealDB without running a separate server process. This is ideal for desktop applications, testing, local development, and edge computing scenarios.
Embedded database options
SurrealDB supports multiple types of embedded storage in Go:
In-memory database (
mem://) - Fastest performance with data stored in RAM. Perfect for testing, caching, or temporary data. Data is lost when the connection closes.File-based database (
surrealkv://orrocksdb://) - Persistent storage on disk using the SurrealKV storage engine. Data persists across connections and application restarts. The RocksDB backend requires a separate manual build detailed here
Quick example
For complete documentation, installation instructions, examples, best practices, and troubleshooting, see the Go SDK embedding guide.