Skip to main content

Hazelcast

Hazelcast is an in-memory data grid used for clustering and is a highly scalable data distribution solution. Hazelcast assists in real-time low latency conditions and with distributed memory for data and computations. You can accelerate transactions by using the distributed in-memory storage feature of Hazelcast. Hazelcast also improves the performance of internode communication through messaging.

Applications are deployed across several servers in a cluster and communicate with a single relational database in the application architecture, as shown in the following figure: 

 

Application architecture nodes in a cluster.

Using the cache embedded in each node can help avoid repeated or multiple database hits. If the data is already in the cache, the system skips the request to the database and uses the data from the cache. If the data is not in the cache, the system initiates a request to the database and uses the fetched data. 
 
The following figure shows how, for improved application performance, the system stores data that does not change frequently in the cache of each node: 

Cache embedded in a node

 

With this approach, there can be a cache consistency issue whenever an application deployed on app server1 updates the data. The data in cache1 and the database are consistent, but cache2, cache3, and cache4 do not have the updated data. 
 
You can solve the inconsistency problem by using an in-memory data grid. A data grid is a collection of servers that operate together in a distributed environment to manage data and related tasks. An in-memory data grid (IMDG) stores data entirely in RAM using key-value pairs. 
 
Many enterprises that previously avoided adopting in-memory technology due to memory card costs are now changing their systems' architecture to take advantage of the low-latency transaction processing of in-memory technology. With the significant decrease in RAM prices, loading the entire operational data set into memory is now more cost-effective, which results in improved performance.

The following products are some of the more popular IMDG implementations:

  • Hazelcast
  • Infinispan
  • Red Hat JBoss Data Grid
  • Ncache

Hazelcast and in-memory computing

Hazelcast is for environments where the power of in-memory computing can help accelerate applications requiring low latency, high throughput, horizontal scaling, and security. Hazelcast can run embedded in every node and also supports a client-server topology.

Pega Platform™ low-level features, such as agents, Job Scheduler, and REST service Rules, use Hazelcast to cache or store data.

Hazelcast IMDG is an ideal choice for services running on a cloud platform, for example, Kubernetes, where service replicas can quickly scale up and down.

Pega Platform deployments with Hazelcast can use two modes: embedded or client-server. Pega Infinity'23 supports client-server mode of deployment only. Legacy deployments still support embedded deployment. 

Externalization of Hazelcast in your deployment

To improve the performance of your Pega Platform deployment, use Hazelcast as an external data grid. You can externalize Hazelcast by configuring the prconfig.xml file and the context.xml file. 

Pega has licensed the use of Hazelcast, which means that you do not need a separate Hazelcast license for your organization. The Clustering Service runs a Hazelcast cluster configuration that is specific to Pega Platform. To deploy the service, you use a Pega-provided Docker image in combination with Pega-provided Helm charts

The following process outlines how to externalize Hazelcast in your deployment:

Step 1: Configure the prconfig.xml file

To configure the prconfig.xml file, add the following settings: 

<env name="hazelcast/operationmode" value="external" />
<env name="hazelcast/external/members" value="host:port,host:port" />

Replace the host and port with the appropriate values for your Hazelcast cluster. 
 
Step 2: Configure the context.xml file

To configure the context.xml file, add the following resource: 

<Resource name="hazelcast/external" auth="Container" type="com.hazelcast.core.HazelcastInstance" factory="com.pega.platform.hazelcast.session.HazelcastFactory" config-location="path_to_your_hazelcast_configuration" />

 Replace path_to_your_hazelcast_configuration with the path to your Hazelcast configuration file. 
 
For more information about configuring Hazelcast, see Deploying external Hazelcast on Kubernetes.
 
By externalizing Hazelcast in your Pega Platform deployment, you can improve the performance of your application. 

Check your knowledge with the following interaction:


This Topic is available in the following Module:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice