Caching Flashcards

1
Q

What is a Cache?

A

A cache is like short-term memory: it has a limited amount of space, but is typically faster than the original data source and contains the most recently accessed items.

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

Where Cache resides?

A

They are used in almost every layer of computing: hardware, operating systems, web browsers, web applications and more. Caches can exist at all levels in architecture but are often found at the level nearest to the front end, where they are implemented to return data quickly without taxing downstream levels.

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

What are different types of cache?

A
  1. Application Server Cache
  2. Distributed Cache
  3. Global Cache
  4. Content Distribution Network (CDN)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is Cache Invalidation?

A

While caching is fantastic, it does require some maintenance for keeping cache coherent with the source of truth (e.g., database). If the data is modified in the database, it should be invalidated in the cache, if not, this can cause inconsistent application behavior.
Solving this problem is known as cache invalidation

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

What are different types of cache invalidation?

A
  1. Write through Cache
  2. Write Around Cache
  3. Write Back Cache
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are different Cache eviction policy?

A
  1. First In First Out (FIFO)
  2. Last In First Out (LIFO)
  3. Least Recently Used (LRU)
  4. Most Recently Used (MRU)
  5. Least Frequently Used (LFU)
  6. Random Replacement (RR)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly