Docsity

Lecture Notes on Database Management System | CMPSCI 645, Study notes of Principles of Database Management

Partial preview of the text

Download Lecture Notes on Database Management System | CMPSCI 645 and more Study notes Principles of Database Management in PDF only on Docsity!

CMPSCI 645

Database Design & Implementation

Instructor:

Gerome Miklau

Welcome to

Overview of Databases

Gerome Miklau

CMPSCI 645 – Database Design & Implementation

UMass Amherst

Jan 29, 2008

Some slide content courtesy of Zack Ives, Ramakrishnan & Gehrke, Dan Suciu, Ullman & Widom

Databases & DBMS’s

  • A database is a large, integrated collection of

data.

  • A database management system (DBMS) is a

collection of software designed to store and manage

databases, allowing:

  • Define the kind of data stored
  • Querying/updating interface
  • Reliable storage & recovery of 100s of GB
  • Control access to data from many concurrent users

Can filesystems do it?

• Schema for files is limited

• No query language for data in files

• Files can store large amounts of data, but

  • no efficient access to items within file
  • no recovery from failure

• Concurrent access not safe

No

Early DB systems

• Tree-based hierarchical data model

• Graph-based network data model

• Encouraged users to think about data

the way it was stored.

• No high level query language

Data model

The data model includes basic assumptions about what’s

an “item” of data, how to represent it and interpret it.

The Relational Model

  • The relational data model (Codd, 1970):
    • Data independence: details of physical storage are

hidden from users

  • High-level declarative query language
    • say what you want, not how to compute it.
    • mathematical foundation
  • A theory of normalization guides the design of

relations

Side-note: Turing Awards in Databases

1973: Bachman, networked data model

1981: Codd, relational model

1998: Jim Gray, transaction processing

Benefit #2: Efficiency and

Scale

  • Efficient storage of hundreds of GBs of data
  • Efficient access to data
  • Rapid processing of transactions

Benefit #3: Management of

Concurrency and Reliability

  • Simultaneous transactions handled safely.
  • Recovery of system data after system failure.

• More formally: the ACID properties

  • Atomicity - all or nothing
  • Consistency - sensible state not violated
  • Isolation - separated from effects
  • Durability - once completed, never lost

Conceptual Design

STUDENT
COURSE

Takes

name

sid

cid name

PROFESSOR

Teaches

semester

fid name

Designing a Schema (Set of

Relations)

  • Convert to tables +

constraints

  • Then need to do

“physical” design: the

layout on disk, indices,

etc.

sid name

1 Jill

2 Bo

3 Maya

fid name

1 Diao

2 Saul

8 Weems

sid cid

1 645

1 683

3 635

cid name sem

645 DB F

683 AI S

635 Arch F

fid cid

1 645

2 683

8 635

STUDENT

Takes

COURSE
PROFESSOR

Teaches

Queries, behind the scene

Query execution plan:

SELECT C.name

FROM Students S, Takes T, Courses C

WHERE S.name=“Mary” and

S.sid = T.sid and T.cid = C.cid

Declarative SQL query

Students Takes

sid=sid

sname

name=“Mary”

cid=cid

Courses

The optimizer chooses the best execution plan for a query

An Issue: 80% of the World’s

Data is Not in a DB!

Examples:

  • Scientific data

(large images, complex programs that analyze the data)

  • Personal data
  • WWW and email

(some of it is stored in something resembling a DBMS)

Data management is expanding to tackle these

problems

Database Research

  • One of the broadest, most exciting areas in CS!
  • A microcosm of CS in general
    • languages, operating systems, concurrent

programming, data structures, algorithms,

theory, distributed systems, statistical

techniques.

  • Theory and systems well-integrated.

Recent Trends in Databases

  • XML
    • Relational databases with XML support
    • Middleware between XML and relational databases
    • Large-scale XML message systems
  • Main memory database systems
  • Peer data management
  • Stream data management
  • Model management, provenance
  • Security and privacy
  • Modeling uncertainty, probabilistic databases