Caching is a common technique that aims to improve the performance and scalability of a system.
The key to using a cache effectively lies in determining the most appropriate data to cache, and caching it at the appropriate time.
If you need to cache more information than is physically possible in memory, you can write cached data to the local file system.
This will be slower to access than data that's held in-memory, but should still be faster and more reliable than retrieving data across a network.
If this data is not static, it is likely that different application instances hold different versions of the data in their caches.
Therefore, the same query performed by these instances can return different results, as shown in Figure 1.