valkey

Installation
SKILL.md

Valkey

Open-source, Redis-compatible in-memory data store maintained by the Linux Foundation. Forked from Redis OSS 7.2.4 (BSD 3-Clause license). Drop-in replacement for Redis OSS 2.x through 7.2.x — same protocol, commands, and data formats.

When to use: Caching, session storage, rate limiting, pub/sub messaging, task queues, leaderboards, distributed locks, real-time counters, or any workload requiring sub-millisecond key-value operations.

When NOT to use: Primary relational data store, large object storage (>512 MB values), workloads requiring strong ACID transactions across multiple keys without Lua scripting.

Quick Reference

Task Approach Key Point
Cache-aside GET -> miss -> DB read -> SET key val EX ttl Always set a TTL, even a long one
Session storage HSET session:{id} field val + EXPIRE Sliding TTL on each request
Rate limiting INCR + EXPIRE (fixed window) or sorted set (sliding) Sorted set for precision
Distributed lock SET lock:{res} token NX PX 30000 Always set expiry to prevent deadlocks
Queue (simple) LPUSH + BRPOP Blocking pop with timeout
Queue (reliable) Streams + XGROUP + XACK Consumer groups for at-least-once
Pub/Sub SUBSCRIBE / PUBLISH Fire-and-forget, no persistence
Related skills
Installs
57
GitHub Stars
11
First Seen
Feb 24, 2026