From ODL/OO-DBMS Design To Relational Designs Object-Relational Database Systems (ORDBS)
From ODL/OO-DBMS Design To Relational Designs Object-Relational Database Systems (ORDBS)
to Relational Designs
&
Object-Relational Database Systems (ORDBS)
Relationships
• Can create a new relation for each relationship
• If the relationship is many-to-one from A to B, put
key of B attributes in the relation for class A.
• If relationship is many-many, we’ll have to
duplicate A-tuples as in ODL with set-valued
attributes.
− Wouldn’t you really rather create a separate relation
for a many-many-relationship?
− You’ll wind up separating it anyway, during BCNF
decomposition.
INF3100/INF4100 – Database Systems V’2005 M. Naci Akkøk
Translating ODL to Relations:
Relationships - Example
ODL class:
class Person (extent persons key name) {
attribute string name;
attribute Struct Addr{string street, string city} address;
relationship Set<Cars> ownCar inverse Cars::ownedBy;
relationship Person spouse inverse spouse;
relationship Set<Person> buddies inverse buddies;
}
Relation schema:
persons (name, street, city, ownCar, spouse, buddies)
• Motivations
− Allow DBMS to deal with specialized types – maps, signals,
images, etc. – with their own specialized methods.
− Supports specialized methods even on conventional relational
data.
− Supports structure more complex than “flat files.”
− …
New Features
• Structured types
Not only atomic types. ODL-like type system.
(Also: BLOB, CLOB, ADT, BFILE)
• Methods
Special operations can be defined for a type.
• Identifiers
Allowing unique IDs for each tuple.
• References
Pointers to tuples.
Nested Relations
• Attributes may have non-atomic types
− Nested-relational data models give up 1NF (atomic values)
− A relation’s type can be any schema consisting one or more attributes. An
attribute may even have an own schema as type.
• Example:
moviestar(name, address(street,city), birth, movies(title,year))
References - I
• Non-normalized relation
• Introduce references to allow a tuple t refer to
a tuple s rather than including s in t.
References - II
• If attribute A has a type that is a reference to a relation with
schema R, we denote A as A(*R)
• If A is a set of references, we denote A as A({*R})
• Example:
moviestar(name, address(street,city), birth, movies({*movies}))
movies(title,year)
Several vendors:
commercial OODBS: commercial ORDBS:
- GemStone - ORACLE
- O2 (now: Ardent) - Sybase
- ObjectivityDB - Illustra
- ObjectStore - UNISQL
- ONTOS - ...
- POET
- Versant
- ...
INF3100/INF4100 – Database Systems V’2005 M. Naci Akkøk
OODBS vs. ORDBS - II
• Objects/tuples:
Both objects and tuples are structs with components for attributes and relationships
• Extents/relations:
Both may share the same declaration among several collections
• Methods:
Both has the same ability to declare and define methods associated with a type
• Type systems:
Both are based on atomic types and constructions of new types by structs and
collection types
• References/OID:
OODBS OID hidden – ORDBS ID visible (may be part of type)
• Backwards Compatibility:
Migrating existing applications to an OODBS require extensive rewriting, but
ORDBSes have maintained backward compatibility
INF3100/INF4100 – Database Systems V’2005 M. Naci Akkøk
OODBS vs. ORDBS - III
OODBS: ORDBS:
• simpler way for programmer to use • substancial investment in SQL-based
DBS (familiar with OOPLs) rel. DBSs ◊ evolutionary approach
• “seamlessness”, no “impedance • systems are more robust due to many
mismatch” years of usage and experience
• OO functionality + DBS functionality • application development tools
◊ higher performance for specific
applications • transaction processing performance
prediction: both kinds of systems will exist, used for different kinds of applications