Skip to content
Package92 repository health

go-redis

The official, idiomatic Go client for Redis — connection pooling, Cluster, Sentinel, pipelines, and client-side caching built in.

Library Govv9.23.022,293 stars BSD-2-Clause
go get github.com/redis/go-redis/v9
View source

Repository health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
Excellent
  • Development activity100
  • Maintenance84
  • Community84
  • Maturity60
  • Momentum40

Technical analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
Excellent
  • Architecture90
  • Code quality96
  • Innovation80
  • Learning curve80

go-redis is the official Go client library for Redis, maintained by Redis, Inc. and the community. It provides typed, idiomatic wrappers for the full Redis command surface — strings, hashes, sets, sorted sets, streams, JSON, search, probabilistic data structures, and the new array type introduced in Redis 8.8 — alongside first-class support for Redis Cluster, Sentinel, and Ring-based sharding.

Beyond basic command coverage, go-redis ships production-grade operational features: automatic connection pooling with configurable dial retries, pipelines and transactions, an extensible Hook system for tracing and auth, optional OpenTelemetry instrumentation, client-side caching, and an experimental automatic-pipelining mode that batches concurrent commands for high-throughput workloads. It is one of the most widely used and heavily tested Redis clients in the Go ecosystem.

What You Get

  • Full Redis command coverage — strings, hashes, sets, sorted sets, streams, JSON, search, probabilistic types, and the new AR* array command family
  • Multiple deployment modes — Client, ClusterClient, Ring, and Sentinel-aware failover, unified behind a UniversalClient interface
  • Built-in connection pooling with configurable dial retries and pluggable backoff
  • Pipelines, transactions, and an experimental automatic-pipelining mode for high-throughput batching
  • Extensible Hook system plus optional OpenTelemetry instrumentation for tracing and auth

Common Use Cases

  • Caching layer for a web or API service backed by Redis
  • Rate limiting and distributed locks built on Redis primitives
  • Pub/Sub messaging and event fan-out between services
  • Session storage and token/credential caching with streaming auth providers
  • Powering Redis Cluster or Sentinel-based high-availability deployments

Under The Hood

Architecture

The root package exposes several client types — Client, ClusterClient, Ring, and a Sentinel-aware failover client — all sharing the same command-building layer (command.go, commands.go) and a hooksMixin that lets Dial/Process/ProcessPipeline behavior be wrapped without touching call sites. Underneath, internal/pool owns connection lifecycle (pool.go, conn.go, want_conn.go) and internal/proto implements the RESP2/RESP3 wire protocol directly (reader.go, writer.go, scan.go) rather than depending on a third-party parser. A UniversalClient interface and universal.go let application code target standalone, Cluster, or Sentinel deployments through the same configuration surface. Large subsystems layer on top of this core: autopipeline.go (over 100KB) implements automatic command batching for high-throughput scenarios, csc_integration.go adds client-side caching, and maintnotifications/ handles Redis Cluster maintenance push notifications. The Cmder abstraction that every per-command wrapper builds on is the load-bearing seam — every one of the hundreds of typed command methods depends on it.

Tech Stack

A Go 1.24 module with a deliberately minimal dependency footprint: github.com/cespare/xxhash/v2 and github.com/zeebo/xxh3 for cluster hashing, go.uber.org/atomic for lock-free state, golang.org/x/sys, and github.com/klauspost/cpuid/v2 for SIMD feature detection, with github.com/bsm/ginkgo/v2 and gomega used only in tests. The RESP wire protocol is implemented in-house rather than pulled from a dependency, and optional OpenTelemetry integration (otel.go) is wired in as an opt-in instrumentation layer. Docker Compose and a dockers/ directory spin up real Redis, Cluster, and Sentinel instances for integration testing, with CI split across build, end-to-end, and Redis Enterprise workflows.

Code Quality

Testing here is extensive — well over a hundred _test.go files covering unit tests, race-detector tests, fuzz tests (fuzz/, reader_fuzz_test.go), and protocol-level desync/truth tests that validate edge cases in the wire format, on top of full integration suites that run against live Redis via docker-compose. The bsm/ginkgo BDD framework is used alongside standard testing.T tests. Error handling is idiomatic Go with explicit returns and a typed sentinel error (redis.Nil) plus dedicated error-wrapping coverage. CI enforces golangci-lint with staticcheck’s near-complete ruleset, gofmt formatting, govulncheck dependency scanning, and CodeQL static analysis — a rigor level uncommon even among popular Go libraries.

