Data Serialization Options

Data Serialization Options

The native client C++ API gives you two serialization options: the GemFire::Serializable interface and GemFire PDX serialization.

GemFire Portable Data eXchange (PDX) serialization is the recommended option. GemFire PDX serialization provides portability for PDX serializable objects so that clients can share data with Java servers and other non-C++ clients. PDX is a cross-language data format that can reduce the cost of distributing and serializing your objects. PDX stores data in named fields that you can access individually in order to avoid the cost of deserializing the entire data object. PDX also allows you to mix versions of objects where you have added or removed fields.

When using PDX serialization, you can either use the PdxSerializer (for all your domain objects) or PdxSerializable (for a specific domain object).

PdxSerializer is used when a user has registered his or her domain class for serialization in the cache using the registerPdxSerializer API.

PdxSerializable is used when the domain class that a user wants to serialize/deserialize is inherited from PdxSerializable interface, and the user has registered domain class using registerPdxType(domainClass) API.

The non-PDX serialization option is to use the GemFire::Serializable interface. The GemFire::Serializable interface can be a good option performance-wise if the size of your objects is small. The GemFire::Serializable is used whenever a user domain class is not inherited by PdxSerializable but the user has registered his or her class with the registerType API. (See Serializing Data with the GemFire Serializable Interface for more information.)

Table 1. Serialization Options: Comparison of Features
Capability GemFire::Serializable GemFire::PdxSerializable

Handles multiple versions of domain objects*


Provides single field access on servers of serialized data, without full deserialization. Supported also for OQL queries.


Automatically ported to other languages by GemFire - no need to program Java-side implementation


Works with GemFire delta propagation

X X (See Using PDX Serialization with Delta Propagation for requirements.)

*You can mix domain object versions where the differences between versions are the addition and removal of object fields.

For detailed information on the interfaces, see the online API documentation.