1 / 33

Databases

Databases. CIS 422. Lifetime of Data. Transient results to the evaluations of expression Variables involved in procedure activation Global variables Dynamically allocated variables Data that exists between executions Data that exits between versions Data that outlives a program.

nadine
Download Presentation

Databases

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Databases CIS 422

  2. Lifetime of Data • Transient results to the evaluations of expression • Variables involved in procedure activation • Global variables • Dynamically allocated variables • Data that exists between executions • Data that exits between versions • Data that outlives a program

  3. Essentials to Provide Persistence • Object ID • Properties and relationships • Scale of the store • Stability of the store

  4. Marketing Database Engineering DBMS Sales Accounts Employee Inventory Customer Parts Accounting Engineering Parts Customer Marketing Inventory Accounting Accounts Database vs File System

  5. Database • A collection of related data • Represents some aspect of the real world • Is a logically coherent collection of data with some inherent meaning • Is designed, built, and populated with data for a specific purpose.

  6. Database Management Systems • Data • Schema • Program Independence • Views

  7. Motor Vehicle Bus Truck Car Hierarchical Model

  8. Customer Soup Order Network Model

  9. Soup-ID Soup Name Price Address Cust-ID Cust-ID Order-ID Name Soup-ID Phone Qty Relational Model

  10. Database Interface • Approaches • Data Definition Language CREATE TABLE inventory (inventory-number CHAR(20)NOT NULL description CHAR(25)NOT NULL price DECIMAL (9,2) • Data Manipulation Language

  11. Shareability • Transactions • Commit • Abort • Atomicity

  12. Concurrency • Locking • Conservative Locking Policy • Read Locks • Write Locks

  13. Object Oriented vs Traditional • Objects are active components • OO Databases have inheritance • Allow storage in the form of objects

  14. OODBMS - OO Part • The system must support complex objects • Object identity must be supported • Objects must be encapsulated • The system must support types or classes • The system must support inheritance • The system must avoid premature binding • The system will be computationally complete • The system must be extensible

  15. OODBMS - DB Part • It must be persistent, able to remember object state • It must be able to manage very large databases • It must accept concurrent users • It must be able to recover from hardware and software failures • Data query must be simple

  16. OID OID OID Emp# Position Salary Emps ENAME DEPT# Mgr Budget DNAME ddd sss eee Mktg Smith 50,000 E001 1,000,000 D01 …... Complex Objects Job Object OID’s of Employee Objects

  17. Object Data Management GroupModel Parts • Literals • Objects (OID) • system assigned • not dependent on attribute values • conceptual address • Collections

  18. Abstract Types - Interfaces • Inherit signatures of operations • Noninstantiable • Behaviour Inheritance • Supertype must be an interface • Subtype may be interface or class

  19. Classes • Specifies both attributes and behavior • Instantiable • Class Inheritance • supertype must be a class • subtype must be a class

  20. Relationships • Inverses • 1-1 • n-1 • n-m

  21. Persistent Objects • Naming & Extents • Reachablility • Key

  22. Worker calcDeductions calcPay Employee string name string ssn int dependents Salaried double salary Hourly double hours double rate Company Schema 1 1 n 1 office department

  23. Representation interface Worker { method double calcDeductions(); method double calcpay(); }; class Employee : Worker ( extent workers key ssn) { atttribute string name attribute string ssn attribute int dependents relationship Department worksIn inverse Department::hasEmployees relationship Office residesAt inverse Office::houses }

  24. Representation Continued class Salaried extends Employee ( extent salaried) { attribute double salary } class Department ( extent departments key number) { attribute int number attribute string name relationshipset<Employee> hasEmployees inverse Employee::worksIn }

  25. car cost color make model Cost color make model Table-Class Mapping

  26. Employee Customer name address custID empID name address empID name address custID Table-Multiple Classes Mapping

  27. HourlyEmp wage Employee name ssn address SalariedEmp salary name address ssn wage salary Table-Inheritance Classes Mapping

  28. Name DepartmentID Name deparmentID ssn salary Department name departmentID Employee name salary ssn Instance Relationships

  29. Client • Sends message to server • Manages user interface • validate data • dispatch requests • Solution specific logic • GUI

  30. Server • Fulfills the client request • Usually does database access functions • File server • Transaction server • Located separate from client

  31. Basic Characteristicsof Client-Server Apps • Front-end client acts with back-end server • The two tasks have fundamentally different needs • Environment is generally heterogeneous and multivendor • Scalability

  32. Common Components • User Interface • Business Processing • Database Processing

  33. Distributed Processing • Processing divided up between processes • Objects can be distributed and accessed by users across a network

More Related