All data that Geode moves out of the local cache must be serializable.
Certain region types (including client regions) require serialization.
The native client C++ API gives you two serialization options: the
GemFire::Serializableinterface and GemFire PDX serialization.
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 to avoid the cost of deserializing the entire data object. When you use PDX serialization with the native client C++ API, you can register a PdxSerializer for the entire cache, implement PDX serialization for each domain object or use automatic PDX serialization by running the
The native client C++ API provides a
Serializableinterface that you can use for fast and compact data serialization. This section discusses the Geode serializable interface, and presents implementation examples.
If you have a graph of objects where each node can be serializable, the parent node can call
DataOutput::writeObjectto delegate the serialization responsibility to its child nodes. Similarly, your application can call
DataInput::readObjectto deserialize the object graph.
If you have data that is best handled as a blob, such as structs that do not contain pointers, use the serializable type
CacheableBytesis a blob class that implements the serialization for you.