lecture 1: overview of csci 485 notes: i presented parts of this lecture as a keynote at...
TRANSCRIPT
Lecture 1: Overview of CSCI 485Lecture 1: Overview of CSCI 485Notes: I presented parts of this lecture as a keynote at Educator’s Symposium of OOPSLANotes: I presented parts of this lecture as a keynote at Educator’s Symposium of OOPSLA
Shahram GhandeharizadehShahram GhandeharizadehAssociate ProfessorAssociate ProfessorComputer Science DepartmentComputer Science DepartmentUniversity of Southern CaliforniaUniversity of Southern California
LogisticsLogistics
Required text book:Required text book: Database System Concepts, Silberschatz, Database System Concepts, Silberschatz,
Korth & Sudarshan. Available in the Korth & Sudarshan. Available in the bookstore.bookstore.
Please start to read Chapter 6 and Section Please start to read Chapter 6 and Section 7.1 for the next lecture7.1 for the next lecture
Pre-req for the course:Pre-req for the course: CS201: Data StructuresCS201: Data Structures Knowledge of an object-oriented Knowledge of an object-oriented
programming languageprogramming language such as C++, such as C++, Java, C#Java, C#
Instructor DetailsInstructor Details
Dr. Shahram GhandeharizadehDr. Shahram Ghandeharizadeh
Office: SAL 208Office: SAL 208
E-mail: [email protected]: [email protected]
Phone: 213-740-4781Phone: 213-740-4781
Office Hours:Office Hours:Tuesday: 12:30 to 2 pmTuesday: 12:30 to 2 pm
Thursday: 4 to 5 pmThursday: 4 to 5 pm
Class URL: http://dblab.usc.edu/csci485Class URL: http://dblab.usc.edu/csci485
OutlineOutline
Motivation for DBMSMotivation for DBMS An outline for the course materialAn outline for the course material Grading: Assignments and projectsGrading: Assignments and projects
Database Management Database Management Systems (DBMS)Systems (DBMS) Used almost on a daily basis for either Used almost on a daily basis for either
individual or business use.individual or business use.
Relational database vendors were one Relational database vendors were one of the fastest growing sectors during of the fastest growing sectors during the .COM boom!the .COM boom!
DATABASE & DBMSDATABASE & DBMS
DatabaseDatabase: An integrated collection of : An integrated collection of data, usually stored on secondary data, usually stored on secondary storage, typically describing the storage, typically describing the activities of one or more related activities of one or more related organizations.organizations.
Database management systemDatabase management system ((DBMSDBMS)): : A collection of software/programs A collection of software/programs designed to assist in maintaining and designed to assist in maintaining and utilizing large collections of data.utilizing large collections of data.
BEFORE DBMSBEFORE DBMS
Data
Data
User 1
User 2
Application programs
Application programs
Data managed by
DBMS
AFTER DBMSAFTER DBMS
User 1
User 2
DBMS
Application programs
Application programs
WHY A DBMS?WHY A DBMS?1.1. Reduced application development timeReduced application development time
2.2. Data independence: Application programs not dependent on Data independence: Application programs not dependent on data representation and storage detailsdata representation and storage details
3.3. Data sharing: data is better utilized (discovered and reused), Data sharing: data is better utilized (discovered and reused), redundancy of data is minimizedredundancy of data is minimized
4.4. Data integrity and consistency: one may enforce consistency Data integrity and consistency: one may enforce consistency constraints on data, e.g., number of seats sold ≤ number of constraints on data, e.g., number of seats sold ≤ number of seats on the plane × 1.1seats on the plane × 1.1
5.5. Centralized control: DBA tunes the database to balance user's Centralized control: DBA tunes the database to balance user's needsneeds
6.6. Security: mechanisms to prevent unauthorized access. These Security: mechanisms to prevent unauthorized access. These mechanisms are based on content instead of file-oriented mechanisms are based on content instead of file-oriented approach.approach.
7.7. Concurrency control: avoids undesirable race conditions that Concurrency control: avoids undesirable race conditions that arise with simultaneous access/updates to dataarise with simultaneous access/updates to data
8.8. Crash recovery: ensures the integrity of data in the presence of Crash recovery: ensures the integrity of data in the presence of failuresfailures
DBMS ARCHITECTUREDBMS ARCHITECTURE
User 1
User n
…
Conceptual schema
Conceptual schema
Physical data
DBDBMS
Data ModelsData ModelsConceptualConceptual
LogicalLogical
PhysicalPhysical
Data Models (Example)Data Models (Example)
Build a database of all my Build a database of all my assets for licensing and assets for licensing and
royalty collectionroyalty collection
Data ModelsData ModelsConceptualConceptual
LogicalLogical
PhysicalPhysical
ChallengesChallengesConceptualConceptual
LogicalLogical
PhysicalPhysical
Abstraction, Abstraction, Inheritance, Inheritance, EncapsulationEncapsulation
Reduction to tables Reduction to tables with minimal: data with minimal: data duplication, duplication, potential for data potential for data loss and update loss and update anomaliesanomalies
Effective use of a DBMS, Effective use of a DBMS, management of management of mismatch between mismatch between tables and OO tables and OO constructs, Index constructs, Index structures, CC & Crash structures, CC & Crash recovery, Optimization recovery, Optimization techniquestechniques
ChallengesChallengesConceptualConceptual
LogicalLogical
PhysicalPhysical
E-R data modelE-R data model
Relational Data Relational Data model, SQL, model, SQL, Relational AlgebraRelational Algebra
Different kinds of Different kinds of storage, A DBMS storage, A DBMS architecture, Index architecture, Index structures, CC & Crash structures, CC & Crash recovery, Optimization recovery, Optimization techniques, Techniques techniques, Techniques to build a DBMSto build a DBMS
5 Normal Forms5 Normal Forms
Relational DBMSRelational DBMS
Why?Why? Performance!Performance! Reduced application development timeReduced application development time Use of SQL makes access to data more Use of SQL makes access to data more
uniform: uniform: Software modularity, Software modularity, ExtensibilityExtensibility
Challenge 2Challenge 2
Two ways to teach this course:Two ways to teach this course: How to How to implementimplement a DBMS? a DBMS?
Protocols to realize atomic property of Protocols to realize atomic property of transactionstransactions
How to How to useuse a DBMS? a DBMS? Setup a web server with a database and build Setup a web server with a database and build
a shopping baga shopping bag
Key difference: discussion at both the Key difference: discussion at both the logical and physical levelslogical and physical levels
Both require use of OO constructsBoth require use of OO constructs
GradingGrading
Midterm 1: 35%Midterm 1: 35% Midterm 2: 35%Midterm 2: 35% Assignments: 15%Assignments: 15% Project: 15% (Questionable due to lack Project: 15% (Questionable due to lack
of a TA)of a TA)
Assignments (15%)Assignments (15%)
Social networking sites:Social networking sites: Visit myspace.com and sign-up.Visit myspace.com and sign-up. Become my friends – whether you like it or not Become my friends – whether you like it or not Use the bulletin capability to communicate. Use the bulletin capability to communicate.
Objective is to understand the functionality of Objective is to understand the functionality of the bulletin board. First message might be a the bulletin board. First message might be a quick note about why you have signed up for quick note about why you have signed up for csci 485.csci 485.
Homework 1: Write a description of the bulletin Homework 1: Write a description of the bulletin board and its functionality.board and its functionality.
Homework 2: Draw the ER diagram for the web Homework 2: Draw the ER diagram for the web site, focusing on its Bulletin board.site, focusing on its Bulletin board.
Homework 3: Reduce the ER diagram to a Homework 3: Reduce the ER diagram to a collection of tables.collection of tables.
Project (15%)Project (15%)
Part 1: Implement a Bulletin board Part 1: Implement a Bulletin board using a centralized database using a centralized database management system.management system.
Part 2: Extend your implementation to Part 2: Extend your implementation to a database partitioned across multiple a database partitioned across multiple servers.servers.