Data Serialization Options
The C++ client API gives two serialization options: the
apache::geode::client::Serializable interface and GemFire PDX serialization.
GemFire Portable Data eXchange (PDX) serialization is the recommended option. 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 use either
PdxSerializer (for all your domain objects) or
PdxSerializable (for a specific domain object).
PdxSerializer is used when a user has registered a domain class for serialization in the cache using the
PdxSerializable is used when the domain class that a user wants to serialize/deserialize is inherited from the
PdxSerializable interface, and the user has registered the domain class using the
The non-PDX serialization option is to use the
apache::geode::client::Serializable interface. This
Serializable interface can be a good option performance-wise if the size of your objects is small.
Serializable is used whenever a user domain class is not inherited by
PdxSerializable, but the user has registered the class with the
registerType API. See Serializing Data with the Serializable Interface for more information.
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
Table 1. Serialization Options—Comparison of Features
* You can mix domain object versions where the differences between versions are the addition and removal of object fields.
** See Using PDX Serialization with Delta Propagation for requirements.