A New Take on Caching

Any application out there in the world, especially production level applications possess a huge amount of data. These are obviously stored in a secure location. But every time the application is in need of using these data, it has to access those storages. This practice arouses a few inconveniences when the data is required faster or frequently. Also, when reading data becomes an expensive operation, it is quite inconvenient for the application to function robustly. If you’re looking to overcome this inconvenience, caching is your solution.

Caching enables you to access your stored data much faster. The data which is stored in a cache can be from the direct data source or generated by processing the data in a request. Hence, in subsequent requests the application does not have to access the data source or reprocess the data. Instead, it can simply access the cache and serve the request smoothly and much faster.

Using caching as is, has a small problem with it. The cache will be available to use as long as the application is up and running. The moment the application restarts, the cache will be empty and you will lose the data which was previously in the cache. The solution for this is using a cache which can persist.

A persistent cache stores the data in the file system or the system memory. In a situation where the application stops or crashes, the data in the cache will not be lost. Instead, it will be stored in the file system or the system memory, waiting to be loaded back to the new cache created after the restarting of the application. This ensures that the application will pick up from the same state as it was before crashing/stopping.

Check out the linked white paper to get an understanding of a few of the existing solutions for persistent caches and some of their limitations.

Furthermore, the linked white paper introduces an approach that can be taken to solve the limitations that arise from existing solutions. It is noteworthy to mention that the introduced approach is a customization done due to certain stipulations. Check out the white paper to get to know what those stipulations are. If you have similar stipulations, the introduced approach is the perfect fit for you to implement a persistent cache.

The following are the different types of caches built using this customization.

  • Basic Persistent Cache
  • Persistent Cache with TTL (Time-to-Live)
  • Persistent Cache with Per Row TTL
  • Persistent Loading Cache


The white paper extensively discusses each of these types and other related documentation needed to get you started. Before that let’s have a look at the features of this customization.

  • Any object type can be used as the key or value without depending on the library specific wrapper objects.
  • Does not require external configuration files.
  • Can specify a common TTL or a per-row TTL.
  • Loading cache features with TTL.
  • TTL can be specified as any timeunit using Java 8’s ChronoUnit.
  • Features like batch storing of data and saving keys/values if they are absent.


To wrap up, here we have introduced a customization for a feature rich persistent caching which can be used when a caching mechanism is needed with persistence. To get a comprehensive understanding of this approach do check out the white paper linked below.

Read More >

Let us know what you think of this approach.
Happy coding!

Mariam Zaheer

Software Engineer

Choosing the Right Algorithm at the Right Time – The Science of Impactful Product Recommendations

With the evolution of technology, online retail shopping has come into action, playing a major role in the modern world. A personalized recommendation system aims at identifying products that are of most relevance to a user, based on their past interactions.

This enhances a user’s intention to browse more products and makes them more likely to buy these products, effectively increasing business revenue and user experience. Hence, it is of vital importance that the evaluation of recommendations in such a context provides an end user output based on criteria which is selected in a way that maximizes business revenue and user experience. This chosen ‘most optimal criteria’ may vary due to different user preferences, seasons, and many other factors. Therefore, selecting the most optimal criteria has to be done very thoroughly, for which an effective and efficient evaluation technique is essential.


Where Do You Stand?


In this fast-moving modern world, People tend to buy online due to their busy schedules and easement and any outdated organization that doesn’t support this will be left behind. In a post Covid-19 world, online retailing and e-commerce without a doubt will increase immensely, forcing almost every organization to use online retailing for survival. Recommendation systems play a very important role in this, helping out with revenue and user experience. All the leading retailers worldwide use modern recommendation systems. It is definite that online retailers that use primitive recommendation systems will not be competitive enough to survive among the others who already use standard recommendation systems.


Multi Armed Bandit

Evaluation of recommendations can be categorized into two: offline evaluation and online evaluation. An example for offline evaluation is the Multivariate Testing Method which allows exploration of the most optimal criteria within a specific period of time, but afterward serves recommendations using the winning criteria. Hence it only provides a single cycle of exploration to exploitation, and does not allow automated further exploration cycles. This leads to a requirement of manual intervention once the criteria pass its optimal performance. These limitations bring out the necessity of online evaluation that supports automated multiple exploration cycles, which leads us to Multi Armed Bandit. The Multi Armed Bandit problem is a concept where a fixed limited set of resources are to be allocated among competing choices in a manner that maximizes their expected gain.


Multi Armed Bandit In A Retail Context

The endless expansion of e-commerce has led retailers to advertise their products by displaying. This is done via recommendation after considering various factors. Recommendation systems are growing progressively in the field of online retail due to their capability in offering personalized experiences to unique users. They make it easier for users to access the content they are interested in, which results in a competitive advantage for the retailer. Hence it is necessary to have smart recommendation systems. Recommendation systems using Multi Armed Bandit are capable of continuous learning, that is continuously exploring winning criteria and exploiting them without manual intervention.


What We At Zone24x7 Do

We excel in offering smart recommendation systems. We are well experienced in coming up with recommendation systems that give out different results to the user each day by processing massive loads of data in the intelligent back-end. We have studied every possible way to do that and selected 3 effective algorithms to the MAB problem, which are in summary:

  • Epsilon Greedy Algorithms
  • Upper Confidence Bound Algorithms (UCB)
  • Thompson Sampling


We chose Thompson Sampling for the retail recommendation system and it has been one of the highest performing solutions due to less cumulative regret. It is also the highest cost-effective solution when it comes to implementation.

Multi Armed Bandit can be recognized as the core ideology of the online evaluation system and only a brief explanation about it is given here.

To read more on this:

Read More >

Mariam Zaheer

Software Engineer