Managing Multimedia and Unstructured Data in the Oracle Database
上QQ阅读APP看书,第一时间看更新

Digital object composition

A digital object can be thought of as just more than just one single image. It can actually become a complex structure in its own right, even growing to the point of having its own hierarchical structure.

The starting base – NULL object

There are two types of digital objects within Oracle that could be classified as NULL.

A NULL value can have numerous meanings, but in the relational world, a NULL value is one which is unknown and not just blank. A number that is NULL can be considered to be zero, but a true NULL value is one that is unknown and has the potential to be any value.

When it comes to dealing with objects, an object can be created and just given the value NULL.

myimage ORDSYS.ORDIMAGE
…
begin
myimage := NULL;

An object can also be initialized as a composite, meaning its object structure is set up. As an object can be composed of multiple types, the initializing involves setting up the individual values.

myimage ORDSYS.ORDIMAGE
…
begin
 myimage := ORDSYS.ORDIMAGE.init();

This is the equivalent of performing the following code:

myimage ORDSYS.ORDIMAGE
…
begin
 myimage := ORDSYS.ORDImage(ORDSYS.ORDSource(empty_blob(), NULL,NULL,NULL,SYSDATE,1),NULL,NULL,NULL,NULL,NULL,NULL,NULL);

Most of the subtypes are set to NULL, but some can be given default values. Though from an object-oriented perspective, the two cases are intrinsically separate, they still raise the issue of when an object is truly NULL. This book will not take up that point, as it is distracting from looking at the issue of treating a digital object.

The focus of a digital object is the unstructured data within it. This could be multimedia or some future structure yet to be determined. The metadata around the object just supports it and helps define it for now. It is realistic in the future that a digital object will not need any metadata, as the digital object itself will contain sufficient information to define it. The metadata can be seen to be like an indexing structure, which is there to improve performance and to make it easier for someone to find the digital object. It is there as a supporting structure. It is not the digital object.

So, the NULL case for a digital object can now be raised. It's an initialized object structure that might have metadata but does not yet have unstructured data associated with it. The NULL case is one that says that this digital object has the potential to take any value. It could be a photo, an audio file, a video, a text file, or many of these.

It's important to put the focus on the unstructured data that could be contained within the digital object and not the data (referred to as metadata) that supports it.

The original image

Most digital objects start with an original image. This is the core image. All other images attached effectively are to accompany or support it. The original can be a photo, an audio file, a video, or any unstructured data of any size.

Note

The original image is never modified. Derivatives can be created from it, and the image can be indexed.

As with all digital objects, there are exceptions to the rule as to what the digital object is and how can it become fuzzy. Once a camera takes a DNG (Digital Negative), the original is never modified. The exception comes when modifications that the photographer makes to the image are stored; they are just stored as changed data within the original. So the original might be changed and enhanced, but behind the scenes, all that is stored is the original with the change vectors stored separately. On accessing the DNG, the original raw image is opened and all changes are then applied. So even though the original DNG is not modified, the actual DNG file is modified, as the change vectors effectively result in the core file being changed.

Indexed digital object

The goal of indexing a digital object is to improve performance. A traditional index found in relational databases will improve performance when searching and performing queries. In some cases, an index can be used to enforce referential integrity (enforcement of the primary key).

With an index on a digital object, the goal is to improve retrieval or delivery time. A digital object can be quite large, whereas a relational record is typically small. The time to retrieve a 10 MB of digital photo can be in seconds or minutes depending on the network speed. If a user was displaying a page with 100 digital objects shown on it, with each one being shown smaller (less pixels) to enable all of them to be viewed on the screen, then the total download could be 100 x 10 MB or 1 GB. Scale this up to 100 concurrent users and most networks (even internal ones) will be struggling to deliver the images. Add on top of it that public sites can pay for a cost for download (for example, Amazon charge a fixed rate per GB retrieved), and it becomes obvious that retrieving the original of the digital object is not cost-effective.

The important point to stress here, which is the key for scalability and differentiates the unstructured database from the relational one, is that the focus for tuning is heavily around the speed of delivery, not the speed to perform a query.

Pyramid index

For a number of digital objects, scalability is achieved via a pyramid index. In the traditional index, a thumbnail is created, which is a much smaller version of the original. For audio and video, this thumbnail can also be referred to as a snippet. The thumbnail can vary in size. For a digital image, it can be between 80 and 140 pixels in length. It can be created just by shrinking or reducing the image. For organizations that have varying sized images, they can create a postcard thumbnail. This is one where a key area of the image that best portrays the information in it is cropped out and then shrunk down in size. A thumbnail will typically be between 1 k and 10 k in size.

Using the previous example, if a user now requests 100 images, and if each thumbnail is 10 k in size, this means that only 1 MB of data is delivered. This is a major improvement.

The pyramid index takes one or more (there is no limit) reduced, cropped, or resized images of the original and enables those to be delivered to the user on request. This enables the user to effectively zoom in and view larger details of the original.

The pyramid index can become quite sophisticated and hundreds of variations of the image can be created at different resolutions, each smaller than the original. When it is set up correctly, it allows the user to quickly zoom in to different areas of the digital image without ever downloading the original.

As with any index, performance is gained at the expense of storage, and the more sophisticated the pyramid index, the more storage is required. For most organizations, having a two-level structure is sufficient. This involves creating a thumbnail and web quality image. The web quality is a larger version of thumbnail that is created for optimal viewing on most computer screens. The web quality is typically 600 pixels and between 100 k to 1 MB in size.

