Syllabus - PowerPoint PPT Presentation

1 / 29
About This Presentation
Title:

Syllabus

Description:

The relational model of data is the most widely used model today. ... One of the most important benefits of using a DBMS! Introduction to Database Systems ... – PowerPoint PPT presentation

Number of Views:29
Avg rating:3.0/5.0
Slides: 30
Provided by: RaghuRama93
Category:

less

Transcript and Presenter's Notes

Title: Syllabus


1
Syllabus
  • Instructor???(IM309)
  • TA???(IM300)
  • Textbook (I) Database Management Systems
  • by Ramakrishnan Gehrke
  • (II) Data Mining-Concepts
    and
  • Techniques, by
    Jiawei Han
  • and Micheline
    Kamber
  • Grading policy, Mid-term Final Exam.

2
Unit I Introduction to Database Systems
3
Contents of this Unit
  • Basic concepts
  • file systems DBMSs
  • data modeling
  • concurrent, fault-tolerant data management
  • DBMS architecture
  • An introduction to the Relational Model SQL

4
What Is a DBMS?
  • A very large, integrated collection of data.
  • Models real-world enterprise.
  • Entities (e.g., students, courses)
  • Relationships (e.g., Janet Reno is taking CS186)
  • A Database Management System (DBMS) is a software
    package designed to store and manage databases.

5
Database Management Systems
  • What more could we want than a file system?
  • Simple, efficient ad hoc1 queries
  • concurrency control
  • recovery
  • benefits of good data modeling

1ad hoc formed or used for specific or immediate
problems or needs
6
Functionality of a DBMS
  • Persistent storage management
  • Transaction management
  • Resiliency recovery from crashes.
  • Separation between logical and physical views of
    the data.
  • High level query and data manipulation language.
  • Efficient query processing
  • Interface with programming languages

7
Describing Data Data Models
  • A data model is a collection of concepts for
    describing data.
  • A schema is a description of a particular
    collection of data, using the a given data model.
  • The relational model of data is the most widely
    used model today.
  • Main concept relation, basically a table with
    rows and columns.
  • Every relation has a schema, which describes the
    columns, or fields.

8
Levels of Abstraction
  • Many views, single conceptual (logical) schema
    and physical schema.
  • Views describe how users see the data.
  • Conceptual schema defines logical structure
  • Physical schema describes the files and indexes
    used.

View 1
View 2
View 3
Conceptual Schema
Physical Schema
9
Example University Database
  • Conceptual schema
  • Students(sid string, name string, login
    string,
  • age integer, gpareal)
  • Courses(cid string, cnamestring,
    creditsinteger)
  • Enrolled(sidstring, cidstring, gradestring)
  • Physical schema
  • Relations stored as unordered files.
  • Index on first column of Students.
  • External Schema (View)
  • Course_info(cidstring,enrollmentinteger)

10
Data Independence
  • Applications insulated from how data is
    structured and stored.
  • Logical data independence Protection from
    changes in logical structure of data.
  • Physical data independence Protection from
    changes in physical structure of data.
  • One of the most important benefits of using a
    DBMS!

11
Objectives of Three-Level Architecture
  • All users should be able to access same data.
  • A user's view is immune to changes made in other
    views.
  • Users should not need to know physical database
    storage details.

6
12
Objectives of Three-Level Architecture
  • DBA should be able to change database storage
    structures without affecting the users' views.
  • Internal structure of database should be
    unaffected by changes to physical aspects of
    storage.
  • DBA should be able to change conceptual structure
    of database without affecting all users.

7
13
ANSI-SPARC Three-level Architecture
8
14
ANSI-SPARC Three-level Architecture
  • External Level
  • Users' view of the database. Describes that part
    of database that is relevant to a particular
    user.
  • Conceptual Level
  • Community view of the database. Describes what
    data is stored in database and relationships
    among the data.

9
15
ANSI-SPARC Three-level Architecture
  • Internal Level
  • Physical representation of the database on the
    computer. Describes how the data is stored in
    the database.

10
16
Differences between Three Levels of ANSI-SPARC
Architecture
11
17
Data Independence
  • Logical Data Independence
  • Refers to immunity of external schemas to changes
    in conceptual schema.
  • Conceptual schema changes e.g. addition/removal
    of entities.
  • Should not require changes to external schema or
    rewrites of application programs.

12
18
Data Independence
  • Physical Data Independence
  • Refers to immunity of conceptual schema to
    changes in the internal schema.
  • Internal schema changes e.g. using different file
    organizations, storage structures/devices.
  • Should not require change to conceptual or
    external schemas.

