Monday, August 16, 2004

VJs Tip Of The Day - August 16th 2004

Design Days: Caching and Performance

Usually we assume that Caching is done to improve performance, well it is true but at the same time it may deteriorate the performance as well... It many a times depends on the Cache Hit Ratio... And you should definitely consider your Cache Hit Ratio [CHR] before considering your caching strategy...
To make it more clear consider a scenario in which you cache the state list of a country... Now if user has to select one of the available states then there are bright chances that your cache hit is a success.... It might be a good idea to cache the list instead of retrieving it from the data source all the time...
Now consider that you cache product list for a store like Walmart... You might have millions of product in the database and it is very unlikely that the product selection will lie in the correct category and type... There are more likely chances of miss than of hit, but you will lose time in searching the cache, so here is when you should consider hitting the data source instead of caching...
Now there are options other than caching and there might be other factors governing the decisions, this is just a design suggestion...

PS: 15th August was India's Independence Day... Please accept my belated wishes for a Happy Independence Day... Jai Hind... (Hail India!!)

No comments: