Complex Data and Object-Oriented. Databases



Similar documents
Introduction to Object-Oriented and Object-Relational Database Systems

Object Oriented Databases (OODBs) Relational and OO data models. Advantages and Disadvantages of OO as compared with relational

OBJECTS AND DATABASES. CS121: Introduction to Relational Database Systems Fall 2015 Lecture 21

Overview RDBMS-ORDBMS- OODBMS

CS352 Lecture - Object-Based Databases

Object-Oriented & Object-Relational DBMS. Example App: Asset Management. An Asset Management Scenario. Object-Relational Databases

Object Relational Database Mapping. Alex Boughton Spring 2011

Object Oriented Design with UML and Java. PART XVIII: Database Technology

Object Oriented Databases. OOAD Fall 2012 Arjun Gopalakrishna Bhavya Udayashankar

Object Oriented Database Management System for Decision Support System.

The ObjectStore Database System. Charles Lamb Gordon Landis Jack Orenstein Dan Weinreb Slides based on those by Clint Morgan

NoSQL systems: introduction and data models. Riccardo Torlone Università Roma Tre

Course Notes on A Short History of Database Technology

Course Notes on A Short History of Database Technology

1 File Processing Systems

XXI. Object-Oriented Database Design

Database System Architecture & System Catalog Instructor: Mourad Benchikh Text Books: Elmasri & Navathe Chap. 17 Silberschatz & Korth Chap.

History of Database Systems

CS2Bh: Current Technologies. Introduction to XML and Relational Databases. Introduction to Databases. Why databases? Why not use XML?

Part VI. Object-relational Data Models

Services. Relational. Databases & JDBC. Today. Relational. Databases SQL JDBC. Next Time. Services. Relational. Databases & JDBC. Today.

ICOM 6005 Database Management Systems Design. Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 2 August 23, 2001

OBJECT ORIENTED EXTENSIONS TO SQL

Object-Oriented Databases

Object Database Tutorial

10. Creating and Maintaining Geographic Databases. Learning objectives. Keywords and concepts. Overview. Definitions

Database Management Systems: Relational, Object-Relational, and Object-Oriented Data Models COT/4-02-V1.1

Schema Evolution in SQL-99 and Commercial (Object-)Relational DBMS

Object-persistence formats. Files. Object-oriented databases. Data management layer design. Relational databases. Relational Database Example.

Java Universal Binding: Storing Java Objects in Relational and Object-Oriented Databases

Database Administration with MySQL

2. Background on Data Management. Aspects of Data Management and an Overview of Solutions used in Engineering Applications

Raima Database Manager Version 14.0 In-memory Database Engine

Database Design and Programming

Modern Databases. Database Systems Lecture 18 Natasha Alechina

database abstraction layer database abstraction layers in PHP Lukas Smith BackendMedia

Introduction to Database Systems. Chapter 1 Introduction. Chapter 1 Introduction

Week 1 Part 1: An Introduction to Database Systems. Databases and DBMSs. Why Use a DBMS? Why Study Databases??

Geodatabase Programming with SQL

Oracle9i Database and MySQL Database Server are

Introduction to Object-Relational Database Development

Chapter 9: Object-Based Databases

What is a database? COSC 304 Introduction to Database Systems. Database Introduction. Example Problem. Databases in the Real-World

Increasing Driver Performance

U III 5. networks & operating system o Several competing DOC standards OMG s CORBA, OpenDoc & Microsoft s ActiveX / DCOM. Object request broker (ORB)

1. INTRODUCTION TO RDBMS

SQL Tables, Keys, Views, Indexes

How To Create A Table In Sql (Ahem)

Introduction. Introduction: Database management system. Introduction: DBS concepts & architecture. Introduction: DBS versus File system

Chapter 6: Physical Database Design and Performance. Database Development Process. Physical Design Process. Physical Database Design

Chapter 1: Introduction. Database Management System (DBMS) University Database Example

What is Data Virtualization?

Handling Unstructured Data Type in DB2 and Oracle

Introduction: Database management system

Duration Vendor Audience 5 Days Oracle Developers, Technical Consultants, Database Administrators and System Analysts

Optimizing Performance. Training Division New Delhi

2.1.5 Storing your application s structured data in a cloud database

CSCI 253. Object Oriented Programming (OOP) Overview. George Blankenship 1. Object Oriented Design: Java Review OOP George Blankenship.

ObjectOrientedDatabaseManagementSystemsConceptsAdvantagesLimitationsandComparativeStudywithRelationalDatabaseManagementSystems

Availability Digest. Raima s High-Availability Embedded Database December 2011

The Relational Model. Ramakrishnan&Gehrke, Chapter 3 CS4320 1

Storage in Database Systems. CMPSCI 445 Fall 2010

SQL Server for developers. murach's TRAINING & REFERENCE. Bryan Syverson. Mike Murach & Associates, Inc. Joel Murach

OBJECTSTUDIO. Database User's Guide P

Unified XML/relational storage March The IBM approach to unified XML/relational databases

White Paper. Optimizing the Performance Of MySQL Cluster

Applying Object Oriented Concepts to RDBMS

Java (12 Weeks) Introduction to Java Programming Language

Oracle BI EE Implementation on Netezza. Prepared by SureShot Strategies, Inc.

Abstract. For notes detailing the changes in each release, see the MySQL for Excel Release Notes. For legal information, see the Legal Notices.

Physical Design. Meeting the needs of the users is the gold standard against which we measure our success in creating a database.

Fact Sheet In-Memory Analysis

SQL Server 2014 New Features/In- Memory Store. Juergen Thomas Microsoft Corporation

DATA BASE.

Object Relational Mapping for Database Integration

Object-Oriented Databases Course Review

Chapter 1 Fundamentals of Java Programming

Using Object Database db4o as Storage Provider in Voldemort

5.5 Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall. Figure 5-2

Choosing a Data Model for Your Database

Object-Oriented Databases db4o: Part 2

A Brief Introduction to MySQL

FROM RELATIONAL TO OBJECT DATABASE MANAGEMENT SYSTEMS

ECS 165A: Introduction to Database Systems

MyOra 3.0. User Guide. SQL Tool for Oracle. Jayam Systems, LLC

Seema Sundara, Timothy Chorma, Ying Hu, Jagannathan Srinivasan Oracle Corporation New England Development Center Nashua, New Hampshire

Overview of Databases On MacOS. Karl Kuehn Automation Engineer RethinkDB

Part 7: Object Oriented Databases

Object-Oriented Query Languages: Object Query Language (OQL)

Transcription:

Complex Data and Object-Oriented Topics Databases The object-oriented database model (JDO) The object-relational model Implementation challenges Learning objectives Explain what an object-oriented data model is. Describe data management problems for which relational databases are inadequate and for which object-oriented or object-relational are a better fit. 4/13/2010 1

Overview OODBMS intended as relational database killer. Many a good company went bankrupt trying to put the relational vendors out of business. Not as formal a framework as there is in other models (although they tried). Has achieved use through extensions to SQL standard (RDBMS became ORDBMS -- objectrelational database management systems). 4/13/2010 2

Key Concepts in an Object Model Complex data types: Video, Images, Audio More built-in types Ability to extend with user-defined types Inheritance Object identification Pointers and swizzling 4/13/2010 3

OODBMS Rationale People are used to developing in OO languages. Rather than add objects to SQL, why not add persistence to languages? There were a bunch of persistent foo implementations: persistent C++, persistent small-talk, etc. DO (which we ll talk about in a minute) is an example of a standard that adds persistence to Java. Beyond Persistent-Foo OO Languages don t necessarily have a query interface. Can certainly program queries, but part of the value of a DBMS is its ability to capture queries. The Object Database Management Group (ODMG) introduced the ODMG data model and the OQL (Object Query Language) and ODL (Object Data Language) 4/13/2010 4

ODMG Data Model The Basics Database is a collection of objects. Objects have unique OIDs. Database contains collections of objects with similar properties. Such a collection is called a class. Properties of a class are specified using ODL. OQL Designed to have SQL-like syntax. Looks a lot like SQL:99 Retains basic SELECT blah FROM blah WHERE structure. See book for examples. 4/13/2010 5

ODL Attributes are either atomic or structured. Support set (unordered), bag (duplicates OK), list, array, and struct types Relationships have a type that is either a reference to an object or a collection of references. Relationships capture relationship both within and among classes. Methods can be applied to objects in a class. Interfaces define a class. 4/13/2010 6

JDO: Java Data Objects Standard interface-based (API) way of adding persistence to Java. Like all things Java, this was a Sun-led standard. Two goals: Transparent, java-centric view of persistence Enable pluggable implementations of data stores into application servers Data is stored in a file system or enterprise information systems (i.e., Database Management Systems) Heterogeneity is fundamental: data can come from one or more storage instances. JDO operates on data of all sorts: Row from a database Object from an object database Result of a general query Entire persistent state must be encapsulated in a Java object. 4/13/2010 7

JDO Details Two standard interfaces: javax.jdo.persistencemanager javax.jdo.jdohelper The Persistence Manager provides Query management Transaction management Life cycle management (buffering and sending to stable storage) JDOHelper provides Bootstrap (acquire instance of PersistenceManagerFactory) Find out what classes are persistent-capable 4/13/2010 8

Using JDO JDO instances can be either transient or persistent. All persistent data must be in a JDO instance. All user classes and some system classes are persistent capable. First class objects are directly stored in a persistent store; have a unique JDO ID. Second class objects do not have a JDO ID and are stored only as a result of a referencing first class object being stored. Subclasses can be persistent even if superclass is not. 4/13/2010 9

JDO Persistent Capable Classes Must have a no-arg constructor Must implement the PersistCapable interface PersistCapable allows application to find out the state of an object (transient, dirty, etc). JDO instances can be declared transactional (optimistic or locked) Callbacks allow application to regain control when some JDO action occurs (e.g., when a JDO instance is about to be written to disk). jdopostload (after read from disk) jdoprestore (before write to disk) jdopredelete (before object is deleted) jdopreclear (restore default values) 4/13/2010 10

Query in JDO Java API for query and a query language (JDOQL) Once you have one object, you can navigate from there. Three ways to get the first object: Have or construct an Object ID Via iteration Construct and use a query object (JDOQL) JDOQL Query language neutral (e.g., must support SQL and others). Allow for optimization of query language. Support multi-tier architecture (i.e., you do not know exactly where the query will be performed). Large query results (i.e., may not fit into memory). Support compiled queries. Supports deletion via query. 4/13/2010 11

The Object-Relational Model The relational response to the object-oriented data model was that there was no need to reinvent the wheel. Instead, simply add what we need to the relational model. What do we need? New types: non-atomic columns, arrays, collections New types: user-defined types (to handle things like audio/video, etc.) Generalized extensibility 4/13/2010 12

SQL Arrays One-dimensional typed arrays: Attr-name type ARRAY[size] where type is a regular SQL type Examples: months varchar(8) ARRAY[12] ndays integer ARRAY[12] Operators on arrays size of the array: CARDINALITY(ndays) array access: ndays[i] 4/13/2010 13

SQL Structured Types Call a structured type (struct) a row: ROW(attr 1 type 1,..., attr n type n ) CREATE TYPE month_t AS ROW(name varchar(8), ndays int) REF IS mid SYSTEM GENERATED; In SQL 99, ids can be SYSTEM or USER Generated OR derived Example: CREATE TABLE calendar (year integer, months month_t ARRAY[12]); Operators Field access: calendar.year, calendar.months[4] An attribute can be a structured type OR a reference to a structured type: months REF(month_t), in which case we perform field access using ->: calendar->months[4] 4/13/2010 14

