Table of Contents
Oracle NoSQL Database provides an interface you can use to read and write Large Objects (LOBs) such as audio and video files. As a general rule, any object greater than 1 MB is a good candidate for representation as a LOB. The LOB API permits access to large values, without having to materialize the value in its entirety by providing streaming APIs for reading and writing these objects.
A LOB is stored as a sequence of chunks whose sizes are optimized for the underlying storage system. The chunks constituting a LOB may not all be the same size. Individual chunk sizes are chosen automatically by the system based upon its knowledge of the underlying storage architecture and hardware. Splitting a LOB into chunks permits low latency operations across mixed work loads with values of varying sizes. The stream based APIs serve to insulate the application from the actual representation of the LOB in the underlying storage system.
Keys associated with LOBs must have a trailing suffix string at the
end of their final key component. By default, this suffix is
.lob
, but this may be defined using
KVStoreConfig.setLOBSuffix()
.
For example, a LOB key used for an image file might be:
/Records/People/-/Smith/Sam/Image.lob
Note that all of the LOB APIS verify that the key used to
access LOBs meets this trailing suffix requirement. They throw
an IllegalArgumentException
if the
verification fails. This requirement permits non-LOB methods
to check for inadvertent modifications to LOB objects.
This is a summary of LOB-related key checks performed across all methods (LOB and non-LOB):
All non-LOB write operations check for the absence of the
LOB suffix as part of the other key validity checks. If the
check fails it will result in an
IllegalArgumentException
.
All non-LOB read operations return the associated opaque value used internally to construct a LOB stream.
All LOB write and read operations in this interface check
for the presence of the LOB suffix. If the check fails it
will result in an
IllegalArgumentException
.