Introduction to caching
There are multiple ways to improve the performance of an application and caching is one of the key techniques used in enterprise applications. A cache is like a temporary data store with a limited size and limited data but has much faster data access compared to the original data source and usually holds only a subset of and the most frequently used data. A cache store could be as simple as the RAM of the computer that is used by the process during execution, or it could be something such as Redis, which uses both memory and disks to store data. The key thing here is that it is usually on hardware that has a lower access time compared to the original storage layer.
Caching can be implemented at every layer in the architecture so that data can be retrieved from the layer closest to the user. For example, in any web application, the moment a URL is typed in the browser and we press Enter, it goes through various web components that are involved in loading the...