Redis Commands Reference

All Redis commands filterable by data structure — string, hash, list, set, zset.

Searchable Redis command reference grouped by data structure — strings, hashes, lists, sets, sorted sets and generic key commands — with syntax, time complexity and the version each was introduced.

What does the time complexity column mean?

It is the Big-O cost of a single call, where N is the number of elements involved. Redis is single-threaded, so an O(N) command on a huge key blocks every other client until it finishes.

A grouped, offline Redis command lookup

Redis commands map onto its data structures — strings, hashes, lists, sets and sorted sets — plus a set of generic key commands. This reference lets you search commands by name or description and filter by data structure, showing the syntax, the time complexity and the version each command appeared in. It runs entirely in your browser.

How it works

Each entry lists the command, the data structure it operates on, the syntax with placeholders, the Big-O time complexity and the Redis version it was introduced in. Because Redis executes commands one at a time on a single thread, the time complexity tells you whether a command is safe to run on a large key. A few common patterns:

SET session:42 "{...}" EX 3600      # value + 1-hour TTL atomically
INCR page:views                     # atomic counter
ZADD leaderboard 99 "alice"         # add scored member
ZRANGE leaderboard 0 9 WITHSCORES   # top 10 by score
SCAN 0 MATCH user:* COUNT 100       # iterate keys without blocking

Tips and examples

  • Prefer SCAN over KEYS and HSCAN/SSCAN/ZSCAN over their bulk equivalents on large keys to avoid blocking the server.
  • Always set an expiry on cache keys with EXPIRE or SET ... EX so memory does not grow unbounded.
  • Use BLPOP/BRPOP to build a simple blocking work queue without polling.
  • Sorted sets make excellent leaderboards and rate-limiters because score-based range queries are O(log N + M).