Migrating an Embedded Application to Cloud

To migrate an existing application from embedded Hazelcast, you need to refactor your code as well as consider how you migrate any existing data to the cloud.

For the benefits of migrating your application from an embedded topology to a client-server topology, see this blog.

Refactoring Code for the Cloud

Applications in Cloud are split into two parts:

  • The cluster that runs on the Hazelcast Cloud.

  • The client that calls APIs on cluster.

A Hazelcast client application communicating with a Cloud cluster

To separate your embedded application into these two parts, see the following checklist:

  • Deploy cluster-side modules to Cloud. If you use classes such as MapStore or an entry processor, or if you store custom objects in Hazelcast, you need to add those classes to the classpath of the cluster by deploying them as cluster-side modules.

  • Copy any data structure configuration over to Cloud. Data structures are configured in the Hazelcast Cloud console.

    Heap memory limits

    Cloud Standard clusters have the following heap memory limits:

    • Production clusters: 1 GB memory per cluster member

    • Development clusters: 300 MB per cluster

    Exceeding these limits can lead to cluster failure.

    Be aware that the following operations use heap memory: writing, caching, or replicating data to data structures other than IMap an JCache.

    For further information on Cloud Standard clusters and their limits, see Cloud Standard Clusters.

  • Remove member configuration from your code. Hazelcast configures the cluster for the best possible performance. All you need to do is configure the client and any data structures.

  • If you use the executor service, make sure that you are using the 'default' service in both uploaded executor services and client code. You cannot access named executor services in Cloud.

  • Replace any instance of HazelcastInstance newHazelcastInstance with a client. newHazelcastInstance creates an instance of a Hazelcast member. Instead, you need to configure a client to connect to the cluster.

Migrating Stateful Data

If you have existing data stored in Hazelcast, consider using one of the available APIs/tools to re-ingest data.