Docsity

Advanced Database Systems-Lecture 01 Slides-Computer Science, Slides of Database Management Systems (DBMS)

Toggle sidebar
bg1
1
Introduction
CPS 216
Advanced Database Systems
2
Why are you here?
īš™Aren’t databases just
Trivial exercises in first-order logic (says AI)?
Bunch of out-of-fashion I/O-efficient indexes and
algorithms (says Algorithms)?
A fancy file system with a narrow application (says OS)?
īš™False—but they do show databases cut across many
different areas of computer science research
Chances are you will find something interesting even if
you primary interest is elsewhere
3
Course goals
īš™Become a ā€œpower userā€ of commercial database
systems
īš™Learn to apply database ideas/techniques to new
applications and other areas of computer science
īš™Get a solid background for doing database research
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Advanced Database Systems-Lecture 01 Slides-Computer Science and more Slides Database Management Systems (DBMS) in PDF only on Docsity!

Introduction

CPS 216

Advanced Database Systems

2

Why are you here?

Ā™ Aren’t databases just

ƒ Trivial exercises in first-order logic (says AI)? ƒ Bunch of out-of-fashion I/O-efficient indexes and algorithms (says Algorithms)? ƒ A fancy file system with a narrow application (says OS)?

Ā™ False—but they do show databases cut across many

different areas of computer science research

ƒ Chances are you will find something interesting even if you primary interest is elsewhere

3

Course goals

Ā™ Become a ā€œpower userā€ of commercial database

systems

Ā™ Learn to apply database ideas/techniques to new

applications and other areas of computer science

Ā™ Get a solid background for doing database research

Course roadmap

Ā™ The basics

ƒ Relational algebra, database design, SQL )Covered at a fast pace in the first few weeks

Ā™ The internals

ƒ Storage, indexing, query processing and optimization, transaction processing

Ā™ The extras

ƒ XML: basics, storage, indexing, query processing ƒ Selected topics: TBD

5

What is a database system?

From Oxford Dictionary:

Ā™ Database: an organized body of related information

Ā™ Database system, DataBase Management System

(DBMS): a software system that facilitates the

creation and maintenance and use of an electronic

database

6

What do you want from a DBMS?

Ā™ Answer queries (questions) about data Ā™ Update data

Ā™ And keep data around (persistent)

Ā™ Example: a traditional banking application ƒ Each account belongs to a branch, has a number, an owner, a balance, … ƒ Each branch has a location, a manager, … ƒ Query: What’s the balance in Homer Simpson’s account? ƒ Modification: Homer withdraws $ ƒ Persistency: Homer will be pretty upset if his balance disappears after a power outage

Observations

Ā™ Tons of tricks (not only in storage and query

processing, but also in concurrency control,

recovery, etc.)

Ā™ Different tricks may work better in different usage

scenarios

Ā™ Same tricks get used over and over again in different

applications

11

The birth of DBMS – 1

(Pretty drawing stolen from Hans-J. Schek’s VLDB 2000 slides)

12

The birth of DBMS – 2

(Pretty drawing stolen from Hans-J. Schek’s VLDB 2000 slides)

The birth of DBMS – 3

(Pretty drawing stolen from Hans-J. Schek’s VLDB 2000 slides)

14

Early efforts

Ā™ ā€œFactoring outā€ data management functionalities

and from applications standardizing these

functionalities is an important first step

ƒ CODASYL standard (circa 1960’s) )Bachman got a Turing award for this in 1973

Ā™ But getting the abstraction right (the API between

applications and the DBMS) is still tricky

15

CODASYL

Ā™ Query: Who have accounts with 0 balance managed by a branch in Springfield?

Ā™ Pseudo-code of a CODASYL application:

Use index on account(balance) to get accounts with 0 balance; For each account record: Get the branch id of this account; Use index on branch(id) to get the branch record; If the branch record’s location field reads ā€œSpringfieldā€: Output the owner field of the account record.

Ā™ Programmer controls ā€œnavigationā€: accounts → branches ƒ How about branches → accounts?

Major DBMS today

Ā™ Oracle

Ā™ IBM DB2 (from System R, System R*, Starburst)

Ā™ Microsoft SQL Server

Ā™ NCR Teradata

Ā™ Sybase

Ā™ Informix (acquired by IBM)

Ā™ PostgreSQL (from UC Berkeley’s Ingres, Postgres)

Ā™ Tandem NonStop (acquired by Compaq, now HP)

Ā™ MySQL and Microsoft Access?

relational

inside

20

Modern DBMS features

Ā™ Persistent storage of data

Ā™ Logical data model; declarative queries and updates

→ physical data independence

ƒ Relational model is the dominating technology today ƒ Object-oriented model works in some niche markets ƒ XML is a wanna-be )In practice, many vendors extend relational model with object-oriented and XML features

) What else?

21

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:

23

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:

24

Concurrency control in DBMS

Ā™ Similar to concurrent programming problems

ƒ But data not main-memory variables

Ā™ Appears similar to file system concurrent access?

ƒ Approach taken by MySQL initially; now MySQL offers better alternatives (fun reading: http://openacs.org/philosophy/why-not-mysql.html) ƒ But want to control at much finer granularity

  • Or else one withdrawal would lock up all accounts!

People working with databases

Ā™ End users: query/update databases through application user interfaces (e.g., Amazon.com, 1-800-DISCOVER, etc.)

Ā™ Database designers: design database ā€œschemaā€ to model aspects of the real world

Ā™ Database application developers: build applications that interface with databases

Ā™ Database administrators (a.k.a. DBA’s): load, back up, and restore data, fine-tune databases for performance

Ā™ DBMS implementors: develop the DBMS or specialized data management software, implement new techniques for query processing and optimization inside DBMS

29

Course information

Ā™ Book

ƒ Recommended reference: Database Systems: The Complete Book , by H. Garcia-Molina, J. D. Ullman, and J. Widom

Ā™ Web site (http://www.cs.duke.edu/courses/fall05/cps216/)

ƒ Course info, office hours, syllabus, reference sections in GMUW ƒ Lecture slides, assignments, programming notes

Ā™ Blackboard: for posting grades only

Ā™ Newsgroup (duke.cs.cps216): for questions and

answers

30

Course load

Ā™ Reading assignments (11%)

Ā™ 4 homework assignments (24%)

ƒ Programming included

Ā™ Course project (35%)

ƒ Details to be given in the third week of class

Ā™ Open-book, open-notes midterm (15%)

Ā™ Open-book, open-notes final (15%)

ƒ Comprehensive, but with emphasis on the second half of the course

Reading assignment for next week

Ā™ Codd. ā€œA Relational Model of Data for Large Shared

Data Banks.ā€ Comm. of ACM , 13(6), 1970

ƒ Note: If you are new to relational model and algebra, do NOT read this paper until we cover these topics in lecture next Tuesday