- Published on
Redis
- Authors
- Name
- Lucian Oprea
- @LucianDSA_
00:30:00
Redis Basics
⏷ 1. What is Redis, and how does it differ from traditional relational databases?
⏷ 2. Explain the data structures Redis supports.
⏷ 3. How does Redis persist data?
⏷ 4. If Redis is an in-memory database, how does it handle persistence during a power failure?
⏷ 5. What are the differences between Redis's AOF and RDB persistence mechanisms, and how would you decide which one to use?
⏷ 6. Explain the concept of key eviction policies in Redis and when you might use the volatile-lru
policy.
Data Structures and Commands
⏷ 7. How do you use a Redis hash, and when is it beneficial compared to a simple key-value pair?
⏷ 8. What are Redis sorted sets, and how can they be used in leaderboards?
⏷ 9. Describe the difference between the GET
and MGET
commands.
⏷ 10. How would you use Redis sets to find the common followers between two users in a social media app?
⏷ 11. In a sorted set, what happens if two members have the same score? How does Redis determine their order?
⏷ 12. Can you explain the performance implications of using a ZINTERSTORE
operation on large sorted sets?
Performance Optimization
⏷ 13. How does Redis achieve high performance for read and write operations?
⏷ 14. What is Redis pipelining, and how does it improve performance?
⏷ 15. How do you monitor Redis performance?
⏷ 16. How would you reduce memory usage in Redis for a dataset with millions of keys?
⏷ 17. What are the trade-offs of using Lua scripts in Redis to batch operations instead of pipelining?
⏷ 18. Why might Redis block on a SAVE
command, and how can you avoid this issue in a production environment?
Clustering and Scalability
⏷ 19. What is Redis clustering, and how does it distribute data across nodes?
⏷ 20. How do Redis replicas differ from Redis shards?
⏷ 21. Explain the concept of hash slots in Redis clustering.
⏷ 22. How would you handle a scenario where a Redis cluster node fails? What happens to the hash slots?
⏷ 23. Can a single key span multiple shards in a Redis cluster? Why or why not?
⏷ 24. How would you scale a Redis instance if clustering is not an option?
Transactions and Scripting
⏷ 25. How do transactions work in Redis?
⏷ 26. What is the role of the WATCH
command in Redis transactions?
⏷ 27. How would you use Lua scripting in Redis?
⏷ 28. What happens if a MULTI
transaction fails midway? How can you ensure data consistency?
⏷ 29. How would you use the WATCH
command to implement a distributed lock with Redis?
⏷ 30. In a Lua script, how do you handle atomicity and return meaningful errors to the client?
Caching and Use Cases
⏷ 31. How would you handle cache invalidation in Redis for a high-throughput application with rapidly changing data?
⏷ 32. What are the implications of using Redis as both a cache and a database in the same system?
⏷ 33. How would you implement a sliding window rate limiter using Redis?
Security and Configuration
⏷ 34. How can you secure a Redis instance?
⏷ 35. What are the main configuration options for Redis?
⏷ 36. How do you implement password protection in Redis?
⏷ 37. What are the risks of exposing a Redis instance to the internet, and how can you mitigate them?
⏷ 38. How would you restrict access to certain commands for specific users in Redis?
⏷ 39. What happens if the maxmemory
setting is reached in Redis, and how would you handle it for critical applications?
Distributed Systems and Redis
⏷ 40. How does Redis handle distributed locks?
⏷ 41. What is Redis Sentinel, and how does it provide high availability?
⏷ 42. Explain the difference between Redis Pub/Sub and Redis Streams.
⏷ 43. How would you implement a reliable distributed lock with Redis that avoids race conditions?
⏷ 44. What are the limitations of Redis Pub/Sub for message delivery, and how does Redis Streams address them?
⏷ 45. How would Redis Sentinel behave in a network partition where the master node is isolated from most of its replicas?
Persistence and Backup
⏷ 46. How does Redis implement backups?
⏷ 47. What is the difference between an RDB snapshot and an AOF log?
⏷ 48. How do you configure Redis for periodic backups?
⏷ 49. How would you recover from a corrupted AOF file in Redis?
⏷ 50. If both RDB and AOF are enabled, which one takes precedence during recovery, and why?
⏷ 51. What are the performance implications of enabling AOF persistence in append-only mode?