Skip to content
_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN DE
Let's talk

Redis Data Structures

28. 11. 2025 Updated: 27. 03. 2026 1 min read intermediate

Redis is in-memory data structure server.

Strings

SET user:1:name 'John'
GET user:1:name
INCR page:views
SETEX session:abc 3600 '{...}'

Hashes

HSET user:1 name 'John' email 'john@ex.com'
HGETALL user:1

Lists

LPUSH queue:tasks '{...}'
RPOP queue:tasks

Sorted Sets

ZADD leaderboard 1000 'player1' 950 'player2'
ZREVRANGE leaderboard 0 9 WITHSCORES

HyperLogLog

PFADD visitors 'u1' 'u2' 'u3'
PFCOUNT visitors

Practical Usage Patterns

Each Redis data structure has specific use cases. Strings with TTL (SETEX) are the foundation for session management and caching. Hashes efficiently store objects — one hash per user profile instead of dozens of string keys. Lists function as FIFO queues for task processing (LPUSH + BRPOP).

Sorted Sets are Redis’s most unique structure — they enable sorted collections with O(log N) operations. Typical uses include leaderboards, rate limiting (sliding window), priority queues, and time-based indexes. HyperLogLog is a probabilistic structure for counting unique elements with constant memory (~12 KB) and a maximum error of 0.81%. It is ideal for counting unique visitors or distinct values in streams.

Redis = Powerful Structures

Strings=cache, Hashes=objects, Lists=queues, ZSets=leaderboards.

rediscachedata structures
Share:

CORE SYSTEMS team

We build core systems and AI agents that keep operations running. 15 years of experience with enterprise IT.