Download CS6362 1998 - Northumbria University

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Microsoft Access wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Global serializability wikipedia , lookup

SQL wikipedia , lookup

Oracle Database wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Concurrency control wikipedia , lookup

Navitaire Inc v Easyjet Airline Co. and BulletProof Technologies, Inc. wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Ingres (database) wikipedia , lookup

Encyclopedia of World Problems and Human Potential wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Functional Database Model wikipedia , lookup

Relational algebra wikipedia , lookup

Clusterpoint wikipedia , lookup

Database wikipedia , lookup

Versant Object Database wikipedia , lookup

Healthcare Cost and Utilization Project wikipedia , lookup

Relational model wikipedia , lookup

Database model wikipedia , lookup

Transcript
Extensions to Relational Databases
Object-Relational and
Nested-Relational Databases
By
Dr. Akhtar Ali
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
1
Lecture Theme & References
• Theme
– The need for extensions in Relational Data Model (RDM)
– Classification of database systems
– Extensions to RDM, namely
• Object-Relational
• Nested-Relational
• References
– R. Elmasri and S. B. Navate, Fundamental of Database Systems –
5th Edition, 2007, Chapter 22
– Thomas Connolly and Carolyn Begg, Database Systems
- 4th Edition, 2004, Chapter 28
– Michael Stonebraker, Paul Brown and Dorothy Moore, ObjectRelational DBMSs: The Next Great Wave and Object-Relational
DBMSs: Tracking the Next Great Wave (1996, 1998)
– Prof. Norman Paton, Object Relational Databases, University of
Manchester.
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
2
Why Extend Relational Data Model
• To counter the following weaknesses of RDM:
– Poor representation of ‘real world’ conceptual model
• Usually the relational schema does not correspond to real world
entities
– Semantic overloading
• The same relation is used to represent entities (classes) as well as
relationships (associations, aggregation)
– Poor support for integrity and business rules
– Fixed number of attributes & all attribute values must be
atomic
– Limited operations on the data
– Difficult to handle recursive queries
– Impedance mismatch (when SQL is embedded in 3GLs)
• Type System mismatch, Evaluation Strategy mismatch
– Poor navigational access
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
3
Michael Stonebraker’s Classification
• Michael Stonebraker presents this four-quadrant matrix in the book
entitled “Object-Relational DBMSs: The Next Great Wave”
– This is a classification of both database applications and systems.
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
4
Lower-Left Quadrant
• Those application that process simple data and require
no query capability e.g. text processors (word, emacs)
– Information has little internal structure.
– Document updates are relatively infrequent.
– Documents are of modest size.
– Queries are simple string or pattern searches.
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
5
Upper-Left Quadrant
• Those application that process simple data and require
complex query capability e.g. a typical business
application require RDBMS.
– Information has straightforward and fixed structure.
– Information collection may be large.
– Information storage must be reliable.
– Queries are relatively complex.
– Updates are frequent and Security is vital.
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
6
Lower-Right Quadrant
• Those application that process complex data and require
no query capability e.g. a CAD application requires
OODBMS.
– Information has complex structure.
– Analysis is complex.
– Information is moderate in quantity.
– Queries are not central.
– Updates are periodic.
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
7
Upper-Right Quadrant
• Those application that process complex data and require
complex query capability e.g. an Image Data Archive
requires ORDBMS.
– Information has complex structure.
– Information may include special data types.
• Images, Spatial information
– Information is large in quantity.
– Queries are important.
– Updates are periodic.
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
8
Object-Relational Databases
• Object-Relational databases (ORDBSs) seek to:
– Retain the relational model as a subset.
– Retain the strengths of the relational model and all the
technologies that come with it.
– Support complex data types (BLOBS, ADTs, Spatial, and
Multimedia, …).
– Support object-oriented design.
– Reduce impedance mismatch (type system).
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
9
Advantages of ORDBMSs
• Resolves many of known weaknesses of RDBMS.
• Reuse and sharing:
– reuse comes from ability to extend server to perform
standard functionality centrally;
– gives rise to increased productivity both for developer and
end-user.
• Preserves significant body of knowledge and
experience gone into developing relational
applications.
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
10
Disadvantages of ORDBMSs
• Complexity.
• Increased costs.
• Supporters of relational approach believe simplicity
and purity of RDM are lost.
• Some believe RDBMS is being extended for what will
be a minority of applications.
• OO purists not attracted by extensions either.
• SQL now extremely complex.
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
11
Classification Problems !
• Most of OODBMSs claim to be in Upper-Right quadrant
not just ORDBSs.
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
12
Myth: OODBs do not support queries
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
13
Characteristics of ORDBs
• According to Stonebraker, ORDBs have the following
characteristics.
1. Base type extensions
2. Complex objects
3. Inheritance
4. Active Rules
• Oracle 8i supports 1,2, and 4. Item 4 is independent of
object extensions. Oracle 9i has most of the features
(SQL3 compliant). We assume using features of Oracle
9i throughout, although our server is running 10g.
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
14
From Relations to Object-Relations
• Structured types for attributes (beside atomic)
– Composite attributes (e.g. structs or records)
– Arrays
– Nested relation i.e. the value of an attribute can be an entire
relation
– This removes the restriction of first normal form (1NF)
• Methods
– Special operations can be defined for, and applied to
instances of a user-defined type (UDT)
• Identifiers for tuples
– Tuples play the role of objects.
– Each tuple has a unique ID that is generated by the system
• References
– An attribute can have a value that is a pointer to an object.
This feature allows objects sharing.
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
15
Nested-Relations
• Relations that violate the 1NF rule of relational model are
called Nested-Relations.
• Nested-Relational Model (NRM) are sometimes referred
to as the Non-1NF or Non-First Normal Form (NFNF) or
NF2 relational model.
• Nested-Relational Model offers very limited features
– Composite attributes (e.g. structs or records)
– Nested relation i.e. the value of an attribute can be an entire
relation
• NRM does not support Object-Sharing
• NRM based system supports new algebraic operations
for manipulating nested-relations
– Nest (to convert 1NF into NF2)
– Unnest (to convert NF2 into 1NF)
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
16
Nesting and Unnesting
• Family data in First Normal Form:
• Nesting on the basis of Father and
Mother grouping returns:
• Unnesting of the Children
collection returns:
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
17
Relational Design for Movie Database
• Sample Relational Database
• A Relational Query
Select s.name, sa.street, sa.city, m.title,
m.year, m.length
From Stars s, Star_Adress sa, Movies m, Movie_Star ms
Where s.name = sa.name
And s.name = ms.name
And ms.title = m.title
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
18
Nested-Relational Design
• Nested-Relational Table
• A Nested-Relational Query
Select s.name, s.address, s.movies
From Stars s
• Watch out for duplication of data!
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
19
Object-Relational Design
• Object-Relational Database
• An Object-Relational Query
Select s.name, s.address, s.movies
From Stars s
• Watch out for Object Sharing!
Advanced Databases (CM036): Lecture # 4 (Object-Relational and Nested-Relational Databases
20