You are here: Advanced Features > Type Handling > Blobs

Blobs

In some cases user has to deal with large binary objects (BLOBs) such as images, video, music, which should be stored in a structured way, and retrieved/queried easily. There are several challenges associated with this task:

db4o provides you with a flexibility of using 2 different solutions for this case:

  1. The db4o blob-type.
  2. Byte[] arrays stored inside the database file

These two solutions' main features in comparison are represented below:

Blob

  1. Every Blob gets it's own file.
  2. Special code is necessary to store and load .
  3. No concerns about activation depth.

byte[] array

  1. Data in the same file
  2. Transparent handling without special concerns.
  3. Control over activation depth may be necessary

Storing data in a byte[] array works just as storing usual objects, but this method is not always applicable/desirable. First of all, the size of the db4o file can grow over the limit (256 GB) due to the BLOB data added. Secondly, object activation and client/server transferring logic can be an additional load for your application.