Redis Flashcards

(8 cards)

1
Q

reason you might not want to use Redis

A

durability. While there are some reasonable strategies for (using Redis’ Append-Only File AOF) to minimize data loss, you don’t get the same guarantees you might get from e.g. a relational database about commits being written to disk. This is an intentional tradeoff made by the Redis team in favor of speed, but alternative implementations (e.g. AWS’ MemoryDB) will compromise a bit on speed to give you disk-based durability.

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

what is redis

A

self-described “data structure store” written in C. It’s in-memory 🫢 and single threaded 😱 making it very fast

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

core structure

A

key-value store. Keys are strings while values which can be any of the data structures supported by Redis: binary data and strings, sets, lists, hashes, sorted sets, etc. All objects in Redis have a key.

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

eviction policy

A

time to live (TTL) on each key. Redis guarantees you’ll never read the value of a key after the TTL has expired and the TTL is used to decide which items to evict from the server - keeping the cache size manageable even in the case where you’re trying to cache more items than memory allows.

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

can be used as

A

Rate Limiting, Leaderboards Distributed Lock, Cache, Proximity Search, Event Sourcing, Pub/Sub

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

issue

A

“hot key” issue

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

hot key issue

A

our load is not evenly distributed across the keys in our Redis cluster

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

technique to scale

A

redis cluster

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