go-redis

The official Redis client library for Go, with pooling, pipelines, Pub/Sub, and Cluster support

Library
Go
vv8.11.5
22,227stars
BSD-2-Clause

Repository Health

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

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
83/100Excellent
Architecture88
Code Quality90
Innovation72
Learning Curve80

go-redis is the official Redis client for the Go programming language, maintained by Redis and offering a complete, idiomatic interface for talking to a Redis server or cluster. It wraps every core Redis command family (strings, hashes, sets, sorted sets, streams, geo, HyperLogLog, scripting) behind a single typed Client, handling connection pooling, retries, and RESP protocol encoding so application code never touches raw sockets.

Beyond basic commands, the library ships production features that most Go Redis wrappers leave out: automatic and manual pipelining, MULTI/EXEC transactions, Pub/Sub, Redis Sentinel and Redis Cluster clients with the same API surface as a standalone client, and client-side caching. This version tracks the v8 module line (github.com/go-redis/redis/v8), the long-lived release series that predates the project’s move to the redis/go-redis module path and v9 major version.

What You Get

  • A typed Client/ClusterClient/SentinelClient covering the full Redis command set (strings, hashes, lists, sets, sorted sets, streams, geo, HyperLogLog, scripting) behind one consistent API
  • Automatic connection pooling with configurable pool size, idle timeouts, and health checks baked into every client
  • Pipelining and MULTI/EXEC transaction support for batching multiple commands into a single round trip
  • Native Pub/Sub client for publish/subscribe messaging patterns
  • Redis Sentinel support for automatic master discovery and failover in high-availability deployments
  • Redis Cluster client that transparently handles slot routing, redirects (MOVED/ASK), and resharding
  • Lua scripting helpers (Eval/EvalSha) with script caching for atomic server-side logic

Common Use Cases

  • Application caching layer - services store and invalidate cached query results or computed values in Redis to cut database load
  • Session storage - web backends keep user session state in Redis so any server instance can serve a logged-in request
  • Rate limiting and counters - APIs use Redis INCR/expire semantics via go-redis to enforce per-user or per-IP request limits
  • Pub/Sub messaging between services - lightweight event fan-out between Go microservices without a dedicated message broker
  • Distributed locks and coordination - services use Redis-backed locks (often paired with companion libraries like redislock) to coordinate exclusive access across replicas

Under The Hood

Architecture The client is built around a shared baseClient embedded by Client, ClusterClient, Ring, and SentinelClient in redis.go and cluster.go, so every deployment topology reuses the same command execution, hook, and pipeline machinery while only the connection-resolution strategy differs (a single pool for Client, slot-aware routing across per-node pools for ClusterClient). A Hook interface (DialHook/ProcessHook/ProcessPipelineHook) lets callers wrap command execution for tracing or retries without touching internals, and connections themselves are managed by a dedicated pool package (internal/pool) that separates dialing, health-checking, and checkout/return logic from the command layer above it. Commands are generated onto the client via large per-datatype files (string_commands.go, hash_commands.go, sortedset_commands.go, etc.), keeping the RESP encoding/decoding (internal/proto) isolated from command definitions.

Tech Stack Written in idiomatic Go with zero required third-party runtime dependencies beyond small internal-use libraries (cespare/xxhash for cluster hashing, golang.org/x/sys for platform syscalls); optional integrations exist for OpenTelemetry tracing (extra/redisotel) and structured logging. The module targets modern Go versions and uses Go modules exclusively, with Docker Compose used to spin up real Redis/Sentinel/Cluster topologies for integration testing rather than mocking the protocol.

Code Quality The repository carries an unusually large test suite for a Go library — dozens of _test.go files covering unit tests, race-detector runs, and full integration suites (cluster routing, Sentinel failover, pipelining edge cases) exercised against dockerized Redis. CI runs golangci-lint, CodeQL static analysis, and govulncheck on every change, and errors are returned as typed Go errors rather than swallowed, consistent with idiomatic Go error handling throughout the command layer.

What Makes It Unique What distinguishes go-redis from lighter Redis wrappers is that Cluster, Sentinel, and standalone clients all share one command API — application code written against *redis.Client mostly works unchanged against *redis.ClusterClient — while pipelining, transactions, and Pub/Sub are first-class rather than bolted on. As the official client maintained directly by Redis, it also tracks new server-side command additions closely and is the reference implementation most Go tooling and tutorials assume.

Used by 10 apps in this directory

Go
72%
Other

Convoy

Developer Tools · Devops

2,862

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.

View details
88
Repo Health
81
Technical
65
Dependency
Built with
Go72%
TypeScript15%
HTML12%
Updated 5 days ago
Go
73%
Other

Flipt

Devops · Developer Tools

4,888

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

View details
90
Repo Health
83
Technical
69
Dependency
Built with
Go73%
TypeScript26%
Updated yesterday
TypeScript
49%
AGPL 3.0

Grafana

Monitoring · Analytics

76,643

The open-source observability platform that unifies metrics, logs, and traces from any data source into dynamic, queryable dashboards.

View details
95
Repo Health
91
Technical
63
Dependency
Built with
TypeScript49%
Go45%
Updated today
Go
62%
Apache 2.0

Harness Open Source

Developer Tools · Devops · Code Editors

38,251

A unified open source DevOps platform combining Git hosting, CI/CD pipelines, cloud development environments, and artifact registries in a single self-hosted system.

View details
89
Repo Health
79
Technical
64
Dependency
Built with
Go62%
TypeScript34%
Updated 3 days ago
Go
91%
AGPL 3.0

Lago

Ecommerce · Invoicing Finance

10,509

Open-source metering, billing, and revenue infrastructure for product-led companies that need complete control over their pricing stack.

View details
88
Repo Health
81
Technical
76
Dependency
Built with
Go91%
Updated 3 days ago
Go
78%
Apache 2.0

OpenMeter

Invoicing Finance · Developer Tools

2,247

Open-source metering and billing engine for AI, agentic, and DevTool monetization — ingest usage events in real time and turn them into accurate invoices automatically.

View details
87
Repo Health
81
Technical
66
Dependency
Built with
Go78%
TypeScript17%
Updated yesterday
TypeScript
50%
Other

SigNoz

Monitoring · Analytics

32,028

Self-host your entire observability stack — logs, metrics, traces, and LLM monitoring — in one OpenTelemetry-native platform, without the Datadog bill.

View details
92
Repo Health
83
Technical
67
Dependency
Built with
TypeScript50%
Go39%
Updated today
Go
98%
Apache 2.0

Space Cloud

Devops · Authentication

3,998

Kubernetes-native serverless platform that generates instant GraphQL and REST APIs for any database with built-in auth and real-time subscriptions

View details
50
Repo Health
74
Technical
63
Dependency
Built with
Go98%
Updated 2 years ago
Go
54%
AGPL 3.0

Uptrace

Monitoring · Devops

4,279

Unified open-source APM that collects OpenTelemetry traces, metrics, and logs into a single self-hosted platform backed by ClickHouse.

View details
62
Repo Health
70
Technical
64
Dependency
Built with
Go54%
Vue34%
Updated 3 weeks ago

Join founders buildingwith open source

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

Subscribe on Substack
Join 750+ subscribers

Search