Concurrency and Transaction Management in an Object...

23
Concurrency and Transaction Management in an Object Oriented Database Initial Presentation Author: Jeremy Torres Date: 5/30/2003

Transcript of Concurrency and Transaction Management in an Object...

Page 1: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

Concurrency and Transaction Management in an Object Oriented Database

Initial PresentationAuthor: Jeremy Torres

Date: 5/30/2003

Page 2: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

Agenda

Brief introduction to Object Oriented DatabaseDefinitions required for the discussion of concurrency and transaction managementDesired properties of a database management systemResearch Goals and ObjectivesWork PlanQ and A

Page 3: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

An Object Oriented Database…

Is the coupling of Object Oriented (OOP) Programming principles with Database Management System (DBMS) principlesProvides access to persisted objects using the same OO-programming language

Page 4: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

OODB and Relational DBDifferences2,6

Relational DB

Uses record-oriented modelData is a collection of record types (relations), each having collection of records or tuples stored in a file

Language independence (via SQL)Impedance mismatch in an OO application. Mapping must be performed

OODBUses an OO data model

Data is a collection of objects whose behavior, state, and relationships are stored as a physical entity

Language dependence (OO-Language Specific)No impedance mismatch in application using OODB

Page 5: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

Some OODBMS’s

CommercialFastObjects(formerly Poet)GemStoneVersantOntosObjectivity/DB

Open SourceOzoneXL2FramerDZope

AcademicObjectStore

Page 6: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

Definitions4 1 of 3Data Items—collection of objects representing a databaseGranularity—size of a data itemConcurrency—multiple users accessing a database instance at the same timeTransaction—a logical unit of database processing that includes one or more database access operations

Insert, Delete, Modify, Retrieve operationsSerializability—Interleaving execution of a set of concurrent transactions without “giving up any correctness”

Page 7: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

Definitions, 2 of 3

Concurrency Control Protocols—set of rules for defining the execution of concurrent transactions (ultimately to ensure serializability)

Optimistic Concurrency Control—validation or certification of a transaction AFTER it executes

If interference is detected, the transaction is aborted and restarted at a later time

Page 8: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

Definitions, 3 of 3

Pessimistic Concurrency Control—Locks are used to prevent conflicting transactions

2-Phase Locking Protocol (2PL): Best known locking protocol for guaranteeing serializability

Phase 1: Expanding/Growing. New locks can be acquired but none can be releasedPhase 2: Shrinking. Existing locks can be released but no new locks can be acquired

Strict 2PL—a transaction does not release any of its exclusive (write) locks until after it commits or aborts

Page 9: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

Database Management Systems Should…1 of 2

Provide Concurrency Control4The DBMS should allow more than one user to access/manipulate data concurrentlyWhen there is concurrency, TransactionManagement must be addressed

The Lost Update Problem—two transactions have their operations interleaved in such a way that some database item is incorrect—inconsistent state!The Temporary Update (Dirty Read) Problem—One transaction updates a database item and then the transaction fails; the updated item is access by another transaction before it is changed back to its original value

Page 10: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

Database Management Systems Should…2 of 2

Provide Transactions that have ACID properties4:Atomicity—a transaction is an atomic unit of work; it’s performed in its entirety or not at allConsistency preservation—a transaction takes database from one consistent state to anotherIsolation—a transaction should appear as though it is being executed in isolation from other transactionsDurability or permanency—the changes applied to the database by a committed transaction must persist in the database. The changes must not be lost because of any failure

Page 11: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

Concurrency and Transaction Management: OODBM’s vs. RDBM’s

Both DBMS’s must deal with Concurrency and Transaction Management issuesMany concurrency protocols can be applied to both DBMS’s

Optimistic and Pessimistic protocols are relevant to both

However, semantically different:Example: Data Item Granularity

In traditional RDBMS, fine granularity data item would be a record field value of a recordIn an OODBMS, fine granularity data item may be an Object or data member (field) of an Object

Page 12: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

Many OODB’s…Varying Frameworks

There are many OODBM’s existing and emerging in both commercial and open source areasImplementations vary differently

Distributed database modelCentralized database model“hybrid” implementation, such as Object-Relational Databases

Use Relational DBMS EngineUse Structured Query Language (SQL) or an extension of it for providing access to “Objects”

Currently, there is no consensus or clear specification for an OODMS as there was for a Relational DBMS (such as Codd’soriginal specification for a relational data model and query language)5

NOTE: The Object Data Management Group (ODMG) has a specification for portability; however, ODMG-specific object models and query languages are used.

Page 13: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

Study Rationale

My research has not found a generic, reusable design pattern for a transactional engine, or “layer”, geared specifically toward object oriented databases.Even though there are many varying implementations of object oriented databases, there are very few research papers (as found in the initial research phase) describing an complete transactional engine implementation

Page 14: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

Research Objectives/Goals

To design a flexible and extendable (“pluggable”) framework for concurrency and transaction management within the context of an object oriented database using the Java programming languageIdeally, the framework will be presented as a design pattern specifically for concurrency and transaction management of an Object Oriented database

Page 15: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

Research Objectives/Goals Cont’d

Provide various implementations of the framework, each providing different transactional properties (e.g., optimisticversus pessimistic locking), for the ObjectStore

Page 16: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

Research DesignThe generic framework proposed, designed, and implemented by this research will be compared against the strengths and weaknesses of other alternative implementations (e.g., the Gemstoneand Ozone object oriented databases) found during the research process The comparison will focus on the design and implementation of the concurrency and transactional software “layers” of an object oriented database only; the remaining “layers” are out of the scope of this research

Page 17: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

ObjectStore Project Current State

The ObjectStore Object Oriented Database is geared specifically for JavaDoes not contain transaction managementAccessible by remote clients via RMI

Page 18: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

High-Level Logical Diagram

Page 19: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database
Page 20: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

Issues To Be Addressed

Object Store is distributed via Java RMIThe framework proposed will have to account for each client’s state

Page 21: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

Work PlanPhase I: First Presentation, May 30th, 2003: The research for this first phase will be completed.Phase II: Summer I and II, 2003: Development and implementation of generic Concurrency/Transactional Model via the ObjectStore will be completedPhase III: Second Presentation, September 2003. Results of developed concurrency model and implementations via the object store presented.Completion: Final Presentation, November 2003. Demonstration of implemented framework via ObjectStore. All results of framework and implementations, including changes since second presentation.

Page 22: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

ReferencesMaier et al, Development of an Object-Oriented DBMS, ACM Press, 1986.2Zand et al, A Survey of Current Object-Oriented Databases, ACM Press, 19953Thomasian, Alexander, Concurrency Control: Methods, Performance, and Analysis, ACM Computing Surveys, 1998 4Elmasri, R., and Navathe, S, Fundamentals of Database Systems, Addison-Wesley, 2000.5Atkinson, et al, The Object-Oriented Database System Manifesto6Obasanjo, Dare, An Exploration of Object Oriented Database Management SystemsMcClure, Steve, Object Database vs. Object-Relational Databases, International Data Corporation

Page 23: Concurrency and Transaction Management in an Object ...students.depaul.edu/~jtorres4/se690/Presentation1.pdf · Concurrency and Transaction Management in an Object Oriented Database

Questions?