Object (and Object-Relational) Database Systems (part two)

Slides:



Advertisements
Similar presentations
OO databases 1 Object Oriented databases. OO databases 2 Developing OODBMS - motivation motivation more and more application areas require systems that.
Advertisements

Chapter 10: Designing Databases
Jane Reid, BSc/IT DB, QMUL, 25/2/02 1 Object-oriented DBMS Background to ODBMS ODBMS requirements Object components ODB conceptual design –Graphical ODB.
ODMG Standard: Object Model1 OBJECT-ORIENTED DATABASE SYSTEMS ODMG Standard: Object Model Susan D. Urban and Suzanne W. Dietrich Department of Computer.
OBJECTS Object Oriented ???????. OBJECTS Object-Oriented n OO convenient label for a collection of interconnected ideas n OO approach views computer.
Organizing Data & Information
Object-Oriented Databases
Chapter 11 Data Management Layer Design
PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved. Slide 1.
Fundamentals, Design, and Implementation, 9/e Chapter 16 Object-Oriented Database Processing.
Object-Oriented Methods: Database Technology An introduction.
RIZWAN REHMAN, CCS, DU. Advantages of ORDBMSs  The main advantages of extending the relational data model come from reuse and sharing.  Reuse comes.
Advanced Database CS-426 Week 13 – Object Relational Databases.
Chapter 4 Object and Object-Relational Databases (Part ½: Object-Oriented Concepts) Lecturer: H.Ben Othmen Department of Computer Science, Umm Al-Qura.
EER vs. UML Terminology EER Diagram Entity Type Entity Attribute
III. Current Trends: 3 - Object-Relational DBMSsSlide 1/24 III. Current Trends Object-Relational DBMSs 3C13/D63C13/D6.
IST Databases and DBMSs Todd S. Bacastow January 2005.
Object-Relational DBMSs By Yao-Wen Tu CS157b12/09/2003 Prof. Sin-Min Lee.
Object-Based Databases. 2 Complex Data Types and Object Orientation Structured Data Types and Inheritance in SQL Table Inheritance Array and Multiset.
Chapter 24 Introduction to Object DBMSs Prepared by Kai Huang CS157B Prof Sin-Min Lee.
Agenda  TMA03  M877 Block 3 Databases with Objects.
DBSQL 10-1 Copyright © Genetic Computer School 2009 Chapter 10 Object-Oriented Based DBMS.
DBMS Lecture 9  Object Database Management Group –12 Rules for an OODBMS –Components of the ODMG standard  OODBMS Object Model Schema  OO Data Model.
Limitations of the relational model. Just as the relational model supplanted the network and hierarchical model so too will the object – orientated model.
CS370 Spring 2007 CS 370 Database Systems Lecture 2 Overview of Database Systems.
OBJECT DATABASE SYSTEMS PART ONE  Advanced database application areas  Problems associated with RDBMSs  Third Generation DBMSs  What is Object Orientation?
Object-Based Databases Ghazal Mostofi Sadri. Outline 1.Overview 2.Complex Data Types 3.Structured Types and Inheritance in SQL 4.Table Inheritance 5.Array.
Lecture 17 Object relational databases. 2 Example Table Creation based on UDT CREATE TABLE Person ( info PersonType, CONSTRAINT DOB_Check CHECK(dateOfBirth.
Object-Oriented Database Management Systems (ODBMS)
Object_Oriented Databases, by Dr. Khalil 1 Object-Oriented DBMSs Dr. Awad Khalil Computer Science Department AUC.
1 Object Databases: Introduction. 2 Why OO? v Relational Systems are limited: –Structural restrictions on data –Missing semantics (value-based relationships)
11 1 Chapter 11 Object Oriented Databases Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
1 CS 430 Database Theory Winter 2005 Lecture 17: Objects, XML, and DBMSs.
ADVANCED DATABASE SYSTEMS DR. FATEMEH AHMADI- ABKENARI SEPTEMBER Object Databases.
Object Persistence (Data Base) Design Chapter 13.
Object Persistence Design Chapter 13. Key Definitions Object persistence involves the selection of a storage format and optimization for performance.
Copyright © 2015 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
Chapter 12: Designing Databases
Chapter 18 Object Database Management Systems. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for object.
11 Object-Oriented DBMS Figure Table 11.4 The Thirteen OODBMS Rules.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 18 Object- Oriented Database Processing.
Object DBMSs Transparencies. ©Pearson Education 2009 Chapter 17 - Objectives Advanced database applications. Unsuitability of RDBMSs for advanced database.
Object relational database managmement systems (ORDBMS) Adapted by Edel Sherratt from originals by Nigel Hardy.
1 CS457 Object-Oriented Databases Chapters as reference.
Creating and Maintaining Geographic Databases. Outline Definitions Characteristics of DBMS Types of database Relational model SQL Spatial databases.
Department of Computer Engineering MASTER THESIS OBJECT DATA MODELING AS STRUCTURING APPROACH IN DATABASE DESIGN Name : Anwar Mahmoud Dawoud Supervisor.
OODBMS: Introduction and Logical Database Design
Object Oriented Database By Ashish Kaul References from Professor Lee’s presentations and the Web.
Chapter 2 Object-Relational DBMSs Chapter 28 in Textbook.
Object Relational Features
The Clash of the (database) Cultures Object- oriented Relational.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
FEN NOEA/IT - Databases/ORDB1 Object-Relational Databases The Evolutionary Approach to Closing the Gap between Relational Tables and Object Models.
AND OBJECT-ORIENTED DATABASES OBJECT-RELATIONAL DATABASES.
Lecture 16 Object relational databases. 2 Objectives How relational model has been extended to support advanced database applications. Features proposed.
The ODMG Standard for Object Databases
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
The Object-Oriented Database System Manifesto Malcolm Atkinson, François Bancilhon, David deWitt, Klaus Dittrich, David Maier, Stanley Zdonik DOOD'89,
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 12 Outline Overview of Object Database Concepts Object-Relational Features Object Database.
1 10 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 10 Designing Databases.
Faeez, Franz & Syamim.   Database – collection of persistent data  Database Management System (DBMS) – software system that supports creation, population,
OODBMS and ORDBMS. Background Object-oriented software, based on the principles of user-defined datatypes, along with inheritance and polymorphism, is.
Chapter 3 The Relational Model. Why Study the Relational Model? Most widely used model. Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc. “Legacy.
Data Resource Management Lecture 8. Traditional File Processing Data are organized, stored, and processed in independent files of data records In traditional.
Completeness Criteria for Object- Relational Database Systems by Won Kim April 2002 Sang Ho Lee School of Computing, Soongsil University
Object-Relational Databases Paul Crowther & Martin Beer
Databases and DBMSs Todd S. Bacastow January
The Object-Oriented Database System Manifesto
Object-Relational DBMSs
Data Model.
Presentation transcript:

Object (and Object-Relational) Database Systems (part two) CSS263 Lecture 18

OBJECT DATABASE SYSTEMS LECTURE PLAN OBJECT DATABASE SYSTEMS PART TWO What is an OODBMS? Advantages and Disadvantages of OODBMSs What is an ORDBMS? What is SQL3? Comparison of OODBMSs and ORDBMSs When to use an OODBMS When to use an ORDBMS

REMINDER OF THE PROBLEMS ASSOCIATED WITH AN RDBMS

RELATIONAL DBMSs Poor representation of ‘real world’ entities. Semantic overloading. Poor support for integrity and business constraints. Homogeneous data structure. Limited operations. Difficulty handling recursive queries. Impedance mismatch. Difficulty with ‘Long Transactions’. PROBLEMS

WHAT IS AN OODBMS?

OODBMS

OBJECT ORIENTED DATABASE MANAGEMENT SYSTEM OODBMS WHAT IS AN OODBMS? Object Oriented Database Management Systems (OODBMSs) are an attempt at marrying the power of Object Oriented Programming Languages with the persistence and associated technologies of a DBMS. OBJECT ORIENTED DATABASE MANAGEMENT SYSTEM OOPLs DBMSs   Complex Objects Persistence Object Identity Disc Management Methods & Messages Data Sharing Inheritance Reliability Polymorphism Security Extensibility Ad Hoc Querying Computational Completeness

THE OO DATABASE MANIFESTO OODBMS THE OO DATABASE MANIFESTO CHARACTERISTICS THAT ‘MUST BE’ SUPPORTED ·     Complex objects ·     Object Identity ·     Encapsulation ·     Classes ·     Inheritance ·     Overriding and late-binding ·     Extensibility ·     Computational completeness ·     Persistence ·     Concurrency ·     Recovery ·     Ad-hoc querying  

REQUIREMENTS AND FEATURES OODBMSs Requirements: Transparently add persistence to OO programming languages Ability to handle complex data - i.e., Multimedia data Ability to handle data complexity - i.e., Interrelated data items Add DBMS Features to OO programming languages Features: The host programming language is also the DML. The in-memory and storage models are merged. No conversion code between models and languages is needed. REQUIREMENTS AND FEATURES

TWO-LEVEL STORAGE MODEL FOR A RDBMS Main or virtual memory Transforming and type checking SQL Secondary storage

ACCESSING A RECORD USING AN RDBMS Page Application memory 3. Access object Record 4. Copy modified fields 2. Copy relevant fields Page Cache DBMS Record 5. Save page 1. Read page Page Secondary Storage Record

SINGLE-LEVEL STORAGE MODEL FOR AN OODBMS Main or virtual memory Secondary storage

ACCESSING AN OBJECT USING AN OODBMS 3. Access object Page Application memory 2. Swizzle pointers, etc. 4. Swizzle pointers back, etc. Object 5. Save page 1. Read page Page Secondary Storage Object

ADVANTAGES AND DISADVANTAGES OF AN OODBMS?

OODBMSs Enriched modelling capabilities Extensibility Removal of Impedance Mismatch Support for schema evolution. Support for long duration transactions. Applicable for advanced database applications Improved performance. ADVANTAGES

OODBMSs Lack of a universal data model Lack of experience Lack of standards. Ad-hoc querying compromises encapsulation. Locking at object-level impacts performance Complexity Lack of support for views Lack of support for security DISADVANTAGES

WHAT IS AN ORDBMS?

In essence ORDBMSs are an attempt to add OO to Tables! Definition: Object-Relational databases extend the Relational Data Model to address those weaknesses identified previously. An Object-Relational database adds features associated with object-oriented systems to the Relational Data Model. WHAT IS AN ORDBMS? In essence ORDBMSs are an attempt to add OO to Tables!

MAJOR DIFFERENCE BETWEEN AN ORDBMS AND AN OODBMS ORDBMSs MAJOR DIFFERENCE BETWEEN AN ORDBMS AND AN OODBMS OODBMSs try to add DBMS functionality to one or more OO programming languages. REVOLUTIONARY IN THAT THEY ABANDON SQL ORDBMSs try to add richer data types and OO features to a relational DBMS. EVOLUTIONARY IN THAT THEY EXTEND SQL

SQL3

ORDBMSs SQL3 or SQL/99: SQL3 is a superset of SQL/92, in that it supports all of the constructs supported by that standard, as well as adding new ones of its own. Therefore, whatever worked in an implementation of SQL/92 should also work in an implementation of SQL3. WHAT IS SQL3? HOWEVER, IT SHOULD BE NOTED THAT AS YET THERE ARE NO IMPLEMENTATIONS OF SQL3!

ORDBMSs Extended Base Types. Row Types. User-Defined Types. User-Defined Routines. Sub-Types and Super-Types. Sub-Tables and Super-Tables. Reference Types and Object Identity. Collection Types. WHAT IS NEW IN SQL3?

SQL3 - EXTENDED BASE TYPES ORDBMSs SQL3 - EXTENDED BASE TYPES ONE OF THE REASONS FOR THE MOVE AWAY FROM RDBMSs IS THE LIMITED BASE TYPE AVAILABILITY: BASE TYPES AVAILABLE IN SQL/92 INCLUDE: NUMBER, CHAR, DATE, ... BASE TYPES IN SQL3 ARE EXTENSIBLE. THEREFORE THE FOLLOWING MUCH NEEDED TYPES COULD BE ADDED (PROVIDED SOMEBODY CREATES THEM!) VIDEO, IMAGE, AUDIO, TEXT, SPATIAL, TEMPORAL, GEOGRAPHIC, WEB-PAGES, ...

ORDBMSs SQL3 - ROW TYPES OXFORD MARSDEN HIGH ST. 30 LONDON LEYTON CITY AREA STREET ADDRESS OXFORD MARSDEN HIGH ST. 30 LONDON LEYTON HIGH RD. 20 BARKING MAIN ST. 10 BRANCHNO CREATE TABLE branch ( branchno VARCHAR(3), address ROW ( street VARCHAR(25), area VARCHAR(15), city VARCHAR(15)); COLUMN ATTRIBUTES NO LONGER HAVE TO BE ATOMIC!

SQL3 - USER-DEFINED TYPES ORDBMSs SQL3 - USER-DEFINED TYPES CREATE TYPE person_type AS ( PRIVATE date_of_birth DATE CHECK (date_of_birth > DATE ‘1900-01-1901’), PUBLIC name VARCHAR(15) NOT NULL, address VARCHAR(50) NOT NULL, tel_no VARCHAR(13) NOT NULL, FUNCTION get_age (P person_type) RETURNS INTEGER /* code to calculate age from date_of_birth */ RETURN END) NOT FINAL; An example of a User-Defined Routine (UDR)

SQL3 - SUB-TYPES & SUPER-TYPES Multiple Inheritance is allowed! ORDBMSs SQL3 - SUB-TYPES & SUPER-TYPES PERSON-TYPE date of birth name address tel-no get_age() STAFF-TYPE sno position salary branch is_manager() Sub-Types and Super-Types are used to allow for INHERITANCE in SQL3 A Sub-Type can inherit from more than one Super-Type. Multiple Inheritance is allowed!

SQL3 - SUB-TYPES & SUPER-TYPES ORDBMSs SQL3 - SUB-TYPES & SUPER-TYPES CREATE TYPE staff_type UNDER person_type AS ( sno VARCHAR(5) NOT NULL UNIQUE, position VARCHAR(10) NOT NULL, salary NUMBER(7,2), bno VARCHAR(3) NOT NULL, CREATE FUNCTION is_manager (s STAFF_TYPE) RETURNS BOOLEAN BEGIN IF s.position = ‘Manager’ THEN RETURN TRUE; ELSE RETURN FALSE; END IF END) NOT FINAL; Another example of a User-Defined Routine (UDR)

ORDBMSs SQL3 - TYPES & TABLES In order to remain upwardly compatible with SQL-92, TYPES can ONLY be instantiated through SQL Tables! Therefore, in order to create instances of a type we first have to create a table to store those instances in! CREATE TABLE staff OF STAFF_TYPE ( PRIMARY KEY sno); EXAMPLE: In order to create staff instances we first have to do one of the following: CREATE TABLE staff ( info STAFF_TYPE,

ORDBMSs SQL3 - SUB-TABLES & SUPER-TABLES PROBLEM - What happens if we create two or more tables for the same TYPE? How do we find all TYPE instances? CREATE TABLE lecturer OF STAFF_TYPE ( PRIMARY KEY sno); EXAMPLE: FIND ALL MEMBERS OF STAFF! CREATE TABLE admin OF STAFF_TYPE ( The only way of doing this is to declare the lecturer and admin tables as sub-tables of a staff super-table!

SQL3 - SUB-TABLES & SUPER-TABLES ORDBMSs SQL3 - SUB-TABLES & SUPER-TABLES SUPER-TABLE CREATE TABLE staff OF STAFF_TYPE ( PRIMARY KEY sno); SUB-TABLES CREATE TABLE lecturer OF STAFF_TYPE UNDER staff ( PRIMARY KEY sno); CREATE TABLE admin OF STAFF_TYPE UNDER staff ( PRIMARY KEY sno); SOLUTION TO PROBLEM (FIND ALL STAFF): SQL> SELECT * FROM staff;

SQL3 - REFERENCE TYPES AND OIDS ORDBMSs SQL3 - REFERENCE TYPES AND OIDS A Reference Type is the SQL3 equivalent of an OID in an OODBMS. Reference Types allow a row to be shared among multiple tables, and enable users to replace complex join operations with path expressions! EXAMPLE: CREATE TYPE staff_type UNDER person_type AS ( sno VARCHAR(5) NOT NULL UNIQUE, position VARCHAR(10) NOT NULL, salary NUMBER(7,2), next_of_kin REF(person_type) bno VARCHAR(3) NOT NULL) NOT FINAL; CREATE TABLE person OF person_type ( oid REF(person_type) VALUES ARE SYSTEM GENERATED); Could point to a row in ANY table containing a person_type!

SQL3 - REFERENCE TYPES AND OIDS ORDBMSs SQL3 - REFERENCE TYPES AND OIDS To ensure that a REFERENCE is limited to a single table, a SCOPE has to be added to the table using the REFERENCE! CREATE TYPE staff_type UNDER person_type AS ( sno VARCHAR(5) NOT NULL UNIQUE, position VARCHAR(10) NOT NULL, salary NUMBER(7,2), next_of_kin REF(person_type) bno VARCHAR(3) NOT NULL) NOT FINAL; CREATE TABLE person OF person_type ( oid REF(person_type) VALUES ARE SYSTEM GENERATED); EXAMPLE: CREATE TABLE staff OF staff_type ( PRIMARY KEY sno, SCOPE FOR next_of_kin IS person); staff next_of_kin will point to a row in the person table!)

ORDBMSs SQL3 - COLLECTION TYPES SQL3 COLLECTION TYPES ARE THE EQUIVALENT OF COLLECTION TYPES IN OODBMSs List (base) - ordered collection allows duplicates Array (base) - one-dimensional array, max no. Set (base) - unordered collection, no duplicates Multiset(base) - unordered collection, allows duplicates KNOWN AS A ‘BAG’ IN AN OODBMS!

REPEATING GROUPS ARE ALLOWED! ORDBMSs SQL3 - COLLECTION TYPES EXAMPLE CREATE TABLE branch ( bno NUMBER(3), address ROW ( street VARCHAR(15), area VARCHAR(15), city VARCHAR(15) staff SET (STAFF_TYPE)); THE USE OF COLLECTION TYPES WITHIN TABLES ENSURE THAT TABLES NO LONGER HAVE TO BE IN 1NF REPEATING GROUPS ARE ALLOWED!

ORDBMSs SQL3 - OTHER ADDITIONS THE MAIN ADDITIONS TO SQL THAT ARE NOT SPECIFICALLY ASSOCIATED WITH ADDING OBJECT-SUPPORT ARE THE FOLLOWING: SQL IS NOW COMPUTATIONALLY COMPLETE PERSISTENT STORED MODULES ARE SUPPORTED TRIGGERS ARE SUPPORTED

OODBMS or ORDBMS?

OODBMS or ORDBMS CONSIDERATIONS OODBMS - put more emphasis on the role of the client, i.e., Client side caching! This can radically improve long, process intensive, transactions. ORDBMS - SQL is still the language for data definition, manipulation and query – Still have Impedance Mismatch! OODBMSs have been optimised to directly support object-oriented applications and specific OO languages. ORDBMSs are supported by most of the ‘major players’ in the DBMS market place.

OODBMS or ORDBMS CONSIDERATIONS ORDBMS - Most third-party database tools are written for the relational model (SQL-92), and will therefore be backward-compatible with SQL3. ORDBMS - search, access and manipulate complex data types in the database with standard SQL (SQL3), without breaking the rules of the relational data model. OODBMS – The ODMG standard group’s OQL is now the de-facto query language amongst OODBMS vendors. However, in order to use it, collection objects (known as extents) have to first be created for each class.

OODBMS or ORDBMS CONSIDERATIONS OODBMS - In order to realise the value of an OODBMS you must build your application using methods written in one of several object-oriented language (i.e. C++, Java, Smalltalk).

WHEN TO USE AN OODBMS

OODBMS or ORDBMS In applications that generally retrieve relatively few (generally physically large) highly complex objects and work on them for fairly long periods of time. This will necessitate the use of client caching, pointer swizzling, and non-locking forms of concurrency control. WHEN TO USE AN OODBMS

WHEN TO USE AN ORDBMS

OODBMS or ORDBMS In applications that process a large number of short-lived (generally ad-hoc query) transactions on data items that can be arbitrarily complex in structure. Where the main emphasises is on efficient query optimisation to limit disk accesses, and traditional concurrency control is acceptable. WHEN TO USE AN ORDBMS