13
19
Concurrency Control
  • Concurrent execution of user programs key to
    good DBMS performance.
  • Disk accesses frequent, pretty slow
  • Keep the CPU working on several programs
    concurrently.
  • Interleaving actions of different programs
    trouble!
  • e.g., deposit withdrawal on same account at
    once
  • DBMS ensures such problems dont arise users
    can pretend they are using a single-user system.
  • Thank goodness!

20
Transaction An Execution of a DB Program
  • Key concept is a transaction an atomic sequence
    of database actions (reads/writes).
  • Each transaction, executed completely, must take
    the DB from one consistent state to another.
  • Users can specify simple integrity constraints on
    the data. The DBMS will enforce these
    constraints.
  • Beyond this, the DBMS does not understand the
    semantics of the data. (E.g., it does not
    understand how the interest on a bank account is
    computed).
  • Ensuring that a single transaction (run alone)
    preserves consistency is ultimately the users
    responsibility!

21
Scheduling Concurrent Transactions
  • DBMS ensures that execution of T1, ... , Tn is
    equivalent to some serial execution T1 ... Tn.
  • Before reading/writing an object, a transaction
    requests a lock on the object, and waits till the
    DBMS gives it the lock. All locks are released
    at the end of the transaction. (Strict 2PL
    locking protocol.)
  • Idea If an action of Ti (say, writing X) affects
    Tj (which perhaps reads X), one of them, say Ti,
    will obtain the lock on X first and Tj is forced
    to wait until Ti completes this effectively
    orders the transactions.
  • What if Tj already has a lock on Y and Ti later
    requests a lock on Y? (Deadlock!) Ti or Tj is
    aborted and restarted!

22
Ensuring Atomicity
  • DBMS ensures atomicity (all-or-nothing property)
    even if system crashes in the middle of a Xact.
  • Idea Keep a log (history) of all actions carried
    out by the DBMS while executing a set of Xacts
  • Before a change is made to the database, the
    corresponding log entry is forced to a safe
    location. (WAL protocol OS support for this is
    often inadequate.)
  • After a crash, the effects of partially executed
    transactions are undone using the log. (Thanks to
    WAL, if log entry wasnt saved before the crash,
    corresponding change was not applied to database!)

23
The Log
  • The following actions are recorded in the log
  • Ti writes an object the old value and the new
    value.
  • Log record must go to disk before the changed
    page!
  • Ti commits/aborts a log record indicating this
    action.
  • Log records chained together by Xact id, so its
    easy to undo a specific Xact (e.g., to resolve a
    deadlock).
  • Log is often duplexed and archived on stable
    storage.
  • All log related activities (and in fact, all CC
    related activities such as lock/unlock, dealing
    with deadlocks etc.) are handled transparently by
    the DBMS.

24
Structure of a DBMS
These layers must consider concurrency control
and recovery
  • A typical DBMS has a layered architecture.
  • The figure does not show the concurrency control
    and recovery components.
  • This is one of several possible architectures
    each system has its own variations.

25

Query update
User/ Application
Query optimizer
Query execution plan
Execution engine
Record, index requests
Index/record mgr.
Page commands
Buffer manager
Read/write pages
Storage manager
storage
26
Advantages of a DBMS
  • Data independence
  • Efficient data access
  • Data integrity security
  • Data administration
  • Concurrent access, crash recovery
  • Reduced application development time
  • So why not use them always?
  • Can be expensive, complicated to set up and
    maintain
  • This cost complexity must be offset by need

- Often worth it!
27
Databases make these folks happy ...
  • DBMS vendors, programmers
  • End users in many fields
  • DB application programmers
  • Build data entry data analysis tools on top of
    DBMSs
  • Database administrators (DBAs)
  • Design logical /physical schemas
  • Handle security and authorization
  • Data availability, crash recovery
  • Database tuning as needs evolve

Must understand how a DBMS works!
28
Summary
  • DBMS used to maintain, query large datasets.
  • Benefits include recovery from system crashes,
    concurrent access, quick application development,
    data integrity and security.
  • Levels of abstraction give data independence.
  • A DBMS typically has a layered architecture.
  • and...

29
Summary, cont.
  • DBAs, DB developers hold
  • critical jobs and are
  • well-paid
  • DBMS RD is one of the broadest,
  • most exciting areas in CS
Write a Comment
User Comments (0)
About PowerShow.com