Interview › Databases & Caching
What is the impact of a large key or hot key in Redis, and how do you handle it?
Databases & Caching · Advanced level
Answer
A large key increases memory, network, replication, and latency cost; a hot key concentrates too much traffic on one key or shard. I handle them by splitting keys, redesigning data structures, local caching, and request coalescing.
Technical explanation
Large keys increase memory, network, replication, and command latency cost.
Hot keys overload one shard or event loop even if total cluster capacity looks healthy.
Fixes include splitting keys, better data structures, local cache, key sharding, and request coalescing.
Hands-on example
Investigation:
redis-cli --bigkeys -h <host> -p 6379
SCAN 0 MATCH product:* COUNT 1000
MEMORY USAGE product:v2:123
Avoid KEYS in production.
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 Amazon RDS, and what does it manage for you versus self-managed databases?
- What database engines does RDS support?
- What is the difference between RDS and Aurora?
- What is Multi-AZ in RDS, and how does automatic failover work?
- How long does an RDS Multi-AZ failover typically take, and what triggers it?
- What is the difference between Multi-AZ and a read replica?
- When would you use a read replica, and can it become a standalone database?
- Can a read replica be in a different region, and why would you do that?