Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database Technology Session II 10:15 - 11:00 Dr S Sudarshan & Dr D B Phatak IIT Bombay.

Similar presentations


Presentation on theme: "Database Technology Session II 10:15 - 11:00 Dr S Sudarshan & Dr D B Phatak IIT Bombay."— Presentation transcript:

1 Database Technology Session II 10:15 - 11:00 Dr S Sudarshan & Dr D B Phatak IIT Bombay

2 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies2 OVERVIEW u Storage devices u Files and Index Structures u Legacy Systems and Cobol u Relational Databases and SQL u Transactions and ACID properties u System Architectures u Security and Audit

3 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies3 Storage Devices u Main memory –volatile, lost on power failure –expensive and relatively small u Hard disk –non-volatile, reasonably fast access –relatively cheap, and large –main storage system for databases –Mean time to Failure: ~5 years

4 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies4 RAID Systems u Goal: improve storage reliability u Data stored on multiple disks – if one disk fails, data still available on others u Essential for safety of data u Hardware RAID –expensive, very high availability –for 24x7 applications (24 hrs X 7 days/wk) u Software RAID –cheaper, use if some downtime is allowable

5 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies5 Storing Data on Disks u Byte: unit of information –one character u File: –sequence of bytes u File system: –stores multiple files – organizes files into directories/folders

6 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies6 File Structure u Information stored within large files u Sequential files –sorted on a key (e.g., account number) u Index needed for efficient access –e.g. find information of account 2345 –similar to library card catalogs

7 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies7 Traditional File Processing u COBOL: –Common Business Oriented language u Files contain sequence of records, –e.g. Record per account u Complex program for each task –e.g. withdrawal, deposit, average balance, … u File structures often very complex –motivated by efficiency, but become hard to understand

8 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies8 SEGMENT OF A SAMPLE COBOL PROGRAM Open Input SALARYTABLE-FILE. Perform Varying I from 1 to 11. Move zero to GROUPTOT [I]. END-PERFORM. PROCESS-NEXT. Read EMPTAB-FILE At End Go To End-job. - - - - - Add salary to Group tot [K]. Go to Process-Next. END-JOB. - - - -

9 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies9 PROGRAMMING PARADIGMS u 4 GL: What to do –Set processing u 3 GL: How to do (Algorithm) –Record by Record Processing u 2 GL: Algorithm at the lowest level –Details of Individual Operations

10 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies10 Relational Databases u Motivation: –simplify storage structures –easy to use language for queries/updates –efficiency is job of system »automatic optimization u Legacy systems –Systems built using COBOL and older data models –Still in wide use, but declining usage

11 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies11 Relational Databases Provide: u Tabular Data model: simple, yet powerful u A Standard Query Language: SQL u Mature Products with Reliable, Fault- Tolerant Operations available u Good Performance –High number of transactions per second –Parallel operation for scalability (handle growth) u Distributed and Replicated Data Bases –Interoperation, High availability

12 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies12 Relational Model: Tabular Data Account Transactions

13 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies13 Querying the Database using SQL u select name, balance from account where name = “D. B. Phatak” u insert into transactions values (3/5/99, cash, 5000, -, 14000) u select acct-num, avg(balance) from transactions where date between 1/4/99 and 30/4/99 groupby acct-num

14 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies14 Transactions: ACID Properties u Transactions: – e.g. Debit/credit u Problems: –Failures (e.g., power, disk storage) –Concurrent transactions u Solution: –Support for ACID properties

15 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies15 ACID Properties u Atomicity: Transaction appears to either run completely or not at all -- no partial state u Consistency: Integrity checks (e.g., balance >= 0) u Isolation: Locks on data so that transactions do not step on each others toes u Durability: Data/updates are never lost

16 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies16 Database Application Classes u OLTP: Online Transaction Processing –supports many small transactions u Decision Support –Summaries/aggregates –OLAP: Online Analytical Processing

17 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies17 Performance Issues u Important for high volume systems –e.g., internet banking u Sizing / Performance tuning –deciding on CPUs, memory size, disk size, number of disks, etc –tuning transaction code »to reduce disk I/O »to reduce lock conflicts between concurrent transactions u Scalability via parallelism –Smoothly handling more traffic as the business grows

18 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies18 Access Security u Authentication –Identifying who a person is –Passwords »widely used, but quite insecure –Smart cards, biometrics, etc »More on this later u Access privileges –who is allowed to do what u Audit trail –Trace back what happened

19 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies19 Authorization Mechanisms u Privileges –e.g., read table, update table, insert row in table, delete row from table, privilege to grant privileges u Each user given specific set of privileges he/she needs u Roles –privileges given to roles »(e.g., teller, manager) – users authorized to play roles

20 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies20 Audit Trails u Database keeps track of all transactions in an audit table –what the transaction did, and who ran it u Mechanisms for tracing back what transactions affected a particular entity (such as an account)

21 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies21 MORE ON SECURITY u Encryption, Session Key u Data Encryption Standard (DES-3) –Shared Private key u RSA, DH Algorithms –Public/Private key

22 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies22 SQL u SQL is Intergalactic Dataspeak u Strong Data Definition Language (DDL) – Domain Definitions – Integrity Constraints u Security & Access Control Provided – Views, Permissions u Interactive Queries

23 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies23 SQL u Embedded SQL: –Use of SQL commands from within 3GL programs (programs in C/COBOL/…) u Open Data Base Connectivity (ODBC): –Standard for client server interconnectivity, using C language u JDBC: Like ODBC, for Java language u SQL Standards: 86, 89, 92, SQL-3 Draft

24 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies24 SQL u No Standards for User Interface – Screens (Forms & Menus) – Reports u Special Tools Available – Native to Product – Independent Vendors

25 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies25 DATABASE SERVERS u Major players –Oracle, IBM DB2, Microsoft SQL Server, Informix, Sybase, Ingress u Wide range of performance, features, and price

26 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies26 Database Architectures u Centralized –Dumb terminals connected to single server u Client Server –Smarter client machines connect to server –Main work still done at server u Parallel Servers –Work divided between multiple CPUs u Distributed –Multiple independent databases in cooperation

27 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies27 EVOLUTION OF CLIENT SERVER COMPUTING u Multiple Computers to Independently Handle Component Tasks of an Application u Need to Partition Tasks Judiciously

28 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies28 TWO TIER PARTITIONING

29 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies29 CLIENT - SERVER TERMINOLOGY u Service: Provided by the Server – Each Client Is a Consumer u Shared Resources : Managed by Server u Client : Initiator of a Request

30 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies30 SERVERS u File Servers : Novell u Database Servers : SQL u Transaction Servers : OLTP – TP lite (Stored Procedures) – TP heavy (TP monitors)

31 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies31 SERVER FUNCTIONS u Wait for Requests u Handle Concurrent Transactions u Take care of VIP requests –Assign priorities u Authentication, Authorisation u Audit trails

32 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies32 CLIENT FUNCTIONS u Typically Processes Running on Front-end Machine (PC) u Provide User Interface u Support Graphics, Multimedia

33 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies33 THREE TIER C/S u Tier One : Client u Tier Two : Application Server u Tier Three: Database Server

34 Dr. Sudarshan & Phatak, IIT BombayData Base Technologies34 MORE C/S TERMINOLOGY u Thin or Fat Client u Fat Server u n-Tier Architecture u OOUI


Download ppt "Database Technology Session II 10:15 - 11:00 Dr S Sudarshan & Dr D B Phatak IIT Bombay."

Similar presentations


Ads by Google