API Design The public API favors compile-time safety over stringly-typed replies: each command returns a typed *Cmd wrapper (StringCmd, IntCmd, and so on) with Result()/Err() accessors matching that command’s actual return shape, and getting started takes only a handful of lines. Advanced capabilities — pipelining, transactions, cross-cutting hooks, automatic pipelining, and client-side caching — activate through configuration rather than API changes, and UniversalClient lets code move between standalone, Cluster, and Sentinel deployments without a rewrite. Documentation is thorough, with godoc comments throughout, a substantial README, and a doctests/ directory of runnable examples. It is not a novel protocol design, but the operational feature set — streaming credentials, maintenance notifications, hitless upgrades — goes well beyond a typical thin RESP client.

Used by 34 apps in this directory

Every app whose dependencies include github.com/redis/go-redis/v9, nine to a page.

Showing 34 apps
Go 58%Apache 2.0

Authgear

2,158

Authentication

Open-source, self-hostable authentication platform with passkeys, biometric login, SSO, MFA, and GraphQL admin API — a full Auth0/Clerk/Firebase alternative for SaaS and mobile apps.

App
Built with
  • Go 58%
  • HTML 20%
  • TypeScript 19%
Updated yesterdayView details
Go 84%AGPL 3.0

Beta9

1,857

AI Development · Automation · Data Engineering

Run AI workloads at scale with a Pythonic serverless runtime that handles GPU inference, background jobs, and sandboxes with zero infrastructure overhead.

App
Built with
  • Go 84%
  • Python 15%
Updated yesterdayView details
TypeScript 55%MIT

Bytebase

14,721

Devops

An open-source database CI/CD and DevSecOps platform — schema migration review, GitOps-driven changes, data masking, and access control across MySQL, PostgreSQL, Oracle, Snowflake, MongoDB, and more.

App
Built with
  • TypeScript 55%
  • Go 39%
Updated todayView details
Go 71%Other

Convoy

2,890

Developer Tools · Devops

Convoy is an open-source, cloud-native webhooks gateway that ingests events over HTTP or straight from Kafka, SQS, Google Pub/Sub, and RabbitMQ, then reliably delivers them to subscriber endpoints with signed payloads, automatic retries, circuit breaking, and JavaScript-based transformations.

App
Built with
  • Go 71%
  • TypeScript 15%
  • HTML 12%
Updated 2 days agoView details
Go 84%AGPL 3.0

Cozy Stack

1,267

File Storage · Productivity

Self-hosted personal cloud platform that unifies your files, apps, and devices in one private space you fully control.

App
Built with
  • Go 84%
  • TypeScript 10%
Updated yesterdayView details
Go 36%Apache 2.0

CubeSandbox

13,391

AI Agents · Developer Tools · Security

Instant, concurrent, hardware-isolated MicroVM sandboxes for AI agents — E2B-API compatible, sub-60ms cold starts, and a built-in zero-trust egress proxy, all self-hostable at scale.

App
Built with
  • Go 36%
  • Rust 23%
  • C 20%
Updated todayView details
C++ 74%Other

Dragonfly

31,898

Databases · Developer Tools · Devops

A modern Redis and Memcached replacement engineered for multi-core servers — delivering 25x more throughput, better cache hit rates, and up to 80% lower memory consumption with full API compatibility.

App
Built with
  • C++ 74%
  • Python 16%
Updated yesterdayView details
Go 76%Other

Flipt

4,953

Developer Tools · Devops

Git-native feature flag platform that stores, versions, and deploys feature toggles directly in your own Git repositories with no external database required.

App
Built with
  • Go 76%
  • TypeScript 23%
Updated 2 days agoView details
Go 83%MIT

Gitea

59,197

Developer Tools · Devops · Project Management

Self-hosted DevOps in a single Go binary — Git hosting, GitHub Actions-compatible CI/CD, and 30+ package registries without any SaaS dependency.

App
Built with
  • Go 83%
Updated todayView details

Join founders building with open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on SubstackJoin 750+ subscribers