Alachisoft NCache 4.1 - Online Documentation

Dynamic Compact Serialization

Its a process of producing a compact form of serialized object for performance improvement which results in faster network trips. As name illustrates, compact serialized file is compact in form of data and process. The idea behind compact serialization is that every 'known type' (a known type is a type that is registered with the framework) is assigned a unique 2-byte type handle by the framework, which lets the deserializer uniquely identify the 'known types'.
For example, suppose framework assigns a handle 0 to System.Int32. Then serializer writes a 2-byte handle followed by 4 bytes of object value to the stream. Deserializer reads the handle, figures out the object type and then creates and populates the object with its value. On the other hand the native serialization writes the complete type information with object data. NCache overcomes the issues of native serialization in the following ways:
  • Here serialized object does not contain the complete type information and assemblies. It only contains an object value and a unique 2-byte handle. This unique 2-byte handle is used as a reference to uniquely identify type details while deserializing an object. In this way the size of the object reduces.
  • Compact serialization also avoids the reflection which also reduces the overhead.
  • The above two features reduces the IO operations.
  • As the object size decreases, it will automatically make faster network trips and eventually the cost will also decrease.
  • Small object size and fast network traffic increases the application performance.
For using Compact Serialization, you are supposed to define a default public constructor (parameter less) in a compact serializable type and register that type with NCache Manager.
  • Custom generic types are not supported in java although they are supported in .Net.
  • An object registered in Data Sharing can’t be registered in Compact Serialization at the same time.
In This Section
Explains how you can register compact types with NCache.
See Also
Helps you configure Clustered Cache.
Copyright © 2005-2012 Alachisoft. All rights reserved.