For a video object, the snippet might be of a low-quality extract by 10 seconds of a key scene within the video itself, while the web quality equivalent might be a 60-second extract (or compilation) at a slightly higher quality. Movie trailers would be classified as being part of the pyramid index. A video object might also have digital image thumbnails representing it as well as the snippets. The digital image thumbnail might be of a key scene, while the web quality would be the snippet.

Each digital object type has its own characteristics and methods for what the thumbnail is and how it should be represented. A document might have a thumbnail being a digital image of the first page, or it could be an abstract covering what the document is about.

Pyramid index

Derivatives

A derivative is a digital object that has been transposed, transformed, compressed, and/or converted for the purposes of digital image delivery. An indexed image such as a thumbnail is created for the purpose of performance. One or more derivatives can be created. For a digital image, it could be an image that has attributes that make it ideal for being embedded in a PowerPoint. Another one could be created with a CMYK color space embedded in it to make it suitable for printing. For a digital video, a derivative might be one with a h264+ codec and another with an MPEG-4 codec. For a document, a PDF derivative could be created.

In some cases, the derivative and indexed image can overlap. A high-quality web digital image could be used for image delivery.

Derivatives

Masters

A digital object might be a digital photo of a vase. The object itself represents the vase. Multiple digital photos might be taken of the vase from different angles. Each one of these is referred to as a master. One of these can be marked as the representative master, and from it, the thumbnail presented to the user is the one shown. There is no limit to the number of masters a digital object has. A master can also have many derivatives. This can result in a digital object having a large number of digital images contained within it.

Masters

Components

An individual digital object can be composed of many components. If a digital object has many masters, and each master has many derivatives, as well as indexing the actual digital object will have many components within it. This will increase the size of the actual digital object.

The digital object can have metadata associated with it. Each master can also have metadata associated with it (for example, EXIF, XMP, or IPTC values). Though it's possible to store metadata within a web quality image or thumbnail, as they are used for indexing by not storing metadata within them, the size of the digital image will be reduced, making it faster to retrieve them.

Components

Version hierarchies

When a digital object is modified, previous versions can be kept. These versions can be stored inside the same digital object similar to a master. The difference is that a master is a different view about the same digital object, and the version is the same image that has been modified. As different people can be editing different parts of the object or even different masters, a hierarchy can be formed containing all the different versions and who modified them.

For a version hierarchy, the challenge is the storage required to store all the different versions. Even if one byte in metadata embedded in the image is modified, then a new version is required to be stored. What database vendors need to start looking at doing is using techniques for optimally storing these versions. It's possible using the technology used for MPEG compression for version hierarchies. In this case, each version is like a frame and only the differences between the versions are stored in a compressed manner. Though no database vendor offers this capability, such a feature would have major storage ramifications and enable more versions to be stored.

Though an original should never be modified, as explained with a DNG, it's possible to modify the original while keeping it unmodified. One just changes the metadata around it. When it comes to video and audio, this goes into gray territory, as the original might need to be digitally edited before it becomes the official original. As is always the case with unstructured data, once a rule is established, it does not take long for exceptions to the rule to come to light. The changing nature of this means that a fuzzy attitude needs to be adopted when dealing with all unstructured data.

Relationships

A relationship is an association or link between any two or more digital objects. This is covered in greater detail in Chapter 3, The Multimedia Warehouse. A relationship can be used instead of the master concept. It can flatten the structure of the digital objects that are presented. The decision as to whether a master concept or a relationship concept is used is one that is based on the business requirements of the organization.

Relationships

Unstructured data business cases

Only with the increase in uptake of social media and the introduction of devices, such as the iPad or Android, has the focus on data that has started to change from structured text to the one that involves multimedia or other types of unstructured data.

It is fair to say that most organizations have not considered the business need for managing their unstructured data until a strong business imperative has emerged; in this case, a reactive approach has been taken to its management. In fact, most business organizations need in place some form of digital image or asset management database, just like they need databases to manage their structured data.

The following are examples of businesses that may have a requirement for digital object management.

Sporting club

Any club involved in sport will have digital photos taken, videos of events, newsletters, interviews, or promotion of their club.

Charity

Charities may require digital object management for marketing or promoting their charity. A charity involved in finding homes for pets would have photos of those animals along with a case history of each. A charity involved in selling second hand clothes or furniture would have e-commerce requirements. Charities involved in assistance programs would have requirements to store a variety of data, including photos, audio, and documents.

Neighborhood watch

Neighborhood watch was a community-based social organization focused on monitoring and assisting policy within the neighborhood. Digital images of vandalism, property destruction, or even of good works done by the community are needed to be distributed across the neighborhood, as well as given to the local authorities.

News

Any organization involved in print media has requirements to store and manage all news stories and articles created. It is like having a digital object warehouse of information (which is covered further in Chapter 3, The Multimedia Warehouse).

Food

Any organization involved in food or beverages has a large focus on marketing and promoting that product. Managing, and more importantly, having a tight control over all the digital objects that are used in promotions or adverts is an important requirement.

Government

Every government organization (local, state, or federal) has requirements to store digital images, documents, videos, and any form of multimedia. Digital video can be used for training, digital photos for marketing, promotion, or as a way of managing assets. Even government departments that focus on tax collection need marketing tools and digital image management for internal use in brochures or for public education.