03 November 2020

#Redis

#Redis
Topic Sub-Topics Basic Intermediate Advanced Expert
Introduction & Basics What is Redis, Use cases, Key features, Data types overview
Data Types & Structures Strings, Lists, Sets, Sorted Sets, Hashes, Bitmaps, HyperLogLog, Streams
Persistence RDB Snapshots, AOF (Append Only File), Hybrid persistence, Persistence configuration
Replication Master-Slave replication, Configuration, Partial resynchronization, Replication lag
High Availability Redis Sentinel, Failover, Monitoring, Configuration best practices
Clustering & Sharding Redis Cluster, Hash slots, Resharding, Partitioning strategies
Transactions & Scripting MULTI/EXEC, DISCARD, WATCH, Lua scripting
Pub/Sub Messaging Publish/Subscribe, Patterns, Use cases in real-time systems
Performance & Optimization Memory optimization, Eviction policies (LRU, LFU), Pipeline, Connection pooling
Security Authentication, ACLs, TLS/SSL, Best practices
Monitoring & Management Redis CLI, RedisInsight, Slowlog, Metrics, Logging
Backup & Recovery Backup strategies, RDB/AOF restore, Disaster recovery planning
Advanced Features Redis Streams, Modules (RediSearch, RedisJSON, RedisGraph), Geospatial data
Integration Redis with Java, Python, Node.js, Spring Data Redis
Cloud & Enterprise Redis Enterprise, Redis on AWS/Azure/GCP, Managed Redis services

1. Redis Fundamentals & Architecture

  1. What is Redis and how does it differ from traditional databases?
  2. Explain Redis architecture and its single-threaded model.
  3. What are the key use cases of Redis?
  4. How does Redis achieve high performance?
  5. What are Redis keys and how are they managed?
  6. What are Redis namespaces and key patterns?
  7. What is the maximum key size in Redis?
  8. How do you check the type of a Redis key?
  9. What are the advantages of Redis over Memcached?
  10. Explain how Redis handles durability.
  11. What is the role of redis.conf in Redis configuration?
  12. Explain the importance of protected-mode in Redis.
  13. What are Redis databases (DB index) and how are they used?
  14. How many databases does Redis provide by default?
  15. How do you rename Redis commands for security?
  16. What are volatile keys in Redis?
  17. How does Redis handle persistence by default?
  18. Explain the difference between volatile-lru and allkeys-lru eviction.
  19. What are Redis modules?
  20. What are some disadvantages of Redis?
  21. What are keyspace notifications in Redis?
  22. Can Redis store large files or blobs? Why or why not?
  23. How does Redis handle client connections?
  24. Explain Redis event loop mechanism.
  25. What are some real-world applications of Redis?

2. Data Structures & Commands

  1. What are the main data structures supported by Redis?
  2. How do you use Strings in Redis?
  3. What are Hashes in Redis and their use cases?
  4. Explain Lists and their operations in Redis.
  5. How do Sets differ from Sorted Sets in Redis?
  6. What are HyperLogLogs and when are they used?
  7. Explain Redis Bitmaps with an example use case.
  8. What are Redis Streams?
  9. What is the difference between LPUSH and RPUSH?
  10. How do you retrieve a range of elements from a list?
  11. Explain the usage of ZRANGE in Sorted Sets.
  12. How does Redis support geospatial data?
  13. How do you increment a value in Redis?
  14. What is the difference between EXPIRE and TTL?
  15. What does the SCAN command do?
  16. How do you delete keys in Redis?
  17. Explain the difference between DEL and UNLINK.
  18. How do you check if a key exists?
  19. What does the TYPE command return?
  20. How do you find all keys matching a pattern?
  21. What is the difference between GETSET and SETNX?
  22. Explain HGETALL and its limitations.
  23. How do you use SADD and SMEMBERS?
  24. Explain how to store JSON data in Redis.
  25. What is the role of EXISTS command?

3. Persistence (RDB, AOF, Hybrid)

  1. What persistence mechanisms are supported by Redis?
  2. Explain RDB snapshots in Redis.
  3. How does AOF persistence work?
  4. What is the difference between RDB and AOF?
  5. Explain the append-only file rewrite mechanism.
  6. How do you configure RDB snapshots?
  7. How can you configure Redis to use both RDB and AOF?
  8. What is the fsync policy in AOF?
  9. Explain the advantages of AOF persistence.
  10. Explain the disadvantages of AOF persistence.
  11. How do you recover data from a corrupted AOF file?
  12. What is mixed persistence in Redis?
  13. How do you disable persistence in Redis?
  14. Explain how to back up Redis data.
  15. How do you restore a Redis dump file?
  16. What happens when Redis restarts with RDB enabled?
  17. How can persistence affect Redis performance?
  18. What is AOF rewrite and why is it needed?
  19. How does Redis ensure durability during crashes?
  20. What are the trade-offs between RDB and AOF?
  21. Explain lazy persistence in Redis.
  22. How do you configure multiple persistence strategies?
  23. How do you compress Redis backups?
  24. What is the role of appendfsync always?
  25. Which persistence mode would you use in production and why?

4. Transactions, Pipelining & Pub/Sub

  1. What are Redis transactions?
  2. How do you start and execute a transaction?
  3. Explain the role of MULTI and EXEC.
  4. What happens if one command in a transaction fails?
  5. What is optimistic locking in Redis?
  6. How does the WATCH command work?
  7. Can Redis transactions be rolled back?
  8. What are the limitations of Redis transactions?
  9. How does pipelining improve Redis performance?
  10. What is the difference between pipelining and transactions?
  11. What is Redis Pub/Sub and its use cases?
  12. How does Pub/Sub differ from message queues?
  13. Explain the commands PUBLISH and SUBSCRIBE.
  14. How does pattern-based subscription work?
  15. Can you persist messages in Pub/Sub? Why not?
  16. What are the drawbacks of Pub/Sub in Redis?
  17. How do Pub/Sub and Streams differ?
  18. What is the UNSUBSCRIBE command used for?
  19. How does Pub/Sub handle multiple subscribers?
  20. How do you implement chat with Redis Pub/Sub?
  21. What is the PSUBSCRIBE command?
  22. How do you achieve reliable messaging in Redis?
  23. What is the maximum number of subscribers in Pub/Sub?
  24. Explain latency issues with pipelining.
  25. What are use cases of WATCH + MULTI/EXEC?

5. Redis Clustering & Sharding

  1. What is Redis clustering?
  2. How does Redis distribute data across nodes?
  3. Explain hash slots in Redis cluster.
  4. How many hash slots does Redis cluster use?
  5. How does Redis cluster handle failover?
  6. Explain the role of master and replica nodes.
  7. What is the gossip protocol in Redis cluster?
  8. How do you add a new node to a Redis cluster?
  9. What is resharding in Redis?
  10. How do you check cluster health?
  11. What is the role of CLUSTER NODES command?
  12. Can Redis cluster handle cross-slot operations?
  13. What are some limitations of Redis cluster?
  14. How do you migrate keys between clusters?
  15. Explain the MOVED redirection error.
  16. How does Redis cluster ensure consistency?
  17. What is the ASK redirection in Redis?
  18. Explain client-side sharding vs Redis cluster.
  19. How do you expand a Redis cluster?
  20. What are the benefits of clustering in Redis?
  21. What is the minimum number of nodes required for a Redis cluster?
  22. How does Redis cluster achieve partition tolerance?
  23. How do you configure Redis cluster replication?
  24. Explain multi-master replication in Redis enterprise.
  25. What is the difference between Redis cluster and Sentinel?

6. Replication & High Availability (Sentinel)

  1. What is Redis replication?
  2. How does master-slave replication work?
  3. What is asynchronous replication in Redis?
  4. How does partial resynchronization work?
  5. How do you promote a replica to master?
  6. What is replication lag in Redis?
  7. How do you monitor replication health?
  8. Explain cascading replication in Redis.
  9. How do you configure replication in Redis?
  10. What are the benefits of Redis replication?
  11. What is Redis Sentinel?
  12. How does Sentinel monitor Redis masters?
  13. How does Sentinel handle failover?
  14. What is quorum in Sentinel?
  15. Explain Sentinel notification scripts.
  16. What is the difference between Sentinel and Cluster?
  17. How many Sentinels are needed for high availability?
  18. How does Sentinel detect failures?
  19. Can Sentinel manage multiple Redis masters?
  20. Explain Sentinel election process.
  21. What are limitations of Redis Sentinel?
  22. How do you test Sentinel failover?
  23. How does Sentinel handle split-brain scenarios?
  24. How do you configure multiple Sentinels?
  25. What are best practices for Redis Sentinel?

