    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
     <channel>
        <title>ACCU  :: Objects In Databases</title>
        <link>https://members.accu.org/index.php/articles/559</link>
        <description>Professionalism in Programming</description>
        <dc:language>en-us</dc:language> 
        <dc:creator>Administrator</dc:creator> 
        <admin:generatorAgent rdf:resource="http://www.xaraya.org" /> 
        <admin:errorReportsTo rdf:resource="mailto:webeditor@accu.org" />
       <sy:updatePeriod>hourly</sy:updatePeriod>
       <sy:updateFrequency>1</sy:updateFrequency>
       <docs>http://backend.userland.com/rss</docs>




<div class="xar-mod-head"><span class="xar-mod-title">Design of applications and programs + Overload Journal #31 - Apr 1999</span></div>

<table border="0" cellpadding="1" cellspacing="0">
    <tbody>
    <tr>
        <td valign="top">
            Browse in :
       </td>
       <td valign="top">

                                            <a href="https://members.accu.org/index.php/articles/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c13/">Topics</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c67/">Design</a>
<br />

                                            <a href="https://members.accu.org/index.php/articles/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c76/">Journals</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c78/">Overload</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c173/">31</a>
<br />

                                            <a href="https://members.accu.org/index.php/articles/c67-173/">Any of these categories</a>

                    -                        <a href="https://members.accu.org/index.php/articles/c67+173/">All of these categories</a>
<br />
</td>
   </tr>
   </tbody>
</table>




<div class="xar-error">
   <p>
 <strong>Note:</strong> when you create a new publication type,
the articles module will automatically use the templates
<em>user-display-[publicationtype].xt</em>
and <em>user-summary-[publicationtype].xt</em>.
If those templates do not exist when you try to preview or display a new article,
you'll get this warning :-)  Please place your own templates in themes/<em>yourtheme</em>/modules/articles . The templates will get the extension .xt there. </p>
</div>
<div class="xar-norm xar-standard-box-padding">
   <h1><strong>Title:</strong>&nbsp;Objects In Databases</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 26 April 1999 17:50:52 +01:00 or Mon, 26 April 1999 17:50:52 +01:00</p>
