4 Multimedia-Database
4 Multimedia-Database
health, and advertising. We need a multimedia database. A multimedia database has all kinds of
information, like words, pictures, sounds, and videos. It keeps track of all this information and
finds data easily. These databases enable the storage and retrieval of multimedia data components.
All media files in these databases are stored as binary strings and encoded according to their file
types. Let's explore the various types of multimedia databases.
Multimedia database is the collection of interrelated multimedia data that includes text,
graphics (sketches, drawings), images, animations, video, audio etc and have vast amounts
of multisource multimedia data. The framework that manages different types of multimedia
data which can be stored, delivered and utilized in different ways is known as multimedia
database management system.
Multimedia Database
It is a special type of Database capable of storing and managing multimedia information,
such as audio, video, images, etc, along with traditional text-based data. Following are
some examples of database management systems that support multimedia data:-
1. MongoDB GridFS
2. MySQL
3. PostgreSQL
4. IBM DB2 Content Manager
5. Oracle Multimedia
6. Microsoft SQL Server etc.
The multimedia database is classified into three types based on the type of multimedia data
it stores −
Static media
This is designed for static media objects. These media objects are not time-dependent, such
as images and graphic objects.
Dynamic media
This is used for storing dynamic forms of media content that are time-dependent. These
media objects are audio data, video data, and animations.
Dimensional media
Image Pixels No
Multimedia databases should have the ability to uniformly query data (media data, textual
data) represented in different formats and have the ability to simultaneously query different
media sources and conduct classical database operations across them. (Query support)
They should have the ability to retrieve media objects from a local storage device in a good
manner. (Storage support)
They should have the ability to take the response generated by a query and develop a
presentation of that response in terms of audio-visual media and have the ability to deliver
this presentation. (Presentation and delivery support)
Database integration combines data from diverse sources to create a consolidated version.
These sources include databases, the cloud, data warehouses, virtual databases, files, and
more. Database integration makes data accessible to multiple stakeholders and client
applications without reducing data quality.
Let’s understand this concept using an example. For instance, a company stores its
accounting data in the Oracle database and customer data in Salesforce. By utilizing the
DB integration processes, employees can access the combined data of both systems in one
place.
Data independence in DBMS refers to the capacity to change the schema (structure) of
the database without affecting the application programs or user views that access the data.
It is a fundamental concept that simplifies database maintenance and enhances flexibility.
Data persistence an application creates data. Then, that application quits. What happens
to the data? This is where data persistence comes into play. Data persistence is the
longevity of data after the application that created it has been closed. In order for this to
happen, the data must be written to non-volatile storage — a type of memory that can retain
that information long-term, even if the application is no longer running.
Read(A): Read operations Read(A) or R(A) reads the value of A from the database
and stores it in a buffer in the main memory.
Write (A): Write operation Write(A) or W(A) writes the value back to the database
from the buffer.
(Note: It doesn’t always need to write it to a database back it just writes the changes to
buffer this is the reason where dirty read comes into the picture)
Let us take a debit transaction from an account that consists of the following operations:
1. R(A);
2. A=A-1000;
3. W(A);
The first operation reads the value of A from the database and stores it in a buffer.
the Second operation will decrease its value by 1000. So buffer will contain 4000.
the Third operation will write the value from the buffer to the database. So A’s final
value will be 4000.
But it may also be possible that the transaction may fail after executing some of its
operations. The failure can be because of hardware, software or power, etc. For
example, if the debit transaction discussed above fails after executing operation 2, the value
of A will remain 5000 in the database which is not acceptable by the bank. To avoid this,
Database has two important operations:
Media data
It is actual multimedia data or primary data stored in the multimedia database. It represents
a multimedia object. It can be an image, audio, video, animation, graphic object, or text.
It is information related to the format of the multimedia data such as frame rates and
encoding schemes.
It is also known as content descriptive data. This information pertains to the generation of
multimedia data, such as date and time in the case of images and videos.
Media feature data
This data is used to describe the characteristics of multimedia data, such as the color
distribution.
Storage
Multimedia data is typically large in size. It affects its storage, retrieval, and transmission.
So, it requires specialized storage facilities that are larger and faster than conventional disk
storage.
Modeling
Multimedia data exists in various formats. It can be challenging to convert one form of
media content into another. This difficulty impacts the multimedia data retrieval process.
Performance
Due to its massive size and storage requirements. It takes a considerable amount of time to
process different types of multimedia data. Multimedia databases are slower than
traditional databases. It requires large bandwidth and high processing power.
Querying
Multimedia databases are used in industries that require a large set of documentation and
records, such as the insurance claim industry.
Education
Multimedia databases act as data providers for entertainment applications like video-on-
demand apps and news-on-demand apps. They can provide multimedia data for
advertisements and digital marketing processes.
Real-time Monitoring
When combined with various software tools, multimedia databases can be used to monitor
and manage multimedia data in real-time. For example, a geographic information system
(GIS) makes use of multimedia databases to analyze and visualize geographical multimedia
data in real-time.
Application areas
Examples of multimedia database application areas:
Digital Libraries
News-on-Demand
Video-on-Demand
Music database
Geographic Information Systems (GIS)
Telemedicine
Video-on-demand (VOD), technology for delivering video content, such as movies and
television shows, directly to individual customers for immediate viewing.
In a cable television VOD system, video content is stored on a centralized server in the
form of compressed digital files. A customer navigates a programming menu via the cable
set-top box and makes a selection, available either at no cost or for a charge. The server
immediately begins streaming the program. The viewer may pause, fast-forward, rewind,
or stop and later resume the program. Sometimes the program will be available for viewing
only for a short set time period. VOD systems may also use a download-based model, in
which the program is stored on a hard disk in the set-top box, or they may transmit over
the Internet to a personal computer.
These data include anything that can be associated with a location on the globe, or more
simply anything that can be mapped. For example, roads, country boundaries, and address
are all types of spatial data. At the CDC, we use GIS to help answer questions about how
location impacts disease and disability.
Digital libraries provide users with online access to a wide range of resources. They are
often used by students for research or by professionals seeking to stay current on the latest
developments in their field.
Digital libraries can provide users with access to rare and out-of-print materials that might
be difficult or impossible to locate in physical libraries. Digital libraries also offer a variety
of search and sorting features, as well as social media-like features that can connect users
with others to discuss topics.
Multimedia data consist of alphanumeric, graphics, image, animation, video, and audio
objects. Alphanumeric, graphics, and image objects are time-independent, while
animation, video, and audio objects are time-dependent. Video objects, being a structured
combination of image and audio objects, also have an internal temporal structure which
forces various synchronization conditions. A single frame of an NTSC quality video
requires (512 × 480) pixels × 8 bits/pixel = 246 kb, while a single frame of an HDTV
quality video requires (1024 × 2000) × 24 bits/pixel = 6.1 mb. Thus, at a 100:1 compression
ratio, an hour of HDTV quality video would take 6.6 gb of storage, not even considering
the audio portion. Utilizing a database system for presentation of a video object is quite
complex, if the audio and image portions are to be synchronized and presented in a smooth
fashion.
Besides its complex structure, multimedia data require complex processing in order to
extract semantics from their content. Real-world objects shown in images, video,
animations, or graphics, and being discussed in audio are participating in meaningful
events whose nature is often the subject of queries. Utilizing state-of-the-art approaches
from the fields of image interpretation and speech recognition, it is often possible to extract
information from multimedia objects which is less complex and voluminous than the
multimedia objects themselves and which can give some clues as to the semantics of the
events being represented by these objects. This information consists of objects called
features, which are used to recognize similar real-world objects and events across multiple
multimedia objects.
1. MongoDB GridFS
2. MySQL
3. PostgreSQL
4. IBM DB2 Content Manager
5. Oracle Multimedia
6. Microsoft SQL Server etc.
In the next section, you will learn how to store and retrieve a video file in MongoDB using
GridFS and MongoDB driver for NodeJS.
MongoDB has a feature called GridFS which allows you to store files larger than 16MB
that are not supported by BSON documents (BSON is the binary representation of
documents in MongoDB). GridFS converts a large file into smaller chunks. It uses two
collections, ‘chunks’ and ‘files’, one for storing the actual chunks and the other for storing
the metadata.
To get started, use the following commands in your terminal (Windows users should use GitBash
or other alternatives).
mkdir mongodb_tutorial
cd ./mongodb_tutorial
yarn init -y
touch index.js
Now, open index.js in a code editor such as VSCode and copy and paste the following code.
const fs = require('fs')
const { MongoClient, GridFSBucket } = require('mongodb')
try {
// Connect to the MongoDB server
await client.connect()
console.log('CONNECTED')
try {
await client.connect();
console.log('Connected to MongoDB')
const db = client.db(DB_NAME)
storeVideo().then(()=>retrieveVideo()).catch(e=>console.log(e))
You can also try this code with Online Javascript Compiler
node index.js
If no errors occur, your project directory will have the retrieved video.
Similarly, you can store large files in a MongoDB database with a simple script. Let’s now look
at some common use cases of a multimedia database.
Streaming services like Netflix and Amazon Prime rely heavily on highly efficient
multimedia databases to deliver video content at varying stream qualities to thousands of
endpoints.
Educational Platforms
Due to the rise in e-learning, many companies offer educational content online, including
video lectures, notes, live classes, etc. Multimedia databases play a vital role in such
educational systems.
Advertising agencies depend on multimedia databases for storing all sorts of media
assets, such as images, videos, graphics, etc., for efficiently managing media campaigns.
Content creators also rely on these databases as they have to deal with large volumes of
video content, which can be tough to work without a dedicated database.
Now that you are familiar with some common use cases of multimedia databases, let us look at
how a relational database stores multimedia information.
SQL databases have a special datatype called BLOB which allows them to support the storage of
large chunks of data directly in tables. It is suitable for smaller-sized multimedia files.
Paths to multimedia data stored in the file system can be added to tables. The database stores
the metadata while the actual multimedia file is stored in the file system. It is useful when there
is a limitation on BLOB sizes.
A hybrid approach involves using both BLOBS and references to multimedia files. Smaller files
are directly stored in the database while the larger files are stored in the file system.
Different types of management systems utilize different techniques for storing multimedia files,
some of which may provide additional functionality such as video transcoding, adaptive bitrate
streaming, etc.
The following section will compare file-based multimedia storage and multimedia databases.
Storing multimedia files doesn’t require additional software; the data is stored directly in the file
system.
The files are stored without any modification. Thus the data integrity is maintained.
Performing complex searches based on different criteria is impossible as the file system lacks
querying capabilities.
Data can be inconsistent due to multiple instances of the same multimedia file because every
time a modification is made, all the instances must be changed.
Database management systems provide complex querying abilities, allowing you to search
based on various metadata parameters.
Databases ensure consistency by supporting transactions and ensuring all the updates are
managed efficiently.
They are more scalable than file-based storage, which helps handle high volumes of data.
Modern database systems have inbuilt tools for backup and recovery in case of failures. They
also provide security features that ensure unauthorized personnel do not access your data.
Multimedia databases add a layer of complexity to storing and retrieving data from the
database, which may outweigh the advantages in smaller-scale applications.
Working with these databases requires some learning which may not be ideal.
The performance may seem degraded when compared to direct access. This occurs due to the
additional features provided by the database.
Some multimedia databases may mutate the raw files to store information efficiently. This
results in a loss of data integrity.
When it comes to complex web applications or other similar large-volume use cases, using a
database is highly recommended as they are much more scalable and secure than file-based
storage.
Horizontal scaling is a technique used for handling high workloads by adding more machines or
servers.
Vertical scaling, on the other hand, focuses on upgrading a single machine or server to endure
increased workloads.
A BLOB (binary large object) is a special data type in relational database management systems
that stores large chunks of multimedia information directly in a table in the form of a contiguous
sequence of bytes.
Online streaming platforms serve multimedia of varying qualities depending on the network
condition of the user endpoint, and they do so by encoding files in multiple qualities or bitrates
and dynamically changing as the network conditions change.
Conclusion
Multimedia Databases are used for efficiently handling large volumes of multimedia
information. They provide tools like video transcoding, compression, multi-bitrate encoding,
etc., and complex querying abilities. Relational databases use BLOBS and references to store
multimedia files, while non-relational databases such as MongoDB convert multimedia files into
smaller chunks.
Overall, multimedia databases are crucial for various applications such as education,
entertainment media, advertising, etc., as large data volumes have to be managed.
Let’s understand this concept using an example. For instance, a company stores its accounting
data in the Oracle database and customer data in Salesforce. By utilizing the DB integration
processes, employees can access the combined data of both systems in one place.
Employees can then use the information to draw actionable insights in lesser time. Similarly,
some businesses utilize website integration to manage and unify data from various web pages. It
perceives the web as multiple heterogeneous databases.