redis avatar

Redis Connections

Shows you how to configure Redis clients without shooting yourself in the foot. The big wins are connection pooling (never create a connection per request), pipelining batches of independent commands, and using SCAN instead of KEYS in production. It also covers RESP3 client-side caching for hot keys and timeout tuning. Written by Redis, Inc., so the guidance is authoritative. Most valuable when you're setting up redis-py, Jedis, or Lettuce for the first time, or when you notice latency creeping into what should be fast Redis calls. The blocking commands section clears up a common confusion about BLPOP on multiplexed connections.

skills.sh installs
3K
GitHub stars
175
last updated
Aug 21, 2026

Install

$ npx -y skills add redis/agent-skills --skill redis-connections --agent claude-code

Installs into .claude/skills of the current project.

Files

Redis Connections

Client-side guidance for talking to Redis efficiently: how to share connections, how to batch commands, which commands not to call in production, when to turn on client-side caching, and how to set timeouts that fail fast without breaking healthy traffic.

When to apply

  • Creating or reviewing a Redis client setup (redis-py, Jedis, Lettuce, go-redis, NRedisStack).
  • Making many small Redis calls and wondering where the latency is going.
  • Iterating large keyspaces, sets, hashes, or lists.
  • Enabling client-side caching for hot keys.
  • Tuning connect / read / write timeouts.

1. Pool or multiplex — never one connection per request

The single biggest mistake in Redis client code is opening a new TCP connection for every operation. Always either:

  • Pool — keep N persistent connections that the application leases per call (redis-py ConnectionPool, Jedis JedisPooled, go-redis client).
  • Multiplex — share a single connection across all requests (Lettuce, NRedisStack).

Sponsors

Details

Repository
github.com/redis/agent-skills
Categories
Backend & APIs, AI & Agent Building, Databases
First seen
Jul 14, 2026

More from redis/agent-skills

All 8
1dpearson2699 avatarswift-api-design-guidelinesdpearson2699/swift-ios-skillsApply Swift API Design Guidelines to name, label, and document Swift APIs. Covers argument label rules (prepositional phrase rule, grammatical phrase rule, firs3Kskills.sh installs
2redis avatarredis-observabilityredis/agent-skillsRedis observability guidance — which metrics to monitor (memory, connections, hit ratio, ops/sec, rejected connections), which built-in commands to reach for du2.5Kskills.sh installs
3affaan-m avatarclaude-apiaffaan-m/everything-claude-codeclaude api2.4Kskills.sh installs
4google-deepmind avataralphafold-database-fetch-and-analyzegoogle-deepmind/science-skillsRetrieve and analyze AlphaFold predicted structures for a protein. Use when the user provides a specific UniProt Accession ID and wants structural confidence me2.3Kskills.sh installs
5dotnet avatarminimal-api-file-uploaddotnet/skillsFile upload endpoints in ASP.NET minimal APIs (.NET 8+)2.3Kskills.sh installs
6nvidia avatarcuopt-routing-api-pythonnvidia/skillsVehicle routing (VRP, TSP, PDP) with cuOpt — Python API only. Use when the user is building or solving routing in Python.2.3Kskills.sh installs