Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. gokv

gokv

MPL-2.0Gorelease/v0.7.0

A simple key-value store abstraction for Go with implementations for Redis, Consul, etcd, PostgreSQL, MongoDB, and many more.

GitHubGitHub
828 stars77 forks0 contributors

What is gokv?

gokv is a Go library that provides a simple abstraction layer for key-value stores, enabling developers to interact with various databases through a unified interface. It solves the problem of vendor lock-in and reduces boilerplate code by automatically handling serialization and offering implementations for popular backends like Redis, Consul, etcd, and cloud services.

Target Audience

Go developers building applications that require flexible storage backends, package creators who want to support multiple databases without forcing a specific choice, and teams needing to switch between storage solutions for different environments.

Value Proposition

Developers choose gokv for its minimal interface, extensive backend support, and automatic marshaling, which simplifies storage integration and allows easy swapping of databases without rewriting application logic.

Overview

Simple key-value store abstraction and implementations for Go (Redis, Consul, etcd, bbolt, BadgerDB, LevelDB, Memcached, DynamoDB, S3, PostgreSQL, MongoDB, CockroachDB and many more)

Use Cases

Best For

  • Building Go packages that require storage but should not dictate a specific database
  • Developing applications that need to switch between storage backends for testing vs production
  • Reducing boilerplate code when working with multiple key-value store clients
  • Creating storage-agnostic microservices in Go
  • Prototyping with an in-memory store and later moving to a persistent database
  • Unifying storage access across embedded, distributed, and cloud databases

Not Ideal For

  • Applications demanding ultra-low latency or direct control over database-specific optimizations
  • Projects that rely heavily on advanced database features like transactions, complex queries, or real-time notifications
  • Production systems requiring a stable, long-term API without breaking changes (due to pre-v1.0 status)
  • Teams needing extensive, unified documentation across all supported backends

Pros & Cons

Pros

Extensive Backend Support

Over 20 implementations span embedded, distributed, and cloud databases, enabling seamless switching between environments like Redis for production and in-memory maps for testing.

Automatic Serialization

Accepts any Go type and handles marshaling/unmarshaling with JSON, gob, or protobuf, eliminating boilerplate code compared to raw byte-based libraries.

Minimal, Clean Interface

The Store interface with just Set, Get, Delete, and Close methods simplifies adoption and implementation, as emphasized in the Design Decisions section.

Modular Dependency Management

Each backend is a separate Go module, keeping dependencies lean for users who only need specific stores, avoiding unnecessary bloat.

Cons

Unstable Pre-v1.0 API

The Project Status section warns of active development and breaking changes until v1.0.0, which can disrupt production code and increase maintenance burden.

Limited Advanced Features

Focuses solely on basic CRUD; lacks built-in support for common key-value store features like listings, key expiration, or watchers, requiring workarounds or backend-specific hacks.

Inconsistent Error Handling

Errors are forwarded directly from backend libraries without unification, making error management tricky in storage-agnostic code, as noted in the Design Decisions.

Frequently Asked Questions

Quick Stats

Stars828
Forks77
Contributors0
Open Issues27
Last commit7 months ago
CreatedSince 2018

Tags

#package#library#redis#etcd-client#redis-client#go-library#key-value-store#cloud-storage#embedded-database#database-abstraction#abstraction#golang#bolt#storage-backend#simple#go#key-value#marshaling

Built With

G
Go

Included in

Go169.1k
Auto-fetched 1 day ago

Related Projects

cayleycayley

An open-source graph database

Stars15,043
Forks1,237
Last commit1 month ago
go-transaction-managergo-transaction-manager

Transaction manager for GoLang

Stars406
Forks22
Last commit4 days ago
dscdsc

Datastore Connectivity in go

Stars36
Forks11
Last commit5 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub