In most enterprise applications, data that has been accessed once is used again and again. This could be in different requests, or could be because the requests are operating on the same set of data.
In these kinds of scenarios, it would be a huge waste of resources if we tried to access the same data again and again from the database, causing the application to make a lot of queries to the database, resulting in high database loads and poor response times.
The ORM layers we use provide some degree of caching to already accessed data, but still, most of the control resides in the hands of the application developer, who can use his wisdom to make the application performant by analyzing which data will be used again and again, and providing mechanisms for caching it.
Let's take a look at some the caching techniques and see how they can help us to make our...