Caching is one of the most important technique to improve performance of any solution. By default Liferay portal implements caching using EHCache framework. When we implement clustered deployment of Liferay portal solution, we need to make sure we synchronize caches across all the nodes. Cache synchronization is a very common issue to deal with any scalable solution. Essentially there are two types of options to solve the issue.
- Using Cache Replication
- Using Distributed Cache
EHCache provides different way of implementing cache replication. Also Liferay supports cache replication using Cluster Link. But if we need highly scalable solution where in we are planning to keep lot of data in cache then distributed cache is better option. In distributed cache individual node keeps only required data in cache. Centralized cache server keeps consolidated cache of all the nodes. Terracotta provides EHCache based distributed cache. In this blog I will provide how to configure Liferay to use Terracotta based distributed cache instead of EHCache based replicated cache.