Docsity

Introduction to advnace dbms, Lecture notes of Database Management Systems (DBMS)

Partial preview of the text

Download Introduction to advnace dbms and more Lecture notes Database Management Systems (DBMS) in PDF only on Docsity!

CPS 216: Advanced Database

Systems

Shivnath Babu

Fall 2006

Outline for Today

  • (^) What this class is about: Data management
  • (^) What we will cover in this class
  • (^) Logistics

Example: At a Company

ID Name DeptID Salary … 10 Nemo 12 120K … 20 Dory 156 79K … 40 Gill 89 76K … 52 Ray 34 85K … … … … … … ID Name … 12 IT … 34 Accounts … 89 HR … 156 Marketing … … … …

Employee Department

Query 1: Is there an employee named “Nemo”?

Query 2: What is “Nemo’s” salary?

Query 3: How many departments are there in the company?

Query 5: What is the name of “Nemo’s” department?

Query 4: How many employees have Salary >= 80K?

Query 6: How many employees are there in the

“Accounts” department?

DataBase Management System (DBMS)

High-level High-level

Query Q Query Q

DBMS

Data

Answer

Translates Q into

best execution plan

for current conditions,

runs plan

DataBase Management System (DBMS)

High-level High-level

Query Q Query Q

DBMS

Data

Answer

Translates Q into

best execution plan

for current conditions,

runs plan

Keeps data safe

and correct

despite failures,

concurrent

updates, online

processing, etc.

DBMS is multi-user

  • (^) Example

Get account balance from database;

If balance > amount of withdrawal then

balance = balance - amount of withdrawal;

dispense cash;

store new balance into database;

  • (^) Homer at ATM1 withdraws $
  • (^) Marge at ATM2 withdraws $
  • (^) Initial balance = $400, final balance =?
    • (^) Should be $250 no matter who goes first

Final balance = $

read balance; $ if balance > amount then balance = balance - amount; $ write balance; $ read balance; $ if balance > amount then balance = balance - amount; write balance; $ Homer withdraws $100:Marge withdraws $50:

Concurrency control in DBMS

  • (^) Similar to concurrent programming problems
    • (^) But data is not all in main-memory
  • (^) Appears similar to file system concurrent access? - (^) Approach taken by MySQL initially; now MySQL offers better alternatives
  • (^) But want to control at much finer granularity
    • (^) Or else one withdrawal would lock up all accounts!

DataBase Management System (DBMS)

High-level High-level

Query Q Query Q

DBMS

Data

Answer

Translates Q into

best execution plan

for current conditions,

runs plan

Keeps data safe

and correct

despite failures,

concurrent

updates, online

processing, etc.

Summary of modern DBMS features

  • (^) Persistent storage of data
  • (^) Logical data model; declarative queries and updates! physical data independence
  • (^) Multi-user concurrent access
  • (^) Safety from system failures
  • (^) Performance, performance, performance
    • (^) Massive amounts of data (terabytes ~ petabytes)
    • (^) High throughput (thousands ~ millions transactions per minute)
    • (^) High availability (¸ 99.999% uptime)

Course Outline

  • (^) 50% of the class is about core DBMS concepts
    • (^) Query execution, query optimization, transactions,

recovery, etc.

  • (^) Textbook material
  • (^) 50% of the class is on “what is happening today in data management”
  • (^) Data streams
  • (^) Web search – Google, Yahoo!
  • (^) XML and data integration
  • (^) Data mining
  • (^) Sensor data management

Using a Traditional DBMS

User/Application User/Application

Loader Loader

Query Query ResultResult

Table R Table S

Result Result

QueryQuery

Example Continuous (Standing) Queries

  • (^) Web
    • (^) Amazon’s best sellers over last hour
  • (^) Network Intrusion Detection
    • (^) Track HTTP packets with destination address matching a prefix in given table and content matching “*.ida”
  • (^) Finance
    • (^) Monitor NASDAQ stocks between $20 and $200 that have moved down more than 2% in the last 20 minutes

Course Outline

  • (^) 50% of the class is about core DBMS concepts
    • (^) Query execution, query optimization, transactions,

recovery, etc.

  • (^) Textbook material
  • (^) 50% of the class is on “what is happening today in data management”
  • (^) Data streams
  • (^) Web search – Google, Yahoo!
  • (^) XML and data integration
  • (^) Data mining
  • (^) Sensor data management