Embedded database options

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/golang

Our great sponsors
  • SonarLint - Clean code begins in your IDE with SonarLint
  • Scout APM - Less time debugging, more time building
  • SaaSHub - Software Alternatives and Reviews
  • embedded-postgres

    Run a real Postgres database locally on Linux, OSX or Windows as part of another Go application or test

    This is down to nuance, but all databases are "file based" as they all write to files. But most of them require a separate process with lock coordination to get away from writer lock delays and ensure ACID, which includes Postgresql. Calling any version of pgl "embedded" is confusing because I see that being used to describe pgl databases which are run in a localhost mode with a single reader/writer client. Regardless, those still require a postgres process and access it over IP. For simplicity, if one uses a database by touching its files directly from the process accessing the database, then it's "embedded"; but then again I guess that semantic ship has sailed: https://github.com/fergusstrange/embedded-postgres so the point may be moot.

  • awesome-go-storage

    A curated list of awesome Go storage projects and libraries

  • SonarLint

    Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.

  • genji

    Document-oriented, embedded SQL database

    Another option could be also Genji - https://github.com/genjidb/genji

  • litestream

    Streaming replication for SQLite.

    And with litestream.io/ you can have semi-non-blocking backups.

  • ObjectBox Go Database

    Fast Golang database for easy Go structs/objects persistence; plus out-of-the-box Data Sync

    You could try https://github.com/objectbox/objectbox-go. I have not used the go version, but a coworker is using it for dart and it made a good impression. I like that its type safe

  • badger

    Fast key-value DB in Go.

  • Bytebase

    Safe database schema change and version control for DevOps teams. https://www.bytebase.com

    Bytebase embedds postgresql per platform. If it helps. https://github.com/bytebase/bytebase/tree/main/resources/postgres

  • Scout APM

    Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.

  • migrate

    Database migrations. CLI and Golang library.

    This is indeed a concern, but not one I've needed to care about (or the ordering of columns on disk in general). Using an intermediate table might be OK if you use it as part of automatic DB migrations. I use golang-migrate, YMMV.

  • badger

    Fast Key-Value DB in Go (by outcaste-io)

    Just know that dgraph (which you also mentioned) appears to be in its death throws. The original developer has left, forked it and is working on starting a new company around it. I'm rooting for him because it's a great database.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts