Redis Flashcards
What is Redis self-described as?
A data structure store
Redis is designed to handle various data types and structures efficiently.
What programming language is Redis written in?
C
What is the primary reason for avoiding Redis if durability is needed?
Redis does not provide the same durability guarantees as relational databases.
What are some fundamental data structures supported by Redis? List them.
- Strings
- Hashes (Objects)
- Lists
- Sets
- Sorted Sets (Priority Queues)
- Bloom Filters
- Geospatial Indexes
- Time Series
What communication patterns does Redis support?
- Pub/Sub
- Streams
What is the core structure underneath Redis?
A key-value store
What is the main advantage of Redis’ wire protocol?
It is comprised of simple strings for all functionality.
How does Redis handle infrastructure configurations?
Redis can run as a single node, with a high availability (HA) replica, or as a cluster.
What is the purpose of hash slots in Redis clusters?
They map keys to a specific node.
True or False: Redis clusters automatically solve scalability problems.
False
What is the typical write throughput Redis can handle?
O(100k) writes per second
What is the most common deployment scenario of Redis?
As a cache
What does TTL stand for in the context of Redis caching?
Time to Live
What is a common use of Redis as a distributed lock?
To maintain consistency during updates.
What algorithm can be used for more sophisticated locks in Redis?
Redlock
How can Redis be utilized for leaderboards?
Using sorted sets to maintain ordered data.
What command would you use to set a key in Redis?
SET
What command would you use to add an item to a Redis sorted set?
ZADD
What command is used to add members to a geospatial index in Redis?
GEOADD
What is a fixed-window rate limiter?
An algorithm that guarantees the number of requests does not exceed N over a fixed window of time W.
What type of data structure is used for event sourcing in Redis?
Streams
What is the hot key issue in Redis?
Uneven load distribution across keys leading to server overload.
List potential solutions for hot key issues.
- Add in-memory cache in clients
- Store the same data in multiple keys
- Add read replica instances
What is the main benefit of Redis being an in-memory data store?
It allows for very fast read and write operations.
Fill in the blank: Redis is a _______ data structure server.
versatile