Databases Reference
In-Depth Information
Terracotta internally uses the Ehcache framework for caching. Hence, we replaced
the Ehcache-related JAR files from the Terracotta installation. We then created the
cache manager configuration file for the Hibernate cache manager and multi-VM
cache manager. These XML files look similar to the Ehcache configuration files.
In addition to the cache bucket configuration, we also provided Terracotta server
details in the file. Within every cache bucket entry, we added the terracotta tag
to inform the cache manager to store cached objects in the Terracotta server.
In the Terracotta configuration files, we configured only one cache bucket. For all
other buckets, it will use cache control attributes of the defaultCache element.
It is recommended to configure all the important cache buckets by adding cache
entry in these configuration files. As it uses the same Ehcache XML schema, we can
optimize each cache bucket by providing the same cache control attributes that we
learned about in the previous section. Unlike Ehcache-based cache implementation,
Terracotta provides a GUI-based tool called Developer Console for monitoring and
diagnosis. This tool is useful to monitor cache buckets during the load test.
We used Terracotta only for caching resources but it also provides a way to store
HTTP sessions and Quartz jobs in it. It is recommended to configure Liferay Portal
to store HTTP sessions and Quartz jobs on Terracotta if we are using Terracotta for
caching. This will reduce the overhead of replication.
Summary
In this chapter, we learned the best caching practices of Liferay Portal. We learned
how to configure the default Ehcache-based caching mechanism to achieve better
performance. We learned the different types of caches in Liferay Portal. We
also learned about advance caching implementation using Terracotta. With this
knowledge, we can improve the performance of our Liferay Portal-based solution
by optimizing the caching mechanism.
So far we learned the architectural best practices, load balancing, and clustering
best practices, configuration best practices, and caching best practices.
Now it's time to gear up for development best practices.
 
Search WWH ::




Custom Search