<p><strong>Summary:</strong>&nbsp;</p>
<p><strong>Body:</strong>&nbsp;<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e18" id="d0e18"></a>Overview</h2>
</div>
<p>As Object Oriented (OO) practitioners we deal with objects. The
perennial question of how to make our objects persistent has been
addressed in many ways. More often than not persistence is achieved
using traditional means - we stream binary data out to a file,
preceded by some identifier that identifies the type/class of the
object being persisted.</p>
<p>This is fine for data structures that are used as entities, but
where we are interested only in subsets of large volumes of data
this becomes an unwieldy mechanism (especially if the subsets need
to be determined dynamically). It is at this level that database
concepts come to the fore. We would like to apply Relational
Database (RDBMS) concepts to our objects: cursors (for iterating),
SQL (for filtering, ordering and amending data) etc.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e25" id="d0e25"></a>Impedance
Mismatch</h2>
</div>
<p>Historically RDBMSs store data in tables that have a fixed
number of columns. We could use one column per attribute and have a
separate row for each object instance, but this makes it difficult
to flexibly store object hierarchies that make use of inheritance
and polymorphism.</p>
<p>For example, imagine you have a base class Fruit, from which you
derive Apple and Orange. There are a number of possible ways of
using tables to represent this:</p>
<div class="orderedlist">
<ol type="1">
<li>
<p>Store all instances of objects derived from Fruit in a Fruit
Table. In this case you may have a sparse table - not all columns
(which represent attributes) will apply to all subclasses of
fruit.</p>
</li>
<li>
<p>Store instances of each concrete class in a separate table. In
this case you have two tables - an Apple table and an Orange table.
However it is now difficult to iterate over all Fruit, because you
would need two cursors.</p>
</li>
<li>
<p>Store attributes introduced by each class in a separate table.
Now you have three tables - Fruit, Apple and Orange. However you
now need to perform a join operation to reconstruct Apples or
Oranges (to combine the data with attributes from the Fruit table).
No matter how you address these problems you have to convert
between an in-memory representation of objects and persistent rows
in database table(s). This is what is called Impedance Mismatch (IM
to some!).</p>
</li>
</ol>
</div>
<p>Apart from these storage issues there are some other important
issues</p>
<div class="orderedlist">
<ol type="1">
<li>
<p>Object identity. Relational databases typically use Primary Keys
to uniquely distinguish rows within a table (these keys are also
used to implement links between objects). Objects do not
necessarily have unique attributes - we might establish identity in
a C++ program by comparing the address of the object, for
example.</p>
</li>
<li>
<p>Aggregation. Objects often contain other objects or collections
of objects. How would we map this to relational tables?</p>
</li>
<li>
<p>Querying. When dealing with objects we often want to know about
its relationship to other objects - how would we do this with
SQL.</p>
</li>
<li>
<p>Schema evolution. We may need to change the object model as part
of ongoing maintenance or enhancements - how would we do this?</p>
</li>
</ol>
</div>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e57" id="d0e57"></a>Solutions</h2>
</div>
<p>There appear to be roughly four (overlapping) solution
areas:</p>
<div class="orderedlist">
<ol type="1">
<li>
<p>Provide a custom mapping layer between the OO application and
the RDBMS.</p>
</li>
<li>
<p>Use a 3rd party Object Relational (OR) mapping tool.</p>
</li>
<li>
<p>Use an Object Oriented Database (ODBMS)</p>
</li>
<li>
<p>Use one of the next generation Object/Relational Databases
(ORDBMS) a.k.a. Universal Databases.</p>
</li>
</ol>
</div>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e75" id="d0e75"></a>Custom
Mapping</h2>
</div>
<p>It is possible to create your own mapping layer. In this way you
will be able to configure/customise each class mapping to best fit
your application's usage model, but you will expend a great deal of
effort. Typically a project that undertakes its own mapping layer
can expect to expend around 40% of all development and maintenance
effort on the mapping layer.</p>
<p>Further, many of the features that commercial products offer
would be missing, such as an object-aware query language.</p>
<p>A good text to consult if you are considering this route is
[<a href="#HEIN97">HEIN97</a>]</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e87" id="d0e87"></a>OR Mapping
Tools</h2>
</div>
<p>There are a number of tools available commercially that attempt
to automate the mapping process above. Through source code
'annotations' (such as macros) the developer can identify which
classes are persistent-capable, and which pointers refer to
persistent-objects. Some OR mapping tools generate a unique
identifier for each persistent object, but others require the
application to provide one (this is necessary to maintain object
identity).</p>
<p>Classes can be persistent either dependently or independently -
that is to say some objects may be persistent in their own right,
while other objects will be persistent only as
aggregates/composites of an independently persistent object.</p>
<p>Some common features are :</p>
<div class="orderedlist">
<ol type="1">
<li>
<p>The persistent pointer constructs are often implemented as
smart-pointer technology, thus saving the cost of database access
if the object is not referenced.</p>
</li>
<li>
<p>Most OR Mapping tools also provide some persistent collections
and iterators.</p>
</li>
<li>
<p>A mapping generation tool parses the source code (or IDL) to
generate the mapping layer. For some tools it is possible to
customise the mapping process, specifying which table model to use
for specific classes.</p>
</li>
<li>
<p>The runtimes typically provide some caching functionality.</p>
</li>
</ol>
</div>
<p>The mapping layer may interact with the RDBMS through native
drivers or some generic interface, such as ODBC. The native drivers
should give better performance, but there is the maintenance risk
of whether the OR Mapping provider will continue to track releases
of your chosen RDBMS.</p>
<p>The sophistication of the OR Mapping tools varies markedly. Some
require little extra coding, others require lots; some have visual
tools for customising the mapping, others have source file based
solutions; some have great problems handling polymorphism
intelligently, others deal with it in their stride.</p>
<p>OR Mapping tools that are produced by companies that also market
OODBMSs, may provide a unified API. This allows you to develop to
the API and decide at a later date whether to deploy on an RDBMS,
an OODBMS, or both. (The OR Mapping API available will most likely
be a subset of the full OODBMS API, since some functionality is
simply not implementable on top of an RDBMS).</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e115" id="d0e115"></a>OODBMS</h2>
</div>
<p>Solving the Impedance Mismatch problem led to the development of
dedicated object-oriented databases (OODBMS). In most of these
systems the developer essentially does little more than specify
which classes can be persistent. (In fact the developer also has to
replace various constructs with equivalent constructs provided by
the database library - such as pointers to, or collections of,
persistent objects).</p>
<p>Each database vendor developed its own methods of specifying
persistence, along with widely variant feature sets. Since OODBMSs
are typically used as solutions to specific problems there was
initially no standardisation of object models or APIs among the
vendors. This hindered the adoption of OODBMSs so much that the
Object Database Management Group (ODMG), an independent standards
organisation, was set up in the early 1990s. The members were
mainly the vendors themselves so the ODMG standards are more
OMG-like than ISO-like - that is they specify a lot of
functionality, much of which is optional. This allows most OODBMS
vendors to claim some measure of ODMG compliance.</p>
<p>Almost all OODBMSs are based on a Client/Server architecture
(even when both Client and Server reside on the same physical
machine). The user application generally accesses an object by
starting from a 'known' object and then navigating a network of
relationships from that object - 'known' objects are
specified/named by the application code.</p>
<p>Object identity is generally preserved by an Object Identifier
(OID). This is a unique identifier that is generated by the OODBMS
when the object is created, and is used to represent links
(pointers) between persistent objects. Some OIDs are simply unique
numbers, but page serving OODBMSs (see below) often encode object
location within the OID. This makes it difficult to move the object
once it has been created.</p>
<p>Although all OODBMSs have architectural differences
(idiosyncracies) there are two basic philosophies - Page Server and
Object Server.</p>
<div class="orderedlist">
<ol type="1">
<li>
<p>Page Server OODBMS are often based upon more conventional
storage technologies. The OODBMS Server retrieves data in pages, so
the clustering of objects on a page becomes important. Also,
locking is typically performed at the page level, which can limit
concurrent data access. Because the servers deal in pages they are
typically 'thin' servers - they perform minimal processing on the
objects contained in a page.</p>
</li>
<li>
<p>Object Server OODBMS are object aware. The physical location of
an object is not important and locking is performed at the object
level. However, the finer granularity of access and locking does
incur some overhead that can impair performance. Object Servers are
typically 'fatter' servers - they may be able to perform some
object processing on the server.</p>
</li>
</ol>
</div>
<p>The decision whether to choose a Page or Object Server will
depend on understanding the data model of your aplication. If the
patterns of data access are predictable and an efficient clustering
mechanism can be specified then it is likely that a Page Server may
perform better. If access patterns are unpredictable it will be
difficult to develop a clustering strategy and an Object Server may
be a better choice. The lock granularity may also be a crucial
element in your choice. It is important to develop your object
model first before benchmarking some candidate database solutions -
only then can you tell how a particular product will perform.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e137" id="d0e137"></a>ORDBMS</h2>
</div>
<p>This is the area that I can say least about, simply because I
know least about it.</p>
<p>The prevalence of OO methodologies and languages has given rise
to many OODBMSs and OR Mapping tools. This hasn't escaped the
notice of the large RDBMS vendors and they, quite rightly, have
attempted to address this new area of technology. To get a view on
the discussion (albeit an old view) it's worth having a look at the
Third-Generation Database System Manifesto [<a href=
"#STON90">STON90</a>] (a rebuttal to the Object-Oriented Database
System Manifesto [<a href="#ATKI89">ATKI89</a>] - and also
[<a href="#MAIE91">MAIE91</a>]).</p>
<p>Various OR technologies have been incorporated into
household/enterprise RDBMS. I am sure they have achieved some
measure of success, however there is as yet no standard, so a
solution targeted at one RDBMS will not be portable to others.
There is a revamp of SQL-92 on the way, called SQL3, and it will
have an object flavour. Various tradeoffs have been made to make it
compatible with traditional RDBMSs and its design is at odds with
that put forward by the ODMG. It must be stressed though that SQL3
is still some way from becoming an accepted standard.</p>
<p>However, due to the huge market penetration and acceptance of
RDBMS products many analysts predict that ORDBMSs (derived from
existing leading RDBMSs) will increasingly sideline OODBMSs
[<a href="#MCCL97">MCCL97</a>]</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e160" id="d0e160"></a>Sources Of
Information</h2>
</div>
<div class="variablelist">
<dl>
<dt><span class="term">The Object Data Management Group</span></dt>
<dd>
<p>(<a href="http://www.odmg.org/" target=
"_top">http://www.odmg.org/</a>) is an independent standards
organisation. It recently broadened its charter to include all
aspects of object data persistence.</p>
</dd>
<dt><span class="term">Doug Barry &amp; Associates</span></dt>
<dd>
<p>(<a href="http://www.odbmsfacts.com/" target=
"_top">http://www.odbmsfacts.com/</a>) publish the Object Database
Fact Book. It comes in three volumes each covering one of OODBMS,
ORDBMS and OR Mapping Tools. The book ships in elctronic format
only and each volume costs over $1500. The books are comprised
almost exclusively of checklist tables. The entries are not always
well described and can be confusing. The Object Database Handbook
[<a href="#BARR96">BARR96</a>] describes some of the issues in
greater detail.</p>
</dd>
<dt><span class="term">Dr. Akmal B. Chaudri</span></dt>
<dd>
<p>(<a href="http://www.soi.city.ac.uk/~akmal/html.dir/home.html"
target=
"_top">http://www.soi.city.ac.uk/~akmal/html.dir/home.html</a>) is
an academic and a consultant. His home page has many useful
links.</p>
</dd>
<dt><span class="term">Comp.objects.databases</span></dt>
<dd>
<p>(<tt class="literal">news:comp.object.database</tt>) is a low
volume, low noise USENET group.</p>
</dd>
</dl>
</div>
</div>
<div class="bibliography">
<div class="titlepage">
<h2><a name="d0e203" id=
"d0e203"></a>Bibliography</h2>
</div>
<div class="bibliomixed"><a name="ATKI89" id="ATKI89"></a>
<p class="bibliomixed">[ATKI89] <span class="citetitle"><i class=
"citetitle">The Object-Oriented Database System
Manifesto</i></span>, Malcolm Atkinson et al., ALTAIR Tech Report
No. 30-89</p>
</div>
<div class="bibliomixed"><a name="BARR96" id="BARR96"></a>
<p class="bibliomixed">[BARR96] <span class="citetitle"><i class=
"citetitle">The Object Database Handbook</i></span>, Douglas K.
Barry, Wiley,0-471-14718-4</p>
</div>
<div class="bibliomixed"><a name="CATT97" id="CATT97"></a>
<p class="bibliomixed">[CATT97] <span class="citetitle"><i class=
"citetitle">The Object Database Standard: ODMG 2.0, ed</i></span>.
R.G.G. Cattell &amp; Douglas K. Barry, Morgan Kaufmann,
1-55860-463-4</p>
</div>
<div class="bibliomixed"><a name="CHAU98" id="CHAU98"></a>
<p class="bibliomixed">[CHAU98] <span class="citetitle"><i class=
"citetitle">Object Databases in Practise</i></span>, Akmal B.
Chaudri, HP/Prentice-Hall, 0-13-899725-X</p>
</div>
<div class="bibliomixed"><a name="COOP97" id="COOP97"></a>
<p class="bibliomixed">[COOP97] <span class="citetitle"><i class=
"citetitle">Object Databases: An ODMG Approach</i></span>, Richard
Cooper, International Thomson Computer Press, 1-85032-294-5</p>
</div>
<div class="bibliomixed"><a name="EMBLE98" id="EMBLE98"></a>
<p class="bibliomixed">[EMBLE98] <span class="citetitle"><i class=
"citetitle">Object Database Development (Concepts and
Principles)</i></span>, David W. Embley, Addison-Wesley,
0-201-25829-3</p>
</div>
<div class="bibliomixed"><a name="HEIN97" id="HEIN97"></a>
<p class="bibliomixed">[HEIN97] <span class="citetitle"><i class=
"citetitle">Building Scalable Database Applications</i></span>,
Peter M. Heinckiens, Addison-Wesley, 0-201-31013-9</p>
</div>
<div class="bibliomixed"><a name="JORD97" id="JORD97"></a>
<p class="bibliomixed">[JORD97] <span class="citetitle"><i class=
"citetitle">C++ Object Databases (Programming with the ODMG
Standard)</i></span>, David Jordan, Addison-Wesley,
0-201-63488-0</p>
</div>
<div class="bibliomixed"><a name="MAIE91" id="MAIE91"></a>
<p class="bibliomixed">[MAIE91] <span class="citetitle"><i class=
"citetitle">Comments on the &quot;Third-Generation Database System
Manifesto</i></span>, David Maier, Oregon Graduate Institute</p>
</div>
<div class="bibliomixed"><a name="MCCL97" id="MCCL97"></a>
<p class="bibliomixed">[MCCL97] Object Database vs.
Object-Relational Databases, Steve McClure, IDC Bulletin 14821E</p>
</div>
<div class="bibliomixed"><a name="STON90" id="STON90"></a>
<p class="bibliomixed">[STON90] <span class="citetitle"><i class=
"citetitle">Third-Generation Database System Manifesto</i></span>,
Michael Stonebraker et al., SIGMOD Record 19:3</p>
</div>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
