intermediateTop 30 Scenario-Based Questions
Your Redis is running out of memory. How do you handle this without data loss?
Investigation: 1) INFO memory: check used_memory, peak_memory, mem_fragmentation_ratio. 2) redis-cli --bigkeys: find largest keys consuming most memory. 3) MEMORY USAGE key: check specific key sizes. 4) Immediate actions: 5) Set maxmemory if not set: CONFIG SET maxmemory 4gb. 6) Set eviction policy: CONFIG SET maxmemory-policy allkeys-lru (for cache). 7) OBJECT ENCODING key: check if using memory-
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response