architect-handbook

Software Architect Handbook

View on GitHub

Serialized LOB

Savesd a graph of objects by serializing them into a single Large Object (LOB), whicvh it stores in a database field.

Overview

Object models oftan contain complicated graphs of small objects which are not easy to put into a relational schema. Manipulating such a relational schema could require many joins, which are both slow and awkward.

You can use serialization, where a whole graph of objects is written out as a single Large Object (LOB) in a table. This Serialized LOB then becomes a form of Memento.

How It Works

When to Use It

This pattern works best when you can chop out a piece of the object model and use it to represent the LOB.

Think of a LOB as a way to take a bunch of objects that aren’t likely to be queried from any SQL route outside the application. This graph can then be hooked into the SQL schema.

Serialized LOB works poolry when you have objects outside the LOB reference objects buried in it.