Data Serialization Options
Built-in .NET types are serialized automatically into the cache and can be retrieved by Java servers and other Geode clients. For domain objects that are not simple types, you have three Geode serialization options.
The options give good performance and flexibility for data storage, transfers, and language types. The Geode options can also improve performance in serializing and deserializing built-in types.
The simplest option is to use perform automatic serialization by registering the Geode .NET PDX reflection-based autoserializer in your application. When you have this registered, Geode uses it for all domain objects that are not custom serialized.
You can also custom serialize your objects by implementing one of the Geode .NET interfaces,
You also have the option of using default .NET serialization, but you cannot use it unless you also use helper classes. The helper classes you must use are
Geode .NET PDX serialization has more bytes in overhead than Geode .NET Data serialization, but using PDX serialization helps you avoid the performance costs of deserialization when performing queries. Applications can use
PdxInstances in functions to avoid the deserialization of entire objects.
|Capability||IGFSerializable||IPdxSerializable and PDX reflection-based autoserializer|
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 Geode - no need to program Java-side implementation
Works with Geode delta propagation
|X||X (See explanation below.)|
*You can mix domain object versions where the differences between versions are the addition and removal of object fields.
By default, you can use Geode delta propagation with PDX serialization. However, delta propagation will not work if you have set the Geode property read-serialized to “true”. In terms of deserialization, to apply a change delta propagation requires a domain class instance and the
fromDelta method. If you have set read-serialized to true, you will receive an
IPdxInstance instead of a domain class instance and
IPdxInstance does not have the
fromDelta method required for delta propagation. You will also require the Java domain class on the server similar to the you would need the .NET PDX Delta domain class.
For detailed information on the interfaces, see the API documentation at http://gemfire-apis.docs.pivotal.io.