SQL Collection Types Not part of SQL:1999 listof(type) (ordered) operators: head, tail, append, prepend setof(type) no duplicates bagof(type) set w/dups Operators: count, min, avg, subset 4/13/2010 15

Abstract Data Types (ADTs) Allow users to define their own types Allow users to define methods that act upon their own types These types are opaque (abstract) from the point of view of the DBMS, but the DBMS will manipulate them using the methods provided by the user. Methods written in some language (e.g., Java) allowed by the DBMS on a given platform. Vendors sometimes sell packages of ADTs Informix (IBM) DataBlades (based on Postgres) Oracle Data Cartridges IBM DB2 Extenders Example: Consider a type for an image. Methods might include: crop, rotate, compress,thumbnail 4/13/2010 16

ADT Implementation Challenges Types/rows may be arbitrarily large. May vary tremendously in size How do you store these things efficiently? How do you index abstract types? How do you optimize queries when you don t fundamentally understand the underlying types? What if user-defined methods have bugs? 4/13/2010 17

Big Items: Blobs Blobs (Binary Large OBjects) are the classic approach. Internal representation: cram them somewhere in the database (i.e., BDB big objects) External representation: store them elsewhere and store reference to them. In files In long contiguous pages allocated directly on disk Treated as opaque objects. 4/13/2010 18

OO Approach to big items Stored externally. Treated as abstract data type (ADT). In addition to storing data, must have way to access, index, manipulate these large items. Provides fundamentally different functionality from blobs 4/13/2010 19

Structured Items Objects contain pointers How do you represent pointers on disk? Do you use the same representation in memory? Objects contain or are collections How do you represent collections? What if collections are sorted? What if they are arrays which implies a contiguous layout/allocation How do you handle changes in the size of the collection (both growing and shrinking)? 4/13/2010 20

How do you index ADTs? If the data type is completely abstract to the database, then you can t index it, can you? Allow applications to provide indexing techniques (more on this later). Even if the database knows about the type, do conventional indexes work? Hash tables provide what kind of lookups? B+-trees provide what kind of lookups? So, what do you do about other kinds of lookup: Image similarity Geospatial proximity (think Google earth) N-dimensional data Sub-spaces of N-dimensional data Query-by-humming Full text search 4/13/2010 21

Extensible Database Systems Fundamentally this means letting users add code to your database! Movement in the late 80 s/early 90 s Pioneered by Postgres Commercialized by Miro/Illustra (DataBlades) Key idea: let applications download methods, optimizer functions,indexing techniques into your data manager. Problems? 4/13/2010 22

Safe Extensions Interpreted instead of compiled Restricted to safe languages Post-processed to check safety Implemented as separate process (in separate address space) This was the early extensible system work and dovetails nicely with the emergence of safe languages and PCC 4/13/2010 23

Performance Considerations Pointers Caching Concurrency Cost estimation and the Optimizer 4/13/2010 24

Pointers Would like to use real pointers in memory, but must use OIDs on disk. How do you translate? Swizzling: The act of translating from disk addressing to memory addressing Disk addressing typically in terms of OID Memory addressing in terms of points Approaches Swizzle on access (keep table of OID-> memory mappings) Use virtual memory to trigger swizzle Swizzle on eviction 4/13/2010 25

Caching All DBMS systems rely on caching to provide reasonable performance. What is the unit of caching? Objects Pages Containers (large data segments containing potentially many objects) Granularity of caching dictates how much of the database resides on clients versus servers. Sometimes also useful to cache query results. 4/13/2010 26

Concurrency Probably want granularity for concurrency to equal granularity for caching. Concurrency granularity may be critical from a throughput point of view. 4/13/2010 27

Cost Estimation: Optimization How does the query processor account for ADTs? Register indexes and relevant statistics Provide callbacks and request user-defined functions provide data about distributions, counts, etc. 4/13/2010 28