COMP 530 Database Architecture and Implementation

Slides:



Advertisements
Similar presentations
©Silberschatz, Korth and Sudarshan4.1Database System Concepts Lecture-1 Database system,CSE-313, P.B. Dr. M. A. Kashem Associate. Professor. CSE, DUET,
Advertisements

Adapted from: ©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Fly-over Introduction Purpose of Database Systems View of Data Data.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
BD05/06 Chapter 1: Introduction  Purpose of database systems  Data abstraction levels  Data models  SQL :Data Definition Language and Data Manipulation.
Data Definition Language (DDL) Specification notation for defining the database schema –E.g. create table account ( account-number char(10), balance integer)
DATABASE SYSTEM CONCEPTS
On Database Systems.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 1: Introduction.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction n Why Database Systems? n Data Models n Data Definition Language.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Database Management Systems Purpose of Database Systems View of Data.
Introduction overview of DBMS
Dr. Kalpakis CMSC 461, Database Management Systems Introduction.
Introduction overview of DBMS
Database Management System
Introduction to DBMS Purpose of Database Systems View of Data
Introduction to Data bases concepts
CS462: Introduction to Database Systems. ©Silberschatz, Korth and Sudarshan1.2Database System Concepts Course Information Instructor  Kyoung-Don (KD)
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 1: Introduction.
Temple University – CIS Dept. CIS616– Principles of Database Systems V. Megalooikonomou Introduction (based on notes by Silberchatz,Korth, and Sudarshan)
©Silberschatz, Korth and Sudarshan1.1 Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition Language Data Manipulation.
ICOM 5016 – Introduction to Database Systems
ADVANCED DATABASES WITH ORACLE 11g FOR ADDB7311 LEARNING UNIT 1 of 7.
Chapter 1: Introduction. Unite International College1.2Database Management Systems Chapter 1: Introduction Purpose of Database Systems View of Data Database.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Lecture 6: Introduction to Database Management Systems Lecturer: Prof. Kazimierz Subieta.
1 Introduction to databases concepts CCIS – IS department Level 4.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 1: Introduction.
Introduction to Databases
 Introduction Introduction  Purpose of Database SystemsPurpose of Database Systems  Levels of Abstraction Levels of Abstraction  Instances and Schemas.
Module Title? DBMS Introduction to Database Management System.
Chapter 1: Introduction. Unite International College1.2Database Management Systems Chapter 1: Introduction Purpose of Database Systems View of Data Database.
CST203-2 Database Management Systems Lecture 2. One Tier Architecture Eg: In this scenario, a workgroup database is stored in a shared location on a single.
Database Management Systems
Introduction to Database Management Systems. Information Instructor: Csilla Farkas Office: Swearingen 3A43 Office Hours: Monday, Wednesday 4:15 pm – 5:30.
Chapter 1 : Introduction §Purpose of Database Systems §View of Data §Data Models §Data Definition Language §Data Manipulation Language §Transaction Management.
Introduction to Database Management Systems. Information Instructor: Csilla Farkas Office: Swearingen 3A43 Office Hours: M,T,W,Th,F 2:30 pm – 3:30 pm,
©Silberschatz, Korth and Sudarshan1.1Database System Concepts COMP319: Introduction Course Structure Course Assessment Review: DBMS Structure Review: Terminology.
©Silberschatz, Korth and Sudarshan4.1Database System Concepts Database system,CSE-313, P.B. Dr. M. A. Kashem Associate. Professor. CSE, DUET, Gazipur.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
Introduction to Database Management Systems. Information Instructor: Csilla Farkas Office: Swearingen 3A43 Office Hours: Monday, Wednesday 2:30 pm – 3:30.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 1: Introduction.
Mr.Prasad Sawant, MIT Pune India Introduction to DBMS.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
C HAPTER 1: I NTRODUCTION Purpose of Database Systems View of Data Data Models Data Definition Language Data Manipulation Language Transaction Management.
Chapter 1: Introduction
ASET 1 Amity School of Engineering & Technology B. Tech. (CSE/IT), III Semester Database Management Systems Jitendra Rajpurohit.
Database System Concepts Introduction Purpose of Database Systems View of Data Data Models Data Definition Language Data Manipulation Language Transaction.
Databases Salihu Ibrahim Dasuki (PhD) CSC102 INTRODUCTION TO COMPUTER SCIENCE.
RELATIONAL DATABASE MANAGEMENT SYSTEM - I Subject code : BCA-12 and PGDCA 1.
©Silberschatz, Korth and Sudarshan 1.1 Database System Concepts قواعد البيانات Data Base قواعد البيانات CCS 402 Mr. Nedal hayajneh E- mail
CHAPTER 1: INTRODUCTION Purpose of Database Systems View of Data Data Models Data Definition Language Data Manipulation Language Storage Management Database.
D ATABASE MANAGEMENT SYSTEM By Rubel Biswas. W HAT IS I NFORMATION ? It’s just something you can’t avoid. It is generally referred to as data.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 1: Introduction.
Comp 3311 Database Management Systems
CS 325 Spring ‘09 Chapter 1 Goals:
Introduction to DBMS Purpose of Database Systems View of Data
Introduction To DBMS.
Chapter 1: Introduction
Unit 1: INTRODUCTION Database system, Characteristics Database Users
Database Management:.
Chapter 1: Introduction
Introduction to Database Systems
Chapter 1: Introduction
Chapter 1: Introduction
Introduction to DBMS Purpose of Database Systems View of Data
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Presentation transcript:

