Alachisoft NCache 4.1 - Online Documentation

Dynamic Compact Serialization

 
NOTE: This feature is not available in NCache Express and Professional edition.
 
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 the compact serialization is that every 'known type' (a known type is a type that is registered with the framework) is assigned a unique 2-bytes type handle by the framework, which lets the deserializer uniquely identify the 'known types'.
For example, suppose the framework assign a handle 0 to System.Int32. Then the serializer writes the 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 other hand the native serialization writes the complete type information with object data. NCache Sophisticatedly over comes these issues of native sterilization in the following ways:
 
  • Here serialized object does not contain 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 the 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 faster the network trips and eventually the cost decreases.
  • Small object size and fast network traffic increases the application performance.
 
For using Compact Serialization, you need to define a default public constructor (parameter less) in a compact serializable type and register that type with NCache Manager. NCache now supports Custom Generic Types. All generic types with any number of arguments can be serialized through compact serialization. If a client doesn't want to add generic types and its parameters though UI, then he has the option to add them through IGenericTypes class.
 
Note:
 
  • 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.