Persisting Data on Disk
Persistence allows individual members and whole clusters to recover data by persisting map entries, JCache data, and streaming job snapshots on disk. Members can use persisted data to recover from a planned shutdown (including rolling upgrades), a sudden cluster-wide crash, or a single member failure.
Why Persist Data
Data in Hazelcast is usually stored in-memory (RAM) so that it’s faster to access. However, data in RAM is volatile, meaning that when one or more members shut down, their data is lost. When you persist data on disk, members can load it upon a restart and continue to operate as usual.
Clusters can use persisted data to recover from the following scenarios:
-
Cluster-wide shutdown:
-
Planned: A whole cluster is shut down and restarted with the same configuration, state, and data as before the restart. A planned shutdown includes rolling restarts, where the cluster is restarted member by member for scenarios such as installing an operating system patch or new hardware. Rolling upgrades are an example of a rolling restart.
-
Unplanned: A cluster is restarted after all its members crashed at the same time due an event such as a power outage.
-
-
A single member restart: A single member is restarted for whatever reason.
Supported Features
You can persist the contents of map or JCache data structures as well as any streaming job snapshots.
Limitations
-
Cluster crashes: When a whole cluster crashes while repartitioning, currently it is not possible to restore persisted data.
-
Map naming conventions: You cannot persist a map if its name contains either of the following. Otherwise, Hazelcast throws an exception.
-
255+ characters
-
Special characters (
*
):
"'
|<
,
>?
/
-
-
SQL metadata: When a cluster restarts, it does not currently retain any SQL mappings or views that you have created.