0% found this document useful (0 votes)
112 views182 pages

Advanced Data Base Mangement System

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
112 views182 pages

Advanced Data Base Mangement System

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 182
i | Advanced Database Management System (Code : 314445B) (Elective I) i Phule Pune U | Strictly as per the New Credit System Syllabus (2019 Course) Savitribai Phule Pune University w.e.f. academic year 2021-2022 Mahesh Mali Ph.D. (Computer Engineering) (Pursuing), ME. (Computer Engineering), B.B, (Information Technology), Oracle Certified PL/SQL Developer Associate (OCA), SAS Certified Data Analyst. Nannbai, Maharashtra, India, e 2O157A Price ¢295/- Wecieose UMMMSYLLABUS ‘Teaching Schem heory {TH} :03Hrs/Week | 03 Credits | Mia Semester: 30 Marks | End Semester : 70 Marks | and Object-oriented databases. To understand the fundamental concepts of Relati 2. To learn and understand various Parallel and Distributed Database Art itectures and Appitcations. 3. To understand and apply the basic concepis, categories and tools of NoSQL, Database. 4, To learn and understand Data warehouse and OLAP Architectures and Applications. To learn data mining architecture, algorithms, software tools and applications. To learn enhanced data models for advanced database applications. teens On completion of the course, students will be able to- CO1 : Understand relational and object-ariented databases. C02 : Learn and understand of parallel & distributed database architectures. C03 : Leama the concepts of NoSQL. Databases, CO4 : Understand data warehouse and OLAP technologies. Apply data mining algorithms and to learn various software tools. £06: Learn emerginy enhanced data .odels for advanced applications,jew of Relational Data Model Aitd Relational Database Constraints valet [96 hrs Relational model concepts, Relational model constraints and relational database schemas, Update| operations, anomalies, dealing with constraint violations, Types and violations. Overview of Object- Oriented Concepts ~ Objects, Basic properties. Advantages, examples, Abstract data types, Encapsulation, class hlerarchies, polymorphism examples. Unit fl | Parallel ana Distributed Databases Introduction to Parallel Databases, Architectures for parallel databases, Parallel query evaluation, Parallelizing individvat operations, Par 17) aptinizations, Introduction ‘0 distributed databases Distributed DEMS architectures, storing cata Distributed Query processing, Upda! at 1 @ Distributed DBMS, Distributed catalog data, Distributed ‘transactions, Distributed] (Refer Chapters 3 & 4) janagement, Concurrency control and Recovery Unit | NOSQL Databases oe ee [oe nrs| Introduction, Overview, and History of NoSQL Databases- The definition of Four Types of No SQ) Databases, NoSQL Key/Value Database: MongoDB, Column-Oriented Database: Apache Cassandr: Comparison of Relational and NoSQL databases, NoSQL, database Development Tools (Map Rediuce/Hivel and Programming Languages (XML/JSON) {Refer Chapter 5 | Unit IV. | Data Warehousing a Bes 2 £ _ | 06 nrs! Architectures and components of data warehouse, Characteristics and limitations of data warehouse, Data warehouse schema (Star, Snowflake), OLAP Architecture (ROLAP/MOLAP/HOLAP), Introduction to decision support system, Views and Decision support (Refer Chapter 6) Univ | Data Mining ees ‘06 hrs| Introduction to Data Mining, KDD seven step process, Architecture of data mining, Introduction to predictive and descriptive algorithms, Data mining software and applications, (Refer Chapter 7) Unit vi_| Enhanced Data Models for Advanced Applications. = 06 hrs Deductive Databases ~ jasie conc abase concepts and triggers; Temporal, Spatial, an datab Geographical Information Systems (Refer Chapter 8) | Nore Recent Applications: & aosoa (seep 1 Table of Contents [Syllabus : Relational model concepts, Relational model constraints and relational database schemas, Update operations] anomalies, dealing with constraint violations, Types and violations. Overview of Object- Oriented Concepts ~ Objects, Basi rties_ Advantages, examples, Abstract data types, Encapsulation, class hierarchies, polymorphism examples. Li Relational Data Model. os . enunemL Relation / Relational Table. ss ws scout cana eeanae vse AB 142 Ateibutes / Fields . a os - 12 13 Tuple / Records . 12 14 Domai . 12 12 janai Database Schema, 18 13.1 Types of constraint violations end Dealing with Constraints Violations 15 (4 Data Redundancy . - 18 15 Update Operation and Anomalies with Constraint violations. 19 Chaplet 27.” Objeet Onented Databanes me Teen 241 Object-Oriented Concepts inn. 22 Basic Properties , Advantages of OODBMS......-. 23° Objects. eceeecenereeeene 231 Characteristics of Object. 232 Attributes. 24 Literals ~ Abstract data Types 25 Object identity. 26 Object Structure... _— swine = 27 ‘Type Constructor nnnnsiinnninnnnnnnnnn 28 Encapsulation. 29 Persistence wenn 210 Class Hierarchies and Inheritance vonnannnnnn Peace rete eee cee a7 214 RDBMS, OODBMS and ORDBMS Comparisons... Object-Oriented DBMS (OODBMS) seinen nnn 2A Relational DBMS (RDBMS). Object-Relational DBMS (ORDBMS), 2-45 Differences between ODBMS, RDBMS and ORDBMS ... phison Examples.7 _avems (SPU) Table of Contents Syllabus = Introduction to Parallel Databases, Architectures for parallel databases, Parallel query evaluation, Parllelizing| individual operations, Parallel query optimizations, Introduction to distributed databases, Distributed DEMS architectures| storing data in a Distributed DBMS, Distributed catalog management, Distributed Query processing, Updating distributed data Distributed transactions Distbuted Concurrency control and Recovery. BA Parallel Databases Sytem unnsnmennon ~ oe 32 System Parameters / Measures af Performance — - eens Architeciire of Parallel Databases oa 1 Dist System 2s Set Y 43.2{0}, Hieraechieal Syseem. . — 34 Parallel Query Evaluation... : 7 Introduce eee 82 TYPES son 37 54.2(A}_ inter Query Pacalielism - os a7 34.2(8) Intra Query Parallelism... ne aoe 38 35 Parallel Query Optimization vveoenn - — : 38 354 Goals of Query Optimization nnn 352 Approaches of Query Optimtzation non vv conc 353 Traditional Query Optimizer a ove on B9 354 Parallel Query Optimizers 3.40 2.6 Virwalization in Multicore Processors 37 Partitioning ~ Parallel Query Optimization... - o3t 372 1s of Data Partitioning 27.2(8). Round Robin Partitoning . 3-14 3,7.2(B). Hash Partitioning, 3.7.2(G) Range Partitioning... sn es 3.7.8 Comparison.38 48 46 47 48 W_avans seu) 3 Table af Contents ee Parallelizing Individual Operations. 381 382 3.83 Distributed Databases System Concepts. 41.1 Features of Distributed Computing System --10-niernennnnn nent 2 41.2 Advantages of Distributed Database System... 412 Parallel v/s Distributed System ‘Types of Distributed Databa: Distributed DBMS Architectures. Data Fragmentation - Data Storage in Distributed datab: 441 Introduetion... 442 Fragmentation Schema. 443° Types of Data Pragmentatioi 44.3(A) Horizontal Fragmentation... 44.3(B) Vertical Fragmentation. 44.3(C) Mixed (Hybrid) Fragmentation «nnn Data Replication anne 45.1 Introduction .nn 452 — Goals. 453° Types. Data Allocation ~ Distributed Catalog Management... Distributed Databases Query Processing... 474 Data Transfer Costs 472 Distributed Query Processing Using Semi-join.. 4.73 Cost Based Query Optimisatiot Concurrency Problems in Distributed Databases Concurrency Control in Distributed Databases 49.1 Maintaining Distinguished Copy of a Data Item... 49.2 Voting MethasWavems Pe) 4 Table of Contents TiO Recovery in Distlbuted Databases 25 410.1 ‘Two Phase Commit Protocol for updating distributed data, 4.11 Distributed Transactions Processing... ied [Syllabus : Introduction, Overview, and History of NoSQL Databases- The definition of Four Types of No SQL Databases INoSQL Key/Value Database: MongoD8, Column-Oriented Database: Apache Cassandra, Comparison of Relational and NoSQL databases, NoSQL database Development Tools (Map Reduce/Hive) and Programming 52. introduction to NoSQL Database, : Sei SZ Four Types of NOSQL, Database nro : : 524 Benefits of Wasi 53 CAP Theorem (Brawer's Thee BAS coperites for NoSQL. Key/Value Database: MongoD, Comparative Study of RDBMS and NoSQL. (SQ 55.1 Advantages of NosQi, MapReduee mvnnsunnne 57 HIV Bonn 5.7. Architecture of Hive 5. Working of Hive un. 5.73 Hive Data Models. 5.8 Programming Language - XML. 58.1. Well Formed Docusient. 5.82 Valid XML DOCUBERS owennon : vo 5-18 5:9 Representation XML Objects = es 3-19 59.1 Types of XML documents se -- 5-26 592 XML.~Structured Data or Semi Structured Data =— 521 393 XMLDoe! ment Type Definition (DTD) vee eee 5.24W_avems seu) 5 Table of Contents Sd Cassano 528 SAN Cassandra Architect BF nn 5-30 541.2 Managing Data a 581 S.113 Data Caching and Tuning 5-31 S14 Data backup / Replicated Data mene se sn 32 [syimbus : Architectures and components of data warehouse, Characteristics and limitations of data warehouse, Data warehouse schema (Star, Snowflake), OLAP Architecture (ROLAP/MOLAP/HOLAP), Introduction to decision support system Views and Decision support ‘Chapter 6: Data Worehousing Ena Eeiwess 61 Need for Bata Warehouse - —— eonneaees6l 6.2 Gverview of Data Warehouse - 63 62.1 Characteristies of Data warehouse... sven 63 62.2 Advantages of Data Warehouses: — 8s 3 Disadvantages of Data Warehouses. ns) &3 Data Warehouse Components evs . 6-6 64 Data Warehouse Architecore.... 65 Data Warehouse and Data Mart... ~~ 65.1 Data Warehouse Design Strategy sma 66 Introduction to Dimensional Modeling... 6.6.1 Features of Good Dimensional Model 67 Fact Tables and Dimension Tables... 6-16 68 Multidimensional Schema Types... ven 2h 681 — StarSchema.n . . on 2h 682 Snowflake Schema... 6.8.3 Pact Constellation Schema / Galaxy Schema / Families of Star. = OLAP introduction : 68.4 Operational System (OLTP) vs Information System (OLAP).. 69.2 OLAP- Multidimensional Analysis / Hypercube. 628 OLAP Architectures. eee eer a oe 6-31 6.0. ROLAP (Relational OLAP) nnnsnnnnnen a 634 6102 MoLap, a — 5.102 Comparison between ROLAP and MOLAP, ee eee — 6-35 =aeeeeec 6 6104 HOLAP sone — 6.11 intreduction to decision support system, Views and Decision support...avons (sePu) 6 ‘Table of Contents Chapter 7 + Date Mining: 7. Introduction to Data Mining an. JAA Need for Data Mining vom 2 — JA.2 — Definition of Data Mint suneanone = eee eee 2) 3 Applications of Data Mining... secrnnen DB 7.2 KDD Seven Step Process / Data Warehousing Architecture. 73. Busine Intelligence and Decision Support System. oduction to Business intelligence. 5 Benefits ofa business intelligence system 732 The Bl system can be used to monitor or track following meas ponents 73.4(A) Architecture of Decision Support System(DSS)... = 7.3.4(B}_Diflerent Components of a Business Intelligent System. 735 Business Models and Business Analysis Framework from DW... 74 Descriptive Data Mining. ane TD 75 Predictive Data Mining-wou.m~ = 79 2.6 Data Mining Software and Application nn. 7 senna 9 [syllabus : Active database concepts and triggers; Temporal, Spatial, and Deductive Databases ~ Basic concepts. More Recent JApplications: Mobile databases; Multimedia databases; Geographical Information Systems; Genome data manageme Chapter 8; Enhanced Data Models for Advariced Applications y Bi toe3 84 Deductive Databases.nn = ~ sateen 84.1 Semantics: Factand Predicates. = — B12 Deductive Database Semantics : senna 82 Query Evaluation in Deductive database... : . 3 Deduetive Databases Prato: 84 Deductive Databases Ve RDBMS. - 6 8S Multimedia Databases,Wom serv) Table of Contents 86 87 88 38 ‘Spatial Databases. ‘Temporal Databases. Mobile Database.ens0 8.8.1 Mobile Computing Architecture... 882 Characteristics of Mobile Environments... Geographic Information System ee : B16 8.9.4 Representation of GIS data — : 847 892 Data Management Requirement ao a ete 894 CIS Applieatfons een - . B20 S38 Data Op: S86 Future issues in GIS, Genome data management.Relational Model Concepts | Relational model concepts, Relational model constrains and relational database schemas, Update operations ‘anomalies, dealing with constraint violations, Types and violations 1.3 _ Relational Data Mode! Introduction © The relational mode! was first proposed by €. F. Codd hence he is known as father of relational databases > Relational database was an attempt to simplify database siructure by making use of tables and columns. ables are known as “relations”, columns are known as “attributes” and rows (or records) are known as “tuples” © Relational Data Model Notations COLUMN —3 Row —»| TABLE 8 Sample Relational Schema Student table Course Table i Marks Table (aW EADEMs (sPPU) 1-2 Relational Model Concepts 1.11 Relation / Relational Table + Relations area logical structure, which is collection of tables consisting horizontal rows also called as tuples and vertical columns als called as Attributes, © This concept does not represent how the daa is stored in the physical memory of computer system © Each table in a database has its unique table name. © Characteristics of Relation © Atable composed of rows and columns. © Each table row (tuple) represents a single entity occurrence within the entity set led as aitvibute name, © Fach Cable column represents an attribute and each column has e distinct nam © Intersection of ro and column represents 2 single deta value also called es Domain © Allvalues in 2 same column must conform wo the same format of data 2 Each fable must have a single attribute or set of atbibutes that uniquely identifes azch rox Exampis 1 college database there is student table that contains all information about students, Student table L1.2 Attributes / Fields © Acolumn in above table represents data item stored in it, such column in database is called as attribute of a table. © Every table must have atleast one column in it. © Itis not possible to have multiple columns with same column name while itis possible to have twe calumns with same columa name but in two different tables. © The SQL standard does not specify any maximum number of columns ina table. Example :Id, Name, class are attributes of student table. 44.3 Tuple / Records A single tow in relational table which contains all the information about a single entity » Each horizontal row of the student table represents a student tuple, © Ateble can have any number of rows in Tt 414 Domain Every colurnn in a table has @ set of data values that are allowed for that coluint which is called as Domain, A domain with possible values should be associated with every atribute. © Ina relational table 2 comaln con have a single value or no (Null valueMW ADwms (SPU) 1-3 Relational Model Concepts. Domains are used to check that values inserted in database are correct or not and ensures that the comparisons made are correct. 1.2 _ Relational Database Schema © The description or design of a database is called database schema, which is specified during database design and it doos not expect to change frequently © the data stored in database at any ted timestamp is called instance of database, Database schema defines the attributes (column) moment is called the instance of that database, tables whereas the value of these altributes {C 5. Seherna 2A description of data in terms of a date modet is called & database schema, The description of @ database is called database scherna, which is specified during databese design and it does not expect to change frequently © A database scherna is structure of database represents the logical view of the entire database, © It defines how the data is arranged and how the relations among them are associated. 1 also represents all the constraints applied on the data, © Adatabase schema defines its database entities and the relationship among them. Fig.1.2.1 HR Schema Diagrams 2. ‘Types of database schema or View ()_ Physical/internal Scherna (©) Logical Sch ne (©. View/Extemal Schema © The design of a database at physical level is called physical schema, how the data stored in storage is explained at this level.WW Av8Ms (EU) 1a Relational Model Concepts +The design of database at logical level scaled logical schema, this level gives tabular structure of data, » The design of database at view level is called view schema, This generally describes user and database system interaction. 3. Example of database schema ri Bateau | Physical Schema ‘sNo Jernehtto] [sno [ Frame | tname. Logical Schema ‘rame [ #90 | Salary [Boneh pectin i Seonumber G0), amo Varear (0), Lupe Vober (60), ‘go number, Saleny umber (102, Branch rember 10) » Physical Schema Fig. 122 p instance ©The data stored in database at any fixed timestamp is called instance of databace ©The data stored in table at any moment of time is called the instance ofthat database For example, ‘A Student table has 500 records, so today the instance ofthe database has 100 records © if we add another 100 records in this table by tomorrow s0 the instance of database tomorrow will have 600 records in table. © The data stored at a particular moment is called the instance of database, instance wil change over time when we ‘add or delete data from the database, 1,3 _ Relational Database Constraints 2 Integrity constraints provide a way of ensuring that changes made to the database by authorized users do not sesult ina loss of data consistency and correctness. © Database Integrity is concesned with, the correctness and completeness of data, in the database, > This objective can never be guaranteed; one cannot ensure that every entry made in database is accurate. © An integrity constraint can be any arbitrary predicate or conditions applied to the database. Example: © Bank customer age should no: be less than 12. © Nemo customers can have seme customer ID. (© One customer can have only 1 savings account. ~ ='ADBMS (SPPU) 1 Relational Model Concepts + Some examples of incorrect data is as below, © Student taking admission to branch which is not available in college. ‘© Employee assigned with non-existing department. © Sometimes inconsistency is introduced due to system failures, 13.1 _ Types of constraint violations and Dealing with Constraints Violations To preserve the data integrity (consistency and correctness) @ RDBMS should impose some or more data integrity constaints Some of data integrity constraint are listed below, 3. Required data in Domain Integrity - NOT NULL Constraint Some attributes (colunns) ina database are not allowed te contain NULL vaiues. NULL values are values which are unknown, unassigned oF missing attribute values, xampte = In the student databsse, avery student must have an sssaciate Therefore, the NAME columa in the STUDENT table is 3 required date, ‘Greate table Student (Name char (10) NOT NULL); Simple validity checking in Domain integrity ~ CHECK Constr ‘The STUDENT database uses STUDENT ID which begin with 4, so Integers greater than 1. the domalis of the STUDENT.ID coluran fs Similarly, in employee table, EMPNO column must fall within the numeric range of 104 to 999, ‘The DBMS can prevent user from inserting other then allowed data values in 2 colurrn, Create table Student (Age Int CHECK(Ag2™18)); 3, Default Value ~ DEFAULT Constraint Default keyword is used to add some value if no attribute value added for tuple. > Example : Table with customer entity having name, cid and gender in which cid is primary key. name is not ‘added for customer that will be taken as ‘Unknown’ Create table Customer (EName varchar(20) DEFAULT 'NA’); 4 Ent integrity nose values uniquely AA table in a relational database has one column or cambination ef multiple columns identifies a single row. (Entity) in the table. Such column or combinaticn of columns will provide entity iniegrity, of the data in table © The DBMS can prevent uset from inserting unique date values in a column, fa) Unique Constrainn unNQUE 2 incase of unique constraing wo tuple n have equal value for samme column vistiint says that attributes forms candidates key, wich aliows one iNull value which is unigue Dy is Create table Student (Email char(50) Unique)WADBMs (sePU) 1-8 Relational Model Concepts + For this constraint to execute, the foreign key columns must be nullable. * Foreign key (Did) references department : © Ondelete SET NULL © On Update SET NULL ‘+ Insert Null value of ‘Did’ in the place of deleted ‘did, d) SET DEFAULT +All the values that make up the foreign key are set to their defauit values if the corresponding vow in the parent table is deleted. For this constraint to execute, all foreign key colurans must have default definitions. reign key (Did) references department ‘On delete SET DEFAULT © On Update SET DEFAULY 1 a column is nullable, and there is no explicit default value set, NULL becomes the implicit default value of + insert any default value of di’ (which exists in the departing fable in te place of deleted ‘Dil Ff the primary key value of department table is updated (ON UPDATE) Data Redundancy * A non-normalized databases are more vulnerable to various problems, if ft stores data redundantly. If data is stored in two locations, but the data is updated in only one of the locations, then that dats becomes inconsistent; this is referred to asan "update anomaly”. A normalized database stores non-primary key data in only one location, ‘Types of redundancy Direct redundancy Indirect redundan (Direct redundancy Direct redundancy can result due to the presence of same data in two different locations, thereby, leading to ‘anomalies such as reading, writing, updating and deleting. Redund ancy Indirect Redundancy results due to storing information that can be computed from the other data items stored within the database. Example: 2 | Om | Titwala | Mayban Indirect redundancy Employee age can be calculated from DOB (date of birth) hence, no either attribute, 1d to store both attributes; you can accept - eRe BoWacom (sePy) 19 Relational Model Concepts Mahesh | Worl [1] Satish [wort a Indirect redundancy Problems caused by Redundancy © Redundlancy is toot of many problems In ROBMS. Redundant data causes following problems © Insen, delete or update anomalies Wastage of storage Generation of invalid data frample: Cons example of Employee Project table in which employes information and information about project for svhich he works is kept as Follows [a a 1 [sein | Mold [12 | PF _| 2500 [2 [leyenda |_vasni fa | cap [30000 | 2 | sites [anche [ss [eo [1000 1 | seenin | vated [ae | wee | 25000 | 2 [yea | Vashi [24 | 16x [3000 | 3 [Sunes [ander | 2 | rr [12000 | © In above example there is repeatable data present in table which causes wastage of space in database, also this data complicates the update operations. In above design (modified design) as data for both table employee and project are kept together in one table hence, if we want to update @ project name then entire record (tuple) which is updated will have ail data for both tables. © Incase of adding new row (0 table we need to give information about both tables. > Henk e this approsch vill lead to redundant data in table, So this design shows bad database design, © Toavold redundancy, we can make use of functional dependency by which we can perform decomposition of data into multiple tables but that causes generation of spurious or invalid data, 1.5 Update Operation and Anomalies with Constraint vioiations © relational schema may have some redundancy in database design, ifit stores data redundantly © if same data is stored at more than one location will leads to redundancy and wastage of memory space, » An inconsistent data may o update anomalies, se some problems while adding, updating or deleting date in table which is called as © Redundant data is more vulnerable to various date anomalies as if date is updated at oniy one location and not at other locations, then that data becomes inconsistent, and this problem referred to as an update anomaly. ©Wavems (spru) + Annormalized database stores non-primary key data in only one location. Relational Model Concepts « Atelational database table should avoid al data anomalies Example : Employee (Emp_l, fname, Address) Emp Salary (Emp, Ename, payScae, grossSalary, netSalary) Emp.Designation (Emp_14, Ename, Des romDate, toDate) {Update Anomaly ‘The relational schema (tables) may have same date stored in consistencies. ‘one table then it inay result in logic 2 fall the cords are ot updated, then some tables way leave In above example ali 3 tabi ‘to updating his oame i all 2 tab Ivan inconsistent state ©) insertion Anomaly There is possibilty in which cartain facts cannot be recorded in database ‘An Insert Anomaly arises when certain attributes cannot be added into the database without the presence af other attributes, In above example, it is not possible to add a row in Emp Salary table or Emp_Designation table for am employee who is not exists in employee table, Gif) Deletion Anomaly > If data deleted from one table al etevant data in another related tables must also he deleted othervise it will create data inconsistency problem. '® Deletion of some data from one relation necessitates the deletion of some other data in other table, © Inabove example, it is not possible to delete a row in Employee table if Emp Salary table ar Emp_Designation table contains date for respective employee. Explain al types of constraints wih help of examples Explaln ihe tonn Rolerential Integrity’ and is relation with oroign key Winte short rtes on Integy Constraints 2.4 Wire short notes on (2) Domain integrity (0) Reterentiat integrity and its retation with foreign key What do you mean by Database scheme Dlagcam? 2.5 Wreidoy mean by data it 7 Explain tyoes plain database echoma, ala Integhiy inObject Oriented Databases ‘Objects Bosic properties. Advantages, examples, Abstract datatypes, Encapsviation cess hierarchies, polymorphism | examples. Object-Oriented Concepts _ ‘Object oriented database systems are proposed as an aitemative to relation systems and ather available system tis aimed at application domains where complex objects play a major role, The term object-oriented-abbreviated by 00 oF 0-0 has its origins in OO programming languages, or OOPL. 3. The 00 approach is heavily influenced by OOPL (object-oriented prograrnming languages) and this is used to give DBMS functionality to a programming languages. 4, If we extend existing object oriented programming languages with features of relational model such as transaction, recovery, concurrency, atomicity etc. the resultant model is called as object oriented database model 5, The basic building blocks of abject model is (@) Object (@} titerals / | fn obec ore Dabasa Maree of Sor anc ROB yan eg Ls Aomiey sea | omy /Wy Avs seruy Object Oriented Databases 2.2 _ Basic Properties , Advantages of OODBMS 1. Persistency © QODBMS extends the capacity of OOPL that can create persistent object ie, object remains in memory even after program execution terminates © This feature automatically introduces the concept of recovery and concurrency of databases. 2. identity © Generally ir DBMS each entity is uniquely identified by a value of primary key, which is specified by user 2 This is value dependent identification. © The problem of value dependent identification ic removed in OONBMS by intreduicing concent of system generated unique vaiue called as Object identity. Every object in OODEMS will be having unique object identity 3. Complexity An object in OODBMS can have complex internal structure with multiple level of compieniy © State of one abject may contain other objecis. Encapsulation ‘2 Encapsulation is one of the important characteristics of OO system, The dea of encapsulation in programming languages comes from abstract data types. = Thisis related to concept of data hiding concepts in OO fenguages. 5, Relationship © We maintain relationship between two abjects using concept of inverse reference, © One object maintains OID of other and vice versa Fig. 22.1 : Object relatlonship 6. Inheritance © Creating new type fram existing type such that new type inherits ll characterises of evsting type = The parent ype is called as supertype while newly created types called as subtype ‘Super type (Creating ner type) Ost 2.3 4. Object is uniquely icentifiable entity that contains botiy attributes that describe the state of real world object and the action associated with i‘ADBMS (SPPU) 2 Object Oriented Databases ‘An object typically has two components; state (value) and behaviour (operations). 3. Hence, itis somewhat similar to a program variable in a programming language, except that it will have a complex data structure as well as specific operations defined by the programmer. 4. Each object has to maintain information about current state of object and additionally has action and behaviour that have to be modelled. 5. The current state of object is described by one or more attributes (instance variables). 2.3.4 Characteristics of Object 4. Object Identifier © The object identifier is unique system generates iden Every object when created will get one object identifier Object Name within pericular In addition to object identity some object may have unique objec > this name can be used to refer abject in program + Also with help of name user vl be able co reference object that are referenced by his object, 3. Object Lifetime + Thelifetime specifies period for whch variable is vali © Transient Object © Objects in an Object Oriented Programming Language (OOPL} exist only during program execution and are hence called transient objects. Eg. OOPL programming variables © Persistent Objects © An Object Oriented (00) database can store objects permanently, and hence the objects persist beyond program termination and can be retrieved later and shared by other programs, Such objects are called as persistent objects E.g. Objects stored in secondary memory ‘Object Structure © The object structure defines how the object is constructed by using constructor. = The structure that specifies the object is = Collection Object: Its a collection of objects of same type in which all common properties and operations are ‘merged together. Eg. Employes Atomic Object: Objects which are nat ofe collection type. Eg. Name of employee'ADBMS (SPPU) 24 Object Oriented Databases 2.3.2 Attributes 1. Definition Attributes are nothing but properties of objects in a system. 2 Example Student may have attribute ‘name’ ‘Types of Attributes i simple Complex Simple attributes © Atwibutes can be of primitive type such as ~ in string, rel etc. which can take eral vai. xg, Sidis simple atribute with value 12 Complex attributes, + _Atibutes that contains collections or references of multiple other objects is called ‘complex attributes. Eg. Manager colection of employee objects Reference Attributes + Attributes represents a relationship between object and contains value or a collection of values which are objects of themselves 4, HR staf collection of reference of staff objects © Reference atibute is conceptually similar to‘ foreign key in relational databases and pointer in programming languages. ® An object have more than one complex type are called as Reference objects. 2.4 __ Literals ~ Abstract data Types 2. troduction + Altera is «constant value possibly having complex structure that does not eengs, © In case of object model, a literal isa value that does not have an object identifier. © The literal value can be simple structure or complex structure.Weabenss (sPPU) Object Oriented Databases 2. Types ‘Atomic Literal © Atomic iteral cortesponds to predefined (Bul n) basic deta type © Atomic Literals for Object mde! 2 tong ». Shor Charecter —_Soumeration =. Bonlesr 5. Collection Literals Specify the valie that is @ collection af objects o- values Collection by ts own does not have any object kent (O10 Collection Literals for Object Mode a Sere nordered collection having ao duplict L,— BAGET> - Unotdered colaction which allows duplicates —UST - Ordered collection which allows duplicates ‘Where T~Iype of object or valve Type Generator Structure titerals ¢Asstructre literal corresponds to values that are constructed using fype constructor. © This includes all user defined type structures such as structure created by strut keyword © Structure Literals for object model are a Date Interval System Generated! - Automatically generated by system cannot be assigned manually. Invariant ~ OID cannot be altered throughout its entire life time. © Immutable ~ Once O1D is generated samme GID cannot be regenerat Invisible O10 is not visible to user Long integer - its long integer value Independent ~ Value of OID is indepencient of the values of lis aitvibutes (siete) ino objecis an Rave samme state but diferent O1Ds. 3. Compare with Relational mode! © Relational model uses primary key as uniqueness constraint 2 OID form stronger constraint that than the relational data models entity integrity that requires uniqueness within relations ) 06 = (36,1uple, Persistent data 4 Data that.continue to evist in carnputer memary even after she program execution has ta © Generally stored in secondary mesnory ie. Hard Disk oppy ete 2 Persistent Programming Language + A persistent programming language Is @ programming language extended with constructs and operates to handle persistent data. 2. Persistence of Objects © Th object database system objects are of two types transient that are deleted after execution of program terminates or persistent exists even after program execution finishes © In OOpRMS defauit type of object is transient + Tomake persistent programming language we need to make first objects persistent. © Various Mechanism for making objects persistent a. Naming Mechanism In this method, with help of syntax provided in OODBMS the object can be made persistent by assigning a ‘unique persistent name. © This persistent object now can be accessed in this or other program with nelp ofthis persistent name + Named persistent types are used as entry point to database through which users can start database acess. + But. In case of large databases i is not practical 0 assign names to each and every object Reachability Mechanism © Objects ate persistent if they ave refered, directly or indirectly from a persistent object. + Eample feachable from An abject x sequence of references in object grach leads from object X te object ¥ FaeWW av0ms GePU) an Object Oriented Databases Approaches have been proposed to make the objects persistent 2. Persistence by class © Declare classes to be persistent then automatically all objects of the class are then become persistent objects by defaut. » This approach is not flexible since itis often single class needs to have both transient and persistent objec. persistent is interpreted persistable objects in the class in many OODB systems, declaring 2 potentially can be made persistent, 6. Persistence by creation In this method new syntax is iniroduces to create persistent objects © Hence object can be transient or persistent depending on hiow it was created ‘Many CODBMS follows this concept, Per fence by marking Mark an object as persistant after itis created and this marking shoulé be done hefore ihe program terminates. = All objects in this approach are created as transient and as per requirements they can be marked as persistent © The decision of weather abjecis persistent or transient is iaken after objects are created. d. Persistence by reference # One or more root objects are explicitly declared as persistent objects, + Other objects are persistent if they are referred, directly or indirectly, from a root object. © It is easy to make the entire data structure persistent by merely declaring the root of the structure as persistent, but is costly to follow the chains in detection for a database system. Object Identity and Pointers + In case of transient objects OID is created temporarily which will be deleted after program execution finishes but, for persistent objects OID is persistent and remain in memory even afler program execution vermninates. ©The association of an object with @ physical location in storage (as in C++) may change over time ‘There are several degrees of permanence of object identity: 2 Intraprocedure © entity persists onty during the execution of a single procedure © Eg, local variables within procedure Intraprogram © identity persists oniy during the execution of a single program or query © Eg. global variables in programming languagesWH ADBMS (SPPU) 212 Object Oriented Databases 3. Interprogram + identity persists from one program execution to another, ‘+ Eg. Pointers to the system data on disk but may change if the way data Is stored in the system is changed. 4. Persistent «Identity persists not only among programs but also among structural reorganization of dats. + This form of OID is required for 00 systems 5. Storage of Persistent Objects = Code that implements methods should be stored in the detabase as part of the schema, along with type slefintions, but many implementations store them outside the database, to avoid having to Integrate system software such as compilers with the database system, © Data should be stored individually for each object. Access af Persistent Objects 8. Give names to objects like we give names to any file: This methad werks only for small sets of objects. Expose object identifiers or persistent pointers to the objec Store the collections of object and allow programs to iterate over the collections to find required objec. ‘The collections can be modeled as objects of a collection type. 7. Drawbacks of Persistence Easy to make programming errors that damage the database . Harder to do automatic high-level optimization such as reduce disk /0. & Donot support declarative querying weil 2.10 Class jerarchies and Inheritance 1. Introduction The concept of a class hierarchy is ilar to that of specialization in the ER model 4 We can inherit both attribute and operations of a type. Type Hierarchy © 00 databases must permit ceation of new types based on other predefined types, leading to a type (or class) hierarchy. ‘+ Aslike in other system database system must provide a capability for classifying objects based on their type. Implementation © Type hierarchies in databases usually involve a constraint on the extents corresponding to the types in the hlerarchy. © Atype is defined by defining their attributes (instance variables) and operations (methods) for the type. The attributes and operations together are called functions, - eeWe ADaMS (SPPU) 213 Object Oriented Databases ‘The term function name is used to refer to both attributes and operations of an object type. ‘Attype can be defined by giving it a type name and ther listing the names of functions. Ae eee ‘The concept of subtype is useful when we create a new type that is similar to an already defined ype, ‘The subtype then inheriis afi the functions of the predefined type, which is called as super type. ‘A type PERSON as 2 supertype and STUDENT; TEACHER as subtype may de defined as follows Fig, 2.10.1 : Person type hierarchy Now suppose shat we want to two new Subtypes STUDENT and TEACHER as follows Both STUDENT and EMPLOYEE subtypes include all the functions defined for PERSON superype and additional functions of their own Type hierarchy is used ta show the supertype/subtype relationships among all the types declared in the system,'ADBMS (SPPU) 2.11 RDBMS, OODBMS and ORDBMS Comparisons 4 Object Oriented Databases 2.11.1 Object-Oriented DBMS (OODBMS) 1. Introduction : 2. To represent complex objects in programming has led to the development of object-oriented (00) systems. b. _Ituses ODMG standards 2, Features a, Abstract data types (ADTS) in which the internal dats structure Is hidden and the exteval operations can be applied on the object (encapsulation of object 8, Inheritance The process in whieh one object inherits the properties of previously defined object is called Inberltance. iahasitance alds in the reuse of existing definitions for creating new objects &. Polymorphism allows the samme name, operator or symboi to have differant implementations, 6. Objects Identity (G10) OO databases provide unique object identifiers (OIDs) so that the objects can be uniquely identifies. 2. The data in object-oriented database management systems (QODBMS) is managed through two sets of relations, one describing the interrelations of data items and another describing the abstract relationships nheritance) 3. Languages Supported a SMALLTALK bo Cee dave 4, Disadvantages a Thelack of a defining standard, b. Poor performance & Query optimization for OODM is highly complex. d. CODEMS is also suffer from problems of scalability, and are unable to support large-scale systems. Example of ‘QODEMS are 02 (now called Ardent) developed by Ardent Software. 2412 Relational DBMS (RDBMS) 1. Introduction : 2, The relational model was introduced by Dr. EF Codd in 1970 and has evolved since then, through Implementations by IBM and others. b. Standard for relational databases is published by ANS! (the American National Standard Thstitute) as SQL (ANSI 1986) oF SQU, called SQL-86. A cevised standard is called SQL, also referred to as SQL-82. G. The SQL standard enables users to easily migrate thelr database applications between different database systems, In addition, users can access data stored i language (SQU, two er more RDEMSs without changing the database sub- &{BH ADeMS (SPU) 215 Object Oriented Databases 2. Features: ‘A relational database is composed of many relations in the form of two-dimensional tables of rows and columns containing related tuples (horizontal rows) known as logical view. 3. Examples : 3, Oracle, developed by Oracle Corporation b. Microsoft Access developed by Microsoft 4, Disodvantages Inability to handle aoplication ares like spatial databases (eg. CAD}, applications involving images, special type 19. compiex numbers, arrays, etc} and other applications that invab 7 1. All database information is stored in tables; these tabular entries may have sicher date structure, abstract dato types (ADT). 5. An ORDBMS supports SQL witch is stil in the development stages. The ORDEMS has the relational model in it because the data is stored in the form of tables having rows and columns 4 SQLisused as the query language and the result of 3 query is also table or tuples (ros) €. ORDAMS allow users define deta types (UDN, functions and operators. 2.11.4. Differences between ODBMS, RDBMS and ORDBMS Tee - © oobams: Database concept is continuously evolving field, databases which are very old having lot many concepts | supported to it caled as mature databases, At | are called as Immature databases. same time, development of database {sin progress such databases | Relatively old so mature Very ols hence, Very matre Still Developing So, immature Ease of use to End Usor This paramete, says system is simple for handiing to even any person without muct | | for developers Easy SQL access for end wserObject Oriented Databases ADAMS (SPPU) Supported Languages SQL with Object oriented features Object oriented query language(OQu) Standard Used | 00m6-20 sqz SQLB (evelopment is sti in progress) | Lo | suppor for objec oventes concepts d databsse, No Bogs not suppers it convert objerts jx program Ves As tis & objector | ence fl support al Obits oie i | sa new ypeshasieg features | | Support for Complex Relationship: | some 00 features | | Supporis Abstract data types (ADT) and also complex relationships Supports a wide range of data types aind | data with complex relations Advnapes tes cing | simaeopimiaton Disdvamapes Ls Low performance because of complex | Cannot handle complex appl tions | Low performance for web | | query optimization 1 | applications | No support large-scale systems. 2.42 Polymorphism Examples © Polymorphism is the capability of an object to take multiple forms or pattems. This ability allows the same programming code to work with different data types. Exemple A car, Truck, and bike all have breaks, but the a polymorphism, The defined action is polymorphic ~- the is different. inthis example, the act break changes fon viich vehicle performs it.at a2 a3 a4 a6 a7 as Describe foatures of Object oriented databases. ‘Write short notes on a. Object identity Object Structure © Type Constructor ‘Type hierarchies and inheritance ©. Transient and persistent objects 1. Charactristics of Object oionted databasos How persistent programming language can be distinguished from other languages What is need of persictence in databases? Explain concept of persistence in dat Explain the concept of extent and keys. ‘Wie in brief about object Query language. ‘Waite any five quetis in OCI. for banking example, \write any ten queries based on folowing schema.Parallel Databases Arcneetres for paral | optimizations Paralte! Databases 5 ystesn 4 Introduction & Apara ed by using multipie resou {abvase improves data processing} a, Paraliel operations are becoming increasingly common to improve speed of operation and therefore study o: Paratlel databases is becoming more important. & In organizations huge amount of data is handled, such huge amount of data needs high data trensfr rate. 4. Centralized and client server system is not much powerful for managing such applications Parallel databases try to improve performance of database through parallelization of operations such Data loading, Query evaluation ete £ We can use thousands of small pracassors for making a paralle! machine Goals of parallel databases a. Improved performance Using multiple resources fe. PUs and disks) in parallel we can significantly improve performance of system. Increased availability If a site containing s relation (fable he rele anaitable from another site which has 2 copy of that data Increased reliability, fa site containing a relation (table in databace) falls to work, the relation continues to be available from fads to rare rel another site which has 2 copy of that isttbutes ta access Sats which belongs nultiple branches of @ companyWF ADAMS (SPU) Parallel Databases Inter crmeniication network Fig. 3.14 : Parallel database system 3.2__ System Parameters / Measures of Performance plain various system parameters of paral databases ae ‘What is inscance of he tens ‘Speed! up while abn parallel n caso of paral database ? Whit af he factors that diminish both ‘Speed up’ arid‘Scale up"? B ° 1. Throughput - output efficiency : ‘a. The number of tasks completed in a given time interval is called as throughput, 6. We can improve throughput by processing large number of small jobs in given time interval by parallelzing transactions. Response ti 2, Amount of time taken to complete a single task from the time itis submitted is called as response time. b. We can improve response time by processing large transaction by subdividing it into number of small {transactions and by parallelizing their execution which also improves their throughput Speed up: 2. Speed up is defined as running task in less time by increasing degree of parallelism, b, Time required for processing task is inversely proportional to number of resources (Processor and disk) silat.

You might also like