Caching Flashcards
What is a Cache?
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.
Where Cache resides?
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.
What are different types of cache?
- Application Server Cache
- Distributed Cache
- Global Cache
- Content Distribution Network (CDN)
What is Cache Invalidation?
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
What are different types of cache invalidation?
- Write through Cache
- Write Around Cache
- Write Back Cache
What are different Cache eviction policy?
- First In First Out (FIFO)
- Last In First Out (LIFO)
- Least Recently Used (LRU)
- Most Recently Used (MRU)
- Least Frequently Used (LFU)
- Random Replacement (RR)