COMP 530 Database Architecture and Implementation 1. Introduction Department of Computer Science, HKUST Slide 1

Department of Computer Science, HKUST Slide 2 Why Learn DBMS? You want to find a JOB !!! Department of Computer Science, HKUST Slide 2

Big Names in Database Systems Company Product Remarks Oracle Oracle 8i, 9i, etc. World’s 2nd largest software company; CEO, Larry Ellison, world’s 2nd richest IBM DB2, Universal Server World’s 2nd largest after Informix acquisition in 2001 Microsoft SQL Server, Access Access comes with MS Office Sybase Adaptive Server CEO John Chen, grown up in HK MySQL Open Source, acquired by Sun in 2007, which was acquired by Oracle in 2009 Postgres “World’s most advanced Open Source DBMS” Department of Computer Science, HKUST Slide 3

Who Needs Database Systems Typical Applications: Personnel management Inventory and purchase order Insurance policies and customer data … … Corporate databases Web data management Typical Applications: Web page management Personalize web pages … … Department of Computer Science, HKUST Slide 4

Department of Computer Science, HKUST Slide 5 There is a difference between DBMSs (Database Management Systems) and Databases A few people work for Oracle, etc., to develop, enhance or maintain their DBMS products Most people make a living working as DB designers, DB programmers or DB Administrators Department of Computer Science, HKUST Slide 5

Department of Computer Science, HKUST Slide 6 What is in a Database? A database contains information about a particular enterprise or a particular application. E.g., a database for an enterprise may contain everything needed for the planning and operation of the enterprise: customer information, employee information, product information, sales and expenses, etc. You don’t have to be a company to use a database: you can store your personal information, expenses, phone numbers in a database (e.g., using Access on a PC). As a matter of fact, you could store all data pertinent to a particular purpose in a database. This usually means that a database stores data that are related to each other. Department of Computer Science, HKUST Slide 6

Department of Computer Science, HKUST Slide 7 Database Design HKUST Academic Registration database: students: names, address, … courses: course-no, course-names, … classroom: number, location, … db designer 1 Estate Management database: classroom: number, location, … office: number, location, … faculty-residence: building-no, … student-residence: hall-no, … db designer 2 Department of Computer Science, HKUST Slide 7

Is a database the same as a bunch of files? You can store data in a file or a set of files, but … How do you input data and to get back the data from the files? A database is managed by a DBMS. Department of Computer Science, HKUST Slide 8

Department of Computer Science, HKUST Slide 9 Before we have DBMS Applications Data Files User Inventory Control User Customer Order Question: When a customer ordered 10 PC monitors, how many files do you have to update? Key issues: data sharing, data redundancy Department of Computer Science, HKUST Slide 9

Department of Computer Science, HKUST Slide 10 A Simple Architecture SQL C/C++ Programs DBMS Shared facilities: Backup and recovery Data storage and access modules Programming tools, etc. Databases Applications Department of Computer Science, HKUST Slide 10

Purposes of Database Systems Database management systems were developed to handle the difficulties caused by different people writing different applications independently. Department of Computer Science, HKUST Slide 11

Department of Computer Science, HKUST Slide 12 Specifically … A DBMS attempts to resolve the following problems: Data redundancy and inconsistency by keeping one copy of a data item in the database Difficulty in accessing data by provided query languages and shared libraries Data isolation (multiple files and formats) Integrity problems by enforcing constraints (age > 0) Atomicity of updates Concurrent access by multiple users Security problems Department of Computer Science, HKUST Slide 12

Department of Computer Science, HKUST Slide 13 Data Independence One big problem in application development is the separation of applications from data Do I have change my program when I … replace my hard drive? store the data in a b-tree instead of a hash file? partition the data into two physical files (or merge two physical files into one)? store salary as floating point number instead of integer? develop other applications that use the same set of data? add more data fields to support other applications? … … Independence between Data and Programs/Applications Department of Computer Science, HKUST Slide 13

Department of Computer Science, HKUST Slide 14 Data Independence Ability to modify a schema definition in one level without affecting a schema definition in the next higher level. The interfaces between the various levels and components should be well defined so that changes in some parts do not seriously influence others. Two levels of data independence: - Physical data independence - Logical data independence Department of Computer Science, HKUST Slide 14

Department of Computer Science, HKUST Slide 15 Data Abstraction The answer to the previous questions is to introduce levels of abstraction of indirection. Consider how do function calls allow you to change a part of your program without affecting other parts? Main Program functions data Department of Computer Science, HKUST Slide 15

Three Levels of Abstraction Payroll Inventory Sales Company database Files on disks view 1 view 2 view n ..……... Logical view Physical view Department of Computer Science, HKUST Slide 16

Department of Computer Science, HKUST Slide 17 view logical physical View definitions Logical schema Physical schema Application Department of Computer Science, HKUST Slide 17

Three Levels of Abstraction (cont.) Physical level: describe how a record is stored on disks. e.g., “Divide the customer records into 3 partitions and store them on disks 1, 2 and 3.” Logical level: describes data stored in database, and the relationships among the data. Similar to defining a record type in Pascal or C: Type customer = record name: string; street: string; city: integer; end; View level: Define a subset of the database for a particular application. Views can also hide information (e.g. salary) for security purposes. Department of Computer Science, HKUST Slide 18

An Example of Data Independence Data on disk John Law … … 1129 Program accessing data directly has to know: first 4 bytes is an ID number next 10 bytes is an employee name program Schema Data on disk John Law … … 1129 Employee: ID: integer Name char(10) DBMS program Department of Computer Science, HKUST Slide 19

Department of Computer Science, HKUST Slide 20 Instances and Schemas Each level is defined by a schema, which defines the data at the corresponding level A logical schema defines the logical structure of the database (e.g., set of customers and accounts and the relationship between them) A physical schema defines the file formats and locations A database instance refers to the actual content of the database at a particular point in time. A database instance must conform to the corresponding schema Department of Computer Science, HKUST Slide 20

Department of Computer Science, HKUST Slide 21 Data Models A collection of tools for describing: data data relationships data semantics data constraints Department of Computer Science, HKUST Slide 21

Entity-Relationship Model Example of entity-relationship model social-security customer-street balance account-number customer-city customer-name DEPOSITER CUSTOMER ACCOUNT Department of Computer Science, HKUST Slide 22

Department of Computer Science, HKUST Slide 23 Relational Model Example of tabular data in the relational model: customer- name social- security street city account- number Johnson Smith Jones 192-83-7465 019-28-3746 321-12-3123 Alma North Main Palo Alto Rye Harrison A-101 A-215 A-201 A-217 account-number balance 500 900 700 750 Department of Computer Science, HKUST Slide 23

Data Definition Language (DDL) Specification notation for defining the database schema Express what were in the previous two slides to the DBMS in a formal language Data storage and definition language - special type of DDL in which the storage structure and access methods used by the database system are specified Department of Computer Science, HKUST Slide 24

Data Manipulation Language (DML) Language for accessing and manipulation the data organized by the appropriate data model Two classes of languages Procedural - user specifies what data is required and how to get those data. Nonprocedural - user specifies what data is required without specifying how to get those data Department of Computer Science, HKUST Slide 25

Transaction Management A transaction is a collection of operations that performs a single logical function in database application time Transaction 1 Transaction 2 Conflicting read/write Transaction 1 Department of Computer Science, HKUST Slide 26

Department of Computer Science, HKUST Slide 27 Transaction Management (cont.) Transaction-management component ensures that the database remains in a consistent (correct) state despite system failures (e.g. power failures and operating system crashes) and transaction failures. Concurrency-control manager controls the interaction among the concurrent transactions, to ensure the consistency of the database. Department of Computer Science, HKUST Slide 27

Department of Computer Science, HKUST Slide 28 Storage Management A storage manager is a program module that provides the interface between the low-level data stored in the database and the application programs and queries submitted to the system. The storage manager is responsible for the following tasks: interaction with the file manager efficient storing, retrieving, and updating of data. Department of Computer Science, HKUST Slide 28

Database Administrator (DBA) Coordinates all the activities of the database system; the database administrator has good understanding of the enterprise’s information resources and needs. Database administrator’s duties include: Schema definition Specifying integrity constraints Storage structure and access method definition Schema and physical organization modification Granting user authority to access the database Acting as liaison with users Monitoring performance and responding to changes in requirements Primary job of a database designer More system oriented Department of Computer Science, HKUST Slide 29

Department of Computer Science, HKUST Slide 30 Database Users Users are differentiated by the way they expected to interact with the system Application programmers Develop applications that interact with DBMS through DML calls Sophisticated users form requests in a database query language mostly one-time ad hoc queries End users invoke one of the existing application programs (e.g., print monthly sales report) Interact with applications through GUI Department of Computer Science, HKUST Slide 30