Title: Object Databases
1Object Databases
- ???
- OCIT
- pychang_at_ocit.edu.tw
2Reference
- 1.Object-Relational DBMSstracking the next
great wave by Michael. StoneBraker Paul.
Brown,1999 - 2.Object Databases An ODMG Approach by Richard
Cooper,1997 - 3.Fundation for Object/Relational Databases the
third Manifesto, by C. J. Date, 1998
3Chapter 1
- Developments in database technology
4What is a database system?
- A DBMS is a coordinated package of software which
permits large amount of structured data to be
managed.
5Facilities of a DBMS
- Application generality. The DBMS will be able to
handle data from many different application areas
equally easily. - Efficient data access. The data will be stored in
such a way that it can be accessed as quickly as
possible. - Security. There will be privacy mechanisms
securing the data against unauthorized access and
misuse. - Data consistency Any changes made to the data
will be organized in such a way that the database
always remains consistent, i.e. no changes will
be allowed to violate the organization imposed on
the data by the database designer.
6Facilities of a DBMS
- Resilience. Hardware or software failures while
the database is running are never allowed to make
the database inconsistent - at most a few of the
most recent changes will be lost if the system
crashes. - Concurrency control. Many users can access the
database at the same time without interfering
with each others work. - Multiple views. There will be a facility for
providing apparently different or more focused
representations to different kinds of user. - Integrity. There may be the facility for imposing
integrity constraints which limit the values
which the database can take - thus maintaining
the meaning of the information stored - Distribution. It may be possible for the DBMS to
handle data which is distributed across more than
one computer joined in a local network or even
across a number of sites joined in a wider
network.
7Facilities of a DBMS
- User interfaces. Appropriate user interfaces will
be provided to allow databases to be designed and
used by a wide variety of users. Among these will
be - Parametric interfaces. Eg. Automated teller
machines (ATMs) provide the most prevalent
example of this kind of interface. - Ad hoc querying. The DBMS will provide a general
purpose query language which gives users a fairly
simple textual method for specifying the database
structure updates to data and retrievals of data
from the database. - Graphical interfaces. In order to simplify the
interaction, there are a variety of emerging
interface styles including node-and-arc graphs to
represent the data structure - Programming interfaces.
- Administrative interfaces.
8(No Transcript)
9Logical data model
- A data model is a set of constructs for
describing data - The logical data model describes the structure
data at the conceptual layer. - To create a database, its structure must be
specified using the modeling constructs
available. Such a specification is called a
schema.
10Transaction
- A transaction consists of one or more changes to
the database which take the database which take
the database from one consistent state to
another. - Properties of transaction
- Atomicity. If a transaction is made up of a
number of component updates, then every update
must take effect or none of them should. The sum
of money must not be debited without being
credited or vice versa. - Consistency. The total effect of all of the
components of the transaction must take the
database from one consistent state to another.
The total sum of money represented in the
database must remain unchanged. - Isolation. Each transaction must not affect the
smooth and correct running of any other
transaction. Thus no two transactions are allowed
to try to change the same account at the same
time, for fear of corrupting each other. - Durability. After the transaction has
successfully completed, nothing will permit the
changes made to be lost - not even a system crash
11Record-based DMBS
- Network DBMS
- Relational DBMS
12(No Transcript)
13(No Transcript)
14New applications areas
- CAD (computer aided design) CAE(computer aided
engineering) CIM(computer integrated
manufacturing) - CASE(computer aided software emgineering)
- OIS(Office information system)
- GIS(geographic information system)
- WWW
15Shortcomings of record-based DBMS
- No direct support for
- Hierarchies (part-of or is-a).
- Advanced data types (spatial, multimedia).
16ER model for relational database
17EER involves inheritance
18Derived data type TAXIS
- PERSON_CLASS PERSON with
- keys person_id (name, address)
- characteristics name PERSON_NAME
- address
ADDRESS_VALUE - phone
PHONE_VALUE - attribute_properties age AGE_VALUE
- sex
SEX_VALUE - end
19Object Databases
- Motivation to overcome weaknesses of relational
approach - Richer data models.
- Closer integration with programming languages.
20Kinds of object database
- Object relational (Oracle, DB2, PostgreSQL).
- Programming language centred (Objectivity,
FastObjects, Versant, ObjectStore).
21Object Database Standards
- SQL-99(SQL-3)
- Mainstream SQL standard.
- Oracle, DB2, Informix.
- Object data management group (ODMG)
- Outgoing mainstream object database standard.
- Objectivity, FastObjects, Versant.
- Java data objects (JDO)
- Java-specific object-based database access.
- Poet, Versant, ObjectStore, SolarMetric,
22A Matrix for classifying database application
23Quadrant1simple data without queries
- cases text editor, VOD (video on demand)
- Database simple file system
24Quadrant2simple data with queries
- database relational database
- standard SQL-99
25Quadrant2simple data with queries
- Create table dept (
- dname varchar(20,
- budget float,
- floor int)
- create table emp (
- name varchar (30),
- startdate date,
- salary float,
- dept varchar(20))
- Find the names of employees with an employment
start date after 1980 and who earn more than
40,000 - Select name from emp where startdategt
1980-12-31 and salary gt 40000 - Find the names of employees who work on the 1st
floor - Select name from emp where dept in
- (select dname from dept where floor1)
- Find the average salary of employees in the
marketing department. - Select average(salary) from emp where
deptmarketing
26Quadrant2simple data with queries
- Comments
- Client tool Client tool (i.e. 4GL) to set up
forms for data entry and display is required. - Performance transaction mechanism two-phase
locking write-ahead log reduces performance. - Security/architecture
- Market crowded
27Quadrant3complex data without queries
- database object-oriented database
- standard ODMG, JDO
28Quadrant3complex data without queries
create table emp ( name varchar (30),
space polygon, adjacency set-of
(empolyee))
create table floors ( number int, asf
swiss_cheese_polygon)
- Objective arrange employees onto floors
-
main() read all employees read all
floors compact() write all
employees
main() compact()
29Quadrant3complex data without queries
- Comments
- Query language is not required.
- Client tools O-venders are expected to support
many functions like compact(). - Performance persistent object will slow down
performance. The user wishes to run no more than,
say, 10 shower than the nonpersistent case. - Security/architecture
- Market ltlt relational DB.
30Quadrant4complex data with queries
- database object-relational database (ORDB)
- standard SQL-99
31Quadrant4complex data with queries
- Example
- The state of California Department of Water
Resource (DWR) manages most of the waterways and
irrigation canals in California, as well as a
collection of aqueducts. To document their
facilities, DWR maintains a library of 35-mm
slides. Over time this library has grown to
500,000 slides and accessed many times a day by
DWR employees and others. - Problem clients usually requests a picture by
content, ex. sunset. But it is difficult to
find slides by content.
32Quadrant4complex data with queries
- Create table slides (
- id int,
- date date,
- caption document,
- picture photo_CD_image)
- Create table landmarks (
- name varchar(30),
- location point)
- Find the sunset picture taken within 20 miles of
Sacramento - Select id from slides P, landmarks L, landmarks S
- where sunset (P.picture) and contains
(P.caption, L. name) and - L.location S.location and S.nameSacramento
33(No Transcript)
34Quadrant4complex data with queries
- Comments
- Query language that allows user-defined functions
and operations (SQL-99). - Client tools Standard 4GLs are useless. Advanced
client tools are required. Ex. The case of DWR
requires Zoom in/out user tool. - Performance user-defined function might
time-consuming. Query optimizer is required. Ex - where sunset(image) and date lt 1985-01-01
- Security/Architecture client-server
- Market