Caching Flashcards

1
Q

T/F: Caching is important in that it helps reduce expensive reads from disk

A

True

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

What is a caching layer, and where does it sit in your application pipeline?

A

It’s typically another fleet of servers that sit in front of your database to store and return common transactions

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

T/F: Cache servers store data in-memory, increasing speed

A

True

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

T/F: Caching layers are most beneficial for applications with more writes than reads

A

False, caching stores data to be quickly read, so read-centric apps benefit more

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

What is the cold-start problem when using a cache layer?

A

If your caching layer goes down and loses its data, it takes time for it to spin back up and regain cached info. Due to the lack of data in the cache, the caching layer would make a ton of expensive read/writes and could crash your DB. Because of this, you need to build into your architecture mitigation strategies, like priming the caching layer with the latest data from your DB before putting it online.

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

T/F: An expiration policy with caching determines how long data is cached

A

True

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

How does the LRU caching eviction policy work?

A

It evicts the ‘least recently used’ data from the cache when the cache is full

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

How does the LFU caching eviction policy work?

A

It evicts the ‘least frequently used’ data from the cache when the cache is full.

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

How does the FIFO caching eviction policy work?

A

It evicts the oldest element in the queue, regardless of frequency or recency

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

What is memcached?

A

It’s an in-memory key-value caching layer solution that’s open-source and super simple

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

What is redis?

A

A caching layer solution that’s much more comprehensive than memcached

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