Redis Flashcards

1
Q

What is Redis self-described as?

A

A data structure store

Redis is designed to handle various data types and structures efficiently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What programming language is Redis written in?

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the primary reason for avoiding Redis if durability is needed?

A

Redis does not provide the same durability guarantees as relational databases.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are some fundamental data structures supported by Redis? List them.

A
  • Strings
  • Hashes (Objects)
  • Lists
  • Sets
  • Sorted Sets (Priority Queues)
  • Bloom Filters
  • Geospatial Indexes
  • Time Series
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What communication patterns does Redis support?

A
  • Pub/Sub
  • Streams
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the core structure underneath Redis?

A

A key-value store

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the main advantage of Redis’ wire protocol?

A

It is comprised of simple strings for all functionality.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does Redis handle infrastructure configurations?

A

Redis can run as a single node, with a high availability (HA) replica, or as a cluster.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the purpose of hash slots in Redis clusters?

A

They map keys to a specific node.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

True or False: Redis clusters automatically solve scalability problems.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the typical write throughput Redis can handle?

A

O(100k) writes per second

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the most common deployment scenario of Redis?

A

As a cache

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does TTL stand for in the context of Redis caching?

A

Time to Live

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a common use of Redis as a distributed lock?

A

To maintain consistency during updates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What algorithm can be used for more sophisticated locks in Redis?

A

Redlock

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How can Redis be utilized for leaderboards?

A

Using sorted sets to maintain ordered data.

17
Q

What command would you use to set a key in Redis?

18
Q

What command would you use to add an item to a Redis sorted set?

19
Q

What command is used to add members to a geospatial index in Redis?

20
Q

What is a fixed-window rate limiter?

A

An algorithm that guarantees the number of requests does not exceed N over a fixed window of time W.

21
Q

What type of data structure is used for event sourcing in Redis?

22
Q

What is the hot key issue in Redis?

A

Uneven load distribution across keys leading to server overload.

23
Q

List potential solutions for hot key issues.

A
  • Add in-memory cache in clients
  • Store the same data in multiple keys
  • Add read replica instances
24
Q

What is the main benefit of Redis being an in-memory data store?

A

It allows for very fast read and write operations.

25
Q

Fill in the blank: Redis is a _______ data structure server.