Hazelcast needs to serialize the Java objects that you put into Hazelcast because Hazelcast is a distributed system. The data and its replicas are stored in different partitions on multiple cluster members. The data you need may not be present on the local member, and in that case, Hazelcast retrieves that data from another member. This requires serialization.
Hazelcast serializes all your objects into an instance of com.hazelcast.nio.serialization.Data
. Data
is the binary representation of an object.
Serialization is used when:
Hazelcast optimizes the serialization for the basic types and their array types. You cannot override this behavior.
Default Types;
java.util.Date
, java.math.BigInteger
, java.math.BigDecimal
, java.lang.Class
, java.lang.Enum
Hazelcast optimizes all of the above object types. You do not need to worry about their (de)serializations.