By Sriram Mannava
In this article, we'll see how we can implement write-through and write-behind caching strategies using NCache step by step.
Caching is the idea of persisting a frequently read item in a nearby place to pick it up faster than to fetch it only when required. While designing an application or a system, caching is an important technique to be applied, because of the added advantage of speed and skipping unwanted wait times.
When you are trying to fetch when it is actually required, you are waiting the system. It is also a way of cost optimizing, because you will reduce your storage hits and in some cases the less the storage hits the less you are charged (e.g Cloud). A cache is generally a high-speed memory which is present closest to the system that uses it.
When an item is present in the cache, we call it a "Hit" and the retrieval is faster – you’ll just pull it out of the memory and use it. If it is not present, we call it a "Miss" and you’ll need to fetch data from your storage (or from a service) and place it in the cache. This potentially reduces turn-around times for requests.Read full Article