1 / 23

CPS 216: Advanced Database Systems

CPS 216: Advanced Database Systems. Shivnath Babu. Outline for Today. What this class is about: Data management What we will cover in this class Logistics. What does a Database System mean to you? (Hint: What are they used for? Give examples). User/Application. Data. Data Management.

aldona
Download Presentation

CPS 216: Advanced Database Systems

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. CPS 216: Advanced Database Systems Shivnath Babu

  2. Outline for Today • What this class is about: Data management • What we will cover in this class • Logistics What does a Database System mean to you? (Hint: What are they used for? Give examples)

  3. User/Application Data Data Management Query Query Query DataBase Management System (DBMS)

  4. Example: At a Company 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 4: What is the name of “Nemo’s” department? Query 5: How many employees are there in the “Accounts” department? Employee Department

  5. High-level Query Q Answer Translates Q into best execution plan for current conditions, runs plan DataBase Management System (DBMS) DBMS Data

  6. Join (Cars.OwnerID = Owners.ID) Filter (Make = Honda and Model = Accord) Filter (Age <= 23) Example: Store that Sells Cars Owners of Honda Accords who are <= 23 years old Cars Owners

  7. High-level Query Q Answer Translates Q into best execution plan for current conditions, runs plan Keeps data safe and correct despite failures, concurrent updates, online processing, etc. DataBase Management System (DBMS) DBMS Data

  8. DBMS is multi-user • ExampleGet 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 $100 • Marge at ATM2 withdraws $50 • Initial balance = $400, final balance = ? • Should be $250 no matter who goes first

  9. Final balance = $250 Homer withdraws $100: read balance; $400if balance > amount then balance = balance - amount; $300 write balance; $300 Marge withdraws $50: read balance; $300if balance > amount then balance = balance - amount; $250 write balance; $250

  10. Final balance = $300 Homer withdraws $100: Marge withdraws $50: read balance; $400If balance > amount then balance = balance - amount; $350 write balance; $350 read balance; $400 if balance > amount then balance = balance - amount; $300 write balance; $300

  11. Final balance = $350 Homer withdraws $100: Marge withdraws $50: read balance; $400 if balance > amount then balance = balance - amount; $350 write balance; $350 read balance; $400 if balance > amount then balance = balance - amount; $300 write balance; $300

  12. 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!

  13. Recovery in DBMS • Example: balance transferdecrement the balance of account X by $100;increment the balance of account Y by $100; • Scenario 1: Power goes out after the first instruction • Scenario 2: DBMS buffers and updates data in memory (for efficiency); before they are written back to disk, power goes out • Log updates; undo/redo during recovery

  14. High-level Query Q Answer Translates Q into best execution plan for current conditions, runs plan Keeps data safe and correct despite failures, concurrent updates, online processing, etc. DataBase Management System (DBMS) DBMS Data

  15. 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)

  16. Parser Logical query plan Query Optimizer Physical query plan Query Executor Access method API calls Storage Manager Disk(s) Storage system API calls Modern DBMS Architecture Applications SQL DBMS File system API calls OS

  17. Course Outline • 40% of the class is about core DBMS concepts • Query execution, query optimization, transactions, recovery, etc. • Textbook material • 60% of the class is on “what is happening today in data management” • New developments on textbook material • Data streams • Web search – Google, Yahoo! • Data integration (structured data + unstructured data) • Data mining • Unsolved challenges

  18. Query … Result … Query Result Using a Traditional DBMS User/Application Loader Table R Table S

  19. Register Continuous Query (Standing Query) Result Input streams New Approach for Data Streams User/Application Stream Query Processor

  20. 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

  21. High-level Query Q Answer New Challenges in DBMSs DBMS TeraBytes  PetaBytes <CD> <TITLE>Empire B.</TITLE> <ARTIST>Bob Dylan</ARTIST> <COUNTRY>USA</COUNTRY> <COMPANY>Columbia </COMPANY> <PRICE>10.90</PRICE> </CD> Data

  22. Course Logistics • Reference: Database Systems: The Complete Book, by H. Garcia-Molina, J. D. Ullman, and J. Widom • Web site: http://www.cs.duke.edu/courses/fall07/cps216 • Grading: • Project 30% • Homework Assignments 20% • Midterm 20% • Final 30%

  23. Summary: Data Management is Important • Core aspect of most sciences and engineering today • Core need in industry • Cool mix of theory and systems • Chances are you will find something interesting even if you primary interest is elsewhere

More Related