GlassFish to Payara Server Migration: Hazelcast as a Coherence ActiveCache Alternative
Published on 20 Jan 2017by Fabio Turizo
In our continuing series on alternatives for commercial Oracle GlassFish features , in this article we are looking at Hazelcast - a replacement for Oracle's Coherence ActiveCache.
What is it?
By default, Oracle GlassFish Server uses in-memory HTTP session state replication for high availability clusters, courtesy of Project Shoal. In more complex deployment scenarios where scalability, reliability and performance requirements are more intense, this session replication mechanism might not be enough. Oracle GlassFish can integrate with Oracle Coherence (a proprietary in-memory data grid caching solution) as a replacement for the in-memory HTTP state replication provided by Shoal. This eases the burden on the server by offloading session caching to a separate layer, enables session caching algorithms and simplifies business logic. Oracle Coherence can also be used to cache application data in addition to HTTP session storage.
How can it be replaced?
This feature replacement is quite easy to implement with Payara Server, thanks to Hazelcast. Hazelcast is a data grid with distributed caching capabilities similar to Oracle Coherence and it is included by default with Payara Server.
With Oracle GlassFish Server, you had to purchase a separate license for Oracle Coherence, install the product and configure the integration of the server with Coherence per deployed application; meanwhile Payara Server comes with sensible defaults out-of-the-box; you don’t need to take extra steps to install or configure Hazelcast apart from the default values provided.
Using Hazelcast to store HTTP session data in stead of the standard shoal-based mechanism is simple: configure the persistence type of the cluster in the cluster-config → Availability Service → Web Container Availability section and set the
Persistence Type element to
Keep in mind that Hazelcast must be enabled first in the cluster’s configuration for this feature to work. If you want to know more about Hazelcast’s configuration and other features, we encourage you to read the official documentation.
You can also use Hazelcast to store session state for Stateful EJB components and use it with JCache to store your own application data. This feature is over-and-above what was available in Oracle GlassFish Server so, in this regard, the available feature set is even bigger with Payara Server!
If you are using a cluster or Oracle Coherence instances to work with high replication demands over a WAN (or even the cloud), you can consider switching to Payara Scales. This is a licensed edition of Payara Server that comes integrated with the Hazelcast Enterprise High Density Memory Store. This product helps not only storing session data across a WAN but also provides disaster recovery for unhealthy nodes as well.
That's all for this part - the fourth blog from the 'alternatives for commercial Oracle GlassFish features' series will be coming soon so watch this space! Meanwhile, you can have a look here for the other posts from this series; and if you're considering GlassFish to Payara Server migration, make sure to check out our Migration Guide.