Databases Reference
In-Depth Information
Caching using Terracotta
In the previous section, we talked about Liferay Ehcache integration. In order to
use Ehcache in a distributed environment, we need to replicate the cache across the
cluster. Another approach is to use the centralized caching server. All nodes connect
to the centralized cache server and store/retrieve cached objects. In this approach,
we do not need to worry about cache replication. Terracotta is one of the leading
products which provides this solution. Liferay Portal supports integration with
Terracotta. If a portal is intended to have a large amount of cache objects and a large
number of cache changes, it is recommended to go with this approach. Terracotta
also provides solutions for storing web sessions and quartz jobs. By using Terracotta,
we can even prevent session replication and replication of quartz job data. The
following diagram explains how Terracotta fits into the Liferay Portal architecture:
Liferay Portal
Server 1
Liferay Portal
Server 2
Terracotta
Server
Liferay Portal
Server 3
Liferay Portal
Server 4
As shown in the preceding diagram when we use Terracotta, we will not need any
communication between individual Liferay Portal application nodes. Each node will
directly communicate with Terracotta and store/retrieve cached objects, sessions,
and quartz data. It is recommended to use this architectural approach if the portal
is going to have huge cache objects. This approach gives the best performance by
omitting replication overhead.
 
Search WWH ::




Custom Search