5. Object-Relational Database (ORD)
That's composed of both a relational database (RDBMS) and an object-oriented database
(OODBMS).
ORD supports the basic components of any object-oriented database model in its
schemas and the query language used, such as objects, classes ana class inheritance
An object-relational database may also be known as an object relational database
management systems (ORDBMS).
the middleman between relational and object-oriented databases because it contains
aspects and characteristics from both models
Extended Relational Databases
ERDBMSs have characteristics of both an RDBMS and an ODBMS (thus, the loose application of the
ORDBMS label).
6. ORDBMS Design
ORDBMS is a Object Oriented Relational Database Management System based on the Relational as
well as Object Oriented database model.
It is same as RDBMS but it has some extra confusing extensions because of the Object Oriented
concepts
ORDBMS allows to store the video as an user-defined abstract data type (ADT) object and write
methods that capture any special manipulation that an user wish to perform.
The ORDBMS allows users to store and retrieve objects of type jpeg-image which stores a compressed
image representing a single frame of film, just like an object of any other type, such as integer.
PostgreSQL is an example of ORDBMS.
7. An ORDBMS supports a much better solution.
First, we can store the video as an ADT object and write methods that capture any special
manipulation we wish to perform.
Second, because we are allowed to store structured types such as lists, we can store the
location sequence for a probe in a single tuple, along with the video information.
This layout eliminates the need for joins in queries that involve both the sequence and video
information.
An ORDBMS design for our example consists of a single relation called Probes_AllInfo:
Probes_AllInfo(pid: integer, locseq: location_seq, camera: string, video: mpeg_stream)
This definition involves two new types, location_seq and mpeg_stream. The mpeg_stream is
an ADT, with a method display() that takes a start time and an end time and displays the portion
video recorded during that interval.
8. Nested Relations
In relational databases, all relations are at least in First-Normal Form (1NF) which requires all attributes
to have atomic domains. That is, elements of the domains are considered to be indivisible units.
In the nested relational model – as an extension of the relational model – domains may be either atomic
or relation valued. That is, an attribute value of a tuple can be a relation.
Example: Representation of a document relation in Non-1NF:
Title author-list date keyword-list
DB Theory {Smith, Jones} 1 April 79 {algebra, logic}
Programming {Jones, Frick} 17 June 85 {Pascal, C}
9. Collection Types ARRAY
ordered 1D array with maximum number of elements without duplicates.
LIST: ordered collection that allows duplicates.
SET: unordered collection without duplicates.
MULTISET: unordered collection that allows duplicates.
10. Storage and access methods
Since object relational databases store new types of data, ORDBMS implementers need to
storage and indexing issues. In particular, the system must efficiently store ADT objects and
and provide efficient indexed access to both.
Storing Large ADT and Structured Type Objects
Large ADT objects and structured objects complicate the layout of data on disk. User
quite large.
Storage of large ADTs :-> As large ADTs need special storage, it is possible to store them
on the disk from the tuples that contain them. For e.g. BLOBs (Binary Large Object like
multimedia object.)
11. Query processing
ADTs and structured types call for new functionality in processing queries in
number of assumptions that affect the efficiency of queries.
In this section we look at
two functionality issues (user defined aggregates and security)
And two efficiency issues (method caching and pointer swizzling).
12. User defined aggregates and security
User-Defined Aggregation Functions
• Most ORDBMSs allow users to register new aggregation functions with the system.
• To register an aggregation function, a user must implement 3 methods
initiaIize : initializes the internal state for the aggregation
iterate : updates that state for every tuple seen.
terminate : computes the aggregation result based on the final state and then
example,
consider an aggregation function to compute the second-highest value in a field.
* the initialize call : allocate storage for the top two values
* the iterate call : compare the current tuple's value with the top two and update
necessary
*the terminate call: delete the storage for the top two values returning a copy of the
value.
13. Method security
ADTs give users the power to add code to the DBMS; this power can be abused. • A
buggy or malicious ADT method can bring down the database server or even corrupt the database.
have mechanisms to prevent buggy or malicious user code from causing problems.
Method caching and pointer swizzling
Method caching
During query processing, it may make sense to cache the results of methods, in case they are
with the same argument.
• An alternative is to maintain a cache of method inputs and matching outputs as a table in the
find the value of a method on particular inputs, we essentially join the input tuples with the cache
approaches can also be combined.
14. Pointer swizzling
In some applications, objects are retrieved into memory and accessed frequently through
dereferencing must be implemented very efficiently. Some systems maintain a table of oids of
(currently) in memory. when an object O is brought into memory, they check each oid
oids of in-memory objects by in-memory pointers to those objects. This technique, called
makes references to in-memory objects very fast. The downside is that when an object is
references to it must somehow be invalidated and replaced with its oid.
15. 1.Query Optimization
Challenge: New indexes and query processing techniques increase the options for query optimization. But, the
challenge is that the optimizer must know to handle and use the query processing functionality properly.
Solution:While constructing a query plan, an optimizer must be familiar to the newly added index structures.
For a given index structure, the optimizer must know:
1. WHERE-clause conditions matched by that index.
2. Cost of fetching a tuple for that index.
16. Advantages of ORDBMSs
Reuse and Sharing
Increased Productivity
Support powerful query language : For example: SQL 3, SQL/CLI etc.
Support object views
Reduce application development time
Disadvantages of ORDBMSs
Complexity: ORDBMS design is more complicated because we have to consider not only the underlying
design consideration of application semanties and dependencies in the relational data model but also the
object oriented nature.