Interview › Databases & Caching
What is Redis, and what core data types does it support?
Databases & Caching · Intermediate level
Answer
Redis is an in-memory data structure server used for caching, counters, queues, rate limits, sessions, and coordination. Core types include strings, hashes, lists, sets, sorted sets, streams, bitmaps, HyperLogLog, and geospatial indexes.
Technical explanation
Managed cache still requires correct key design, TTLs, invalidation, memory sizing, security, and fallback behavior.
Redis/Valkey is better for counters, rate limits, sorted sets, locks, streams, and HA patterns; Memcached is good for simple ephemeral object cache.
The cache should not become a hidden source of truth unless durability, backup, and failover are deliberately designed.
Hands-on example
Cache-aside example:
GET product:v1:123
If hit, return cached value.If miss, query RDS, then SETEX product:v1:123 300 <json>.
Redis data type examples:
INCR api:tenant:42:requests
HSET user:123 tier premium
ZADD leaderboard 9100 user:123
XADD orders:events * order_id 1001 status created
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Databases & Caching interview questions
- What is the difference between ElastiCache Redis and Memcached?
- What is ElastiCache, and what does it manage?
- What is connection exhaustion, and how do you prevent it?
- How do you migrate from Redis to Valkey with minimal downtime?
- How is Valkey wire-compatible with Redis, and what risks remain in a migration?
- What is schema migration, and how do you run migrations safely in production?
- What is AWS DMS, and when would you use it?
- What is WAL (write-ahead logging), and how does it support durability and replication?