A method and system for fragment-based serialization places one or more
object members in fragments. Fragments may comprise a header and a
payload. A header can provide useful information about the fragment, such
as an indication of fragment type and an indication of fragment length. A
payload may comprise one or more members of an object. Primitive members
may be stored in a Binary Fragment with a record format payload. LOB and
FS members may be stored in fragments that have a Value Type field for
setting forth additional properties of the fragment. Collections may be
stored in a series of fragments, a first fragment to indicate a start of
a collection, one or more second fragments to serialize collection
elements, and a Terminator Fragment to indicate the end of a collection.
Fragment-serialized objects minimize storage overhead while providing
fast instantiation and low-cost location and updating.