Main Page | See live article | Alphabetical index

Object-relational database

And Object-Relational database management systems (ORDBMS) are an evolutionary extension of relational DBMS products. The term is also sometimes used to describe external software products running over traditional DBMSs to provide similar features. These systems are more correctly referred to as object-relational mapping.

Whereas RDBMS -- or SQL-DBMS -- products focused on the efficient management of data drawn from a limited set of data types (defined by the relevant language standards) an object-relational DBMS allows software developers to integrate their own types and the methods that apply to them into the DBMS. The goal of ORDBMS technology is to allow developers to raise the level of abstraction at which they view the problem domain.

In an RDBMS, it would be fairly common to see SQL like this:

  CREATE TABLE Customers  (
      Id          CHAR(12)    NOT NULL PRIMARY KEY,
      Surname     VARCHAR(32) NOT NULL,
      FirstName   VARCHAR(32) NOT NULL,
      DOB         DATE        NOT NULL
   );

SELECT InitCap(Surname) || ', ' || InitCap(FirstName) FROM Customers WHERE Month(DOB) = Month(getdate()) AND Day(DOB) = Day(getdate())

which some OO fans would describe as horribly complex logic. Furthermore, most current SQL databases allow the creation of custom functions, which would allow the query to be expressed as:

    SELECT Formal(Id)
      FROM Customers
     WHERE Birthday(Id) = Today()

In an Object-Relational DBMS, you would see something like this:

   CREATE TABLE Customers (
     Id           Cust_Id     NOT NULL  PRIMARY KEY,
     Name         PersonName  NOT NULL,
     DOB          DATE        NOT NULL
   );

SELECT Formal( C.Name ) FROM Customers C WHERE BirthDay ( C.DOB ) = TODAY;

It is important to mention that for this query to work, the developer must previously define the methods Formal(), Birthday(), and TODAY.

Another advantage to the O-R model is the ability of the database to understand relationships between data and make it easy to collect related records. In an address book type application an additional table would be added to the ones above to hold zero or more addresses for each user. Using a traditional RDBMS, collecting information for both the user and their address requires a "join":

    SELECT InitCap(C.Surname) || ', ' || InitCap(C.FirstName), A.city
      FROM Customers C, Addresses A
     WHERE A.Cust_Id=C.Id -- the join
       AND C.city="New York"

The same query in an O-R system is much simpler:

   SELECT Formal( C.Name )
     FROM Customers C
    WHERE C.address.city="New York" -- the linkage is 'understood' by the ORDB

Many of the concepts in ORDBMS's were pioneered in the Postgres database, which eventually led to the open source PostgreSQL which is available today and gaining mind share. The first of the major database vendors to add O-R support to their products was Informix, which they did by purchasing the Illustra O-R database written by a number of ex-Postgres team members.

Most modern DBMS products – IBM's DB2, Oracle database, and Microsoft SQL Server – make claims to support this technology and do so with varying degrees of success.