7. Security & Access Control

  1. How do you secure a Redis instance?
  2. What is Redis AUTH command?
  3. What are Redis ACLs?
  4. How do you configure role-based access in Redis?
  5. How do you enforce password rotation in Redis?
  6. How does Redis support TLS?
  7. What are the risks of running Redis without AUTH?
  8. How do you rename commands for security?
  9. What are protected-mode and why is it important?
  10. How do you prevent unauthorized access in Redis?
  11. How do you disable dangerous Redis commands?
  12. How does Redis handle encryption?
  13. How do you set up Redis ACL categories?
  14. How do you audit Redis security events?
  15. Explain Redis client connection limits.
  16. How do you prevent brute-force attacks in Redis?
  17. What is SSL offloading in Redis?
  18. How do you configure firewalls with Redis?
  19. How do you secure Redis in Kubernetes?
  20. Explain Redis security best practices.
  21. How do you use stunnel for Redis security?
  22. How do you monitor unauthorized access attempts?
  23. What are some common Redis vulnerabilities?
  24. How do you secure Redis in cloud environments?
  25. How do you perform penetration testing for Redis?

8. Performance Tuning & Memory Management

  1. What factors affect Redis performance?
  2. How does pipelining improve performance?
  3. What is the difference between pipelining and batching?
  4. How do you profile slow queries in Redis?
  5. What is Redis SLOWLOG and how is it used?
  6. How do you optimize Redis memory usage?
  7. Explain Redis eviction policies.
  8. What is noeviction policy?
  9. How does allkeys-lru differ from volatile-lru?
  10. How do you monitor Redis memory usage?
  11. What are the risks of using the KEYS command?
  12. How do you optimize list operations in Redis?
  13. How does ziplist encoding optimize memory?
  14. Explain lazy freeing in Redis.
  15. How do you handle latency in Redis?
  16. How do you tune Redis persistence for performance?
  17. What is memory fragmentation in Redis?
  18. How do you benchmark Redis performance?
  19. How do you configure connection pooling?
  20. How do you avoid blocking operations in Redis?
  21. How do you handle large datasets in Redis?
  22. How do you scale Redis read performance?
  23. Explain client-side caching in Redis.
  24. How do you monitor Redis latency?
  25. What are best practices for Redis performance tuning?

9. Redis Streams & Advanced Features (Modules)

  1. What are Redis Streams?
  2. How do you add data to a stream?
  3. Explain the XREAD command.
  4. How do consumer groups work in Streams?
  5. What is pending entries list (PEL)?
  6. How do you acknowledge stream messages?
  7. What is XREADGROUP command?
  8. How do you trim streams?
  9. How do Redis Streams differ from Pub/Sub?
  10. What are real-world use cases of Streams?
  11. What is RedisBloom?
  12. What is RedisGraph?
  13. How do you use RedisJSON?
  14. What is RedisTimeSeries?
  15. Explain RedisAI module.
  16. What are use cases of Redis modules?
  17. How do you load a custom Redis module?
  18. What is RediSearch and its use cases?
  19. How do you uninstall Redis modules?
  20. What are the advantages of Redis modules?
  21. How do you store vector data in Redis?
  22. What are CRDTs in Redis Enterprise?
  23. How does Redis support geospatial queries?
  24. What are best practices for using Redis modules?
  25. What is the future of Redis modules?

10. Redis in Cloud, Containers & Use Cases

  1. What is AWS ElastiCache for Redis?
  2. How does Azure Cache for Redis work?
  3. What is Google Cloud Memorystore?
  4. What are the advantages of managed Redis?
  5. How do you deploy Redis in Docker?
  6. What are StatefulSets in Kubernetes for Redis?
  7. How do you configure Redis Helm charts?
  8. How do you set up Redis persistent storage in Kubernetes?
  9. What is a Redis Operator?
  10. How do you scale Redis in Kubernetes?
  11. What is multi-AZ deployment in Redis?
  12. How do you configure Redis high availability in cloud?
  13. What is Redis Enterprise Cloud?
  14. What is active-active replication in Redis Enterprise?
  15. How does Redis handle multi-region deployments?
  16. What are common Redis cloud use cases?
  17. How does Redis pricing differ in cloud providers?
  18. How do you monitor Redis in cloud environments?
  19. How do you back up Redis in cloud?
  20. What is Redis Edge?
  21. How is Redis used for caching in microservices?
  22. How is Redis used for real-time analytics?
  23. How does Redis help in rate limiting?
  24. How is Redis used in leaderboards?
  25. What are common production challenges with Redis in cloud?