Advanced database System
CHAPTER ONE
Concepts for Object-Oriented Databases
1.1 Overview of Object-Oriented Concepts
Object databases focus on conceptual modeling for object database designs.
Key Concepts:
EER (Enhanced Entity Relation)
LINQ (Language Integrated Query)
UML (Unified Modeling Language)
Object Database (ODB) main objectives:
Persistence of objects
Efficient management of persistent data
Transaction management, concurrency, recovery control
Support for ad hoc queries
Object Definition:
Represents an entity of interest with a state (attributes) and behavior (methods).
Example: Student object has states like identifier, name, address and behaviors like methods for create, access, modify, and delete.
1.2 Object Identity, Object Structure, and Type Constructors
Class: Defines the object type where each object is an instance of a class.
Example:
Personclass,Jacquelineas an instance.
Complex Objects: Composed of simple objects. Examples include:
Airplane = Engine + Body + Wings + Tail.
Object Identity: A unique identifier (oid) that remains constant for an object, differing from relational databases where attributes can change.
Object Structure: Consists of attributes (state) and methods (behavior) associated with instances of the class.
Type Constructors: A specific method for creating and initializing objects.
1.3 Encapsulation of Operations, Methods, and Persistence
Encapsulation: Groups data and methods to conceal implementation and ensure data integrity.
Persistence: Ensures object states remain after the process ends, crucial for object-oriented databases.
Methods: A defined operation within a class, implemented through method signatures.
1.4 Type Hierarchies and Inheritance
Inheritance: Objects can inherit properties from other objects, indicated by "Is-a" relationships.
Example:
CircleandTriangleinherit fromShape.
Polymorphism: Ability of objects to respond differently to the same method based on their class.
Example:
Area()method can compute area differently forCircleandTriangle.
1.5 Object-Oriented DBMS Architecture
OODBMS architecture layers:
External User Layer: Interface users interact with.
Conceptual Schema Layer: Abstract database structure visible to users.
Physical Data Layer: Where the actual data storage takes place.
Client/server architecture splits database applications into parts that handle client requests and data processing.
1.6 Object-Oriented DBMS versus Traditional Database
OODBMS supports complex data types better than traditional RDBMS.
OODBMS advantages:
Permanent object identifiers, distribution, integration, immutable references.
OODBMS challenges:
Technology maturity, vendor stability, skilled personnel shortage, conversion costs.
1.7 Object-Oriented DBMS Drawbacks
Main concerns include:
Maturity of technology and stability of vendors.
Availability and cost of training qualified personnel and converting existing RDBMS.
2. Query Processing and Optimization
2.1 Introduction
Understanding query processing and optimization helps improve database performance.
Functions of query optimization include:
Rule-based and cost-based optimizers to execute queries efficiently.
2.2 Basic Algorithms for Executing Query Operations
Query Optimizer: A crucial feature that suggests efficient execution strategies for input queries.
Phases of query processing:
Query Compilation
Query Optimization
Query Execution
2.3 Translating SQL Queries into Relational Algebra
Breaking down SQL queries into smaller units for better optimization and logical expression in relational algebra.
2.4 Using Heuristic in Query Optimization
Heuristic rules prioritize unary operations (SELECT, PROJECT) over binary operations for optimization.
2.4.1 Process for Heuristics Optimization
Steps of optimization include:
Initial representation generation.
Application of optimization rules.
Generating a query execution plan.
2.4.2 Using Selectivity and Cost Estimates in Query Optimization
Cost-based optimization involves estimating the execution cost of queries to determine the most efficient strategy.
2.4.3 Semantic Query Optimization
Modifications to queries based on defined database constraints to improve their execution efficiency.
CHAPTER THREE
Transaction Processing Concepts
3.1 Transaction
Definition: A transaction is an operation executed on the database, which must remain atomic, consistent, isolated, and durable (ACID properties).
3.1.1 Transaction and Concurrency Control
Concurrency Control: Essential for maintaining database consistency.
Transaction scheduling involves sequences critical to ensuring the integrity of the database.
3.2 Properties of Transaction
Atomicity: Ensures all operations either complete or none do.
Consistency: The database remains consistent after transactions.
Isolation: Concurrent transactions cannot affect each other's execution.
Durability: Completed transactions remain permanently in the database history.
3.3 Schedules and Recoverability
Schedules: Defined as the sequence of transactions in execution.
Different types of schedules (serial, interleaved) exist based on transaction execution orders and conflicts.