Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Entity–attribute–value model wikipedia , lookup
Extensible Storage Engine wikipedia , lookup
Serializability wikipedia , lookup
Clusterpoint wikipedia , lookup
Functional Database Model wikipedia , lookup
Relational model wikipedia , lookup
Concurrency control wikipedia , lookup
Object Oriented DB Chapter Three Traditional DB & Object Oriented DB Dr. Ayman Mostafa 1 Levels of Database (1) Traditional DB & OODB (2) Transaction Management & Concurrency Control (3) Performance tuning & query optimization (4) Distributed DBMS (5) Big Data 2 Agenda 1. Properties of Relational DB. 2. Features of Object Oriented DB. 3. Advantages of Object Oriented DB. 4. OODBMS and RDBMS Comparison. 5. Reasons of not using OODBMS publically. 6. Concurrency Control. 3 Agenda 1. Properties of Relational DB. 2. Features of Object Oriented DB. 3. Advantages of Object Oriented DB. 4. OODBMS and RDBMS Comparison. 5. Reasons of not using OODBMS publically. 6. Concurrency Control. 4 1. Properties of Relational DB. 1) Values are atomic 2) Each row is unique. 3) Column values are of the same kind. 4) The sequence of columns is insignificant. 5) The sequence of rows is insignificant. 6) Each column has a unique name. 5 Agenda 1. Properties of Relational DB. 2. Features of Object Oriented DB. 3. Advantages of Object Oriented DB. 4. OODBMS and RDBMS Comparison. 5. Reasons of not using OODBMS publically. 6. Concurrency Control. 6 2. Features of Object Oriented DB • Object oriented DB is the combination of object oriented programming and persistent systems. • The power of OODB comes from the treatment of both persistent data ( as found in Database ) and transient data ( as found in executing program ). 7 2. Features of Object Oriented DB • Objects are basically consist of the following: 1. Attributes – are data which defines the characteristics of an object. This data may be simple such as integer, strings, and real numbers or it may reference to a complex object such as arrays. 8 2. Features of Object Oriented DB 2. Methods – define the behavior of an object and are what was formally called procedures or functions. With traditional database, data manipulated by the application is transient and data in the database is persisted ( stored in permanent storage in DB ). In object database, the application can manipulate both transient and persistent data. 9 Agenda 1. Properties of Relational DB. 2. Features of Object Oriented DB. 3. Advantages of Object Oriented DB. 4. OODBMS and RDBMS Comparison. 5. Reasons of not using OODBMS publically. 6. Concurrency Control. 10 3. Advantages of Object Oriented DB. 1. Capable to handle different types of data types. 2. Combination of OOP and database technology. 3. Improve Productivity. 4. Data Access. 5. Enriched modelling capabilities. 6. Extensibility. 7. Removal of impedance mismatch. 8. Support for schema evolution. 9. Applicability to Advanced database applications. 10. No primary keys. 11 3. Advantages of Object Oriented DB. 1. Capable to handle different types of data types An object oriented database can store any type of data including text, numbers, pictures, video and voice. 2. Combination of OOP and database technology The object oriented database technology combines object oriented programming with the database technology to provide an integrated application development system. There are many advantages of including the definition of operations with the definition of data. First the operations which are defined are applied and are not depending on the specific database application running at the moment. Second the data types can be extended to support complex data. 12 3. Advantages of Object Oriented DB. complex data types Declaration struct Account { int account_number; char *first_name; char *last_name; float balance; }; 13 3. Advantages of Object Oriented DB. 3. Improve Productivity • Inheritance allows programmers to develop solutions to complex problems by defining the new objects in terms of defined objects in the past. Polymorphism and dynamic binding allows programmers to define operations for one object and then to share the specification of the operation with other object. 14 3. Advantages of Object Oriented DB. 4. Data Access • Object oriented databases represent relationships explicitly supporting both navigational and associative access to information. 15 3. Advantages of Object Oriented DB. 5. Enriched modelling capabilities The object oriented data mode allows the ‘real world’ to be modeled more closely. An object can store all relationships that it has with other objects including many-to-many relationships and objects can be formed into complex objects that the traditional data model cannot cope with easily. 16 3. Advantages of Object Oriented DB. 6. Extensibility OODBMSs allow new data types to be built from existing data types. The ability to factor out common properties of several classes and form them into a super class that can be shared with subclass can greatly reduce redundancy within system. 17 3. Advantages of Object Oriented DB. 7. Removal of Impedance mismatch A single language between Data Manipulation Language (DML) and the programming language overcomes the Impedance mismatch. This eliminates many of the efficiencies that occur in mapping a declarative language such as SQL to an imperative language ‘C’. 18 3. Advantages of Object Oriented DB. 8. Support for schema evolution: The tight coupling between data and applications in OODBMSs makes schema evolution more feasible. 9. Applicability to advanced database applications There are many areas where traditional DBMSs have not been used, such as Computer Aided Design (CAD), Computer Aided Software Engineering (CASE), Office Information System (OIS), and Multimedia systems. The enriched modeling capabilities of OODBMSs have made them suitable for these applications 19 3. Advantages of Object Oriented DB. 10. No Primary Keys In an OODBMS, the unique identification of objects is done behind the scenes via OIDs and is completely invisible to the user. 20 Agenda 1. Properties of Relational DB. 2. Features of Object Oriented DB. 3. Advantages of Object Oriented DB. 4. OODBMS and RDBMS Comparison. 5. Reasons of not using OODBMS publically. 6. Concurrency Control. 21 4. OODBMS and RDBMS Comparison. 22 4. OODBMS and RDBMS Comparison. 23 Agenda 1. Properties of Relational DB. 2. Features of Object Oriented DB. 3. Advantages of Object Oriented DB. 4. OODBMS and RDBMS Comparison. 5. Reasons of not using OODBMS publically. 6. Concurrency Control. 24 5. Reasons of not using OODBMS publically 1. Lack of Universal Data Model There is no universally agreed Data Model for OODBMS and most models lack of theoretical foundation. This disadvantage is seen as significant drawback and is compared to pre-relational system 2. Lack of Experience: In comparison to RDBMSs the use of OODBMSs is relatively limited. This means that we don’t have level of experience that we have with traditional system. 25 5. Reasons of not using OODBMS publically 3. Lack of Standards There is a general lack of standards of OODBMS. There is no standard Object Oriented Query Language. 4. People awareness about OODBMS People are not aware about the Object Oriented Database and therefore OOD had not been expanded into the business field. 26 Summary • Relational systems: simple data types, powerful query languages, high protection. • Persistent programming language-based OODBs: complex data types, integration with programming languages, high performance. • Object-Relational systems: complex data types, powerful query languages, high protection. 27 Agenda 1. Properties of Relational DB. 2. Features of Object Oriented DB. 3. Advantages of Object Oriented DB. 4. OODBMS and RDBMS Comparison. 5. Reasons of not using OODBMS publically. 6. Concurrency Control. 28 6. Concurrency Control The objective of concurrency control is to ensure the serializability of transactions in a multiuser database environment. Concurrency control is important because the simultaneous execution of transactions over a shared database can create several data integrity and consistency problems. 29 6. Concurrency Control A. Lost updates B. Uncommitted Data C. Inconsistent Retrievals D. Scheduler 30 A. Lost updates The lost update problem occurs when two concurrent transactions, T1 and T2, are updating the same data element and one of the updates is lost (overwritten by the other transaction). 31 A. Lost updates 32 A. Lost updates The addition of 100 units is “lost” during the process. 33 B. Uncommitted Data Uncommitted data occurs when two transactions, T1 and T2, are executed concurrently and the first transaction (T1) is rolled back after the second transaction (T2) has already accessed the uncommitted data—thus violating the isolation property of transactions. 34 B. Uncommitted Data 35 B. Uncommitted Data 36 C. Inconsistent Retrievals Inconsistent retrievals occur when a transaction accesses data before and after another transaction(s) finish working with such data. For example, an inconsistent retrieval would occur if transaction T1 calculates some summary (aggregate) function over a set of data while another transaction (T2) is updating the same data. The problem is that the transaction might read some data before they are changed and other data after they are changed, thereby yielding inconsistent results. 37 C. Inconsistent Retrievals 1. T1 calculates the total quantity on hand of the products stored in the PRODUCT table. 2. At the same time, T2 updates the quantity on hand (PROD_QOH) for two of the PRODUCT table’s products. 38 D. Scheduler The scheduler is a special DBMS process that establishes the order in which the operations within concurrent transactions are executed. The scheduler interleaves the execution of database operations to ensure serializability and isolation of transactions. To determine the appropriate order, the scheduler bases its actions on concurrency control algorithms, such as locking or time stamping methods. 39 D. Scheduler 40