Upload
ahfiki
View
19.028
Download
2
Embed Size (px)
Citation preview
Database Systems Database Systems Basic ConceptsBasic Concepts
Dr. Ali H. El-BastawissyFaculty of computers and Informatics
Cairo University
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 2
Unit01 OutlinesUnit01 Outlines
• Types of Databases and Database Applications• Basic Definitions• Typical DBMS Functionality• Examples of a Database• Main Characteristics of the Database Approach• Database Users• Advantages of Using the Database Approach• When Not to Use Databases
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 3
DefinitionsDefinitions
• Data: known facts that can be recorded • Database: a collection of data
• represents some aspect of the real world• logically coherent collection (not a random collection)• designed, built & populated for a specific purpose
• Database Management System: the software that manages the data
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 4
Database SystemsDatabase Systems
Payroll
GradesSchedules
DataDefinition
• Data Integrity, Data definition, DBMS
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 5
Characteristics of the Database ApproachCharacteristics of the Database Approach
• insulation of programs & data• support of multiple user views• use of a catalog to support database descriptions
DBA collection of described and interrelated data stored and managed by general purpose DBMS
Dr. Ali El-Bastawissy 2007
DB01: Introduction to DB Slide 6
DBMS FunctionsDBMS Functions
• Data Dictionary• Data Storage Management• Data Transformation and Presentation• Security• Multi-user Access Control• Backup and Recovery• Data Integrity• Database Access Language • Database Communication Interface
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 7
Database System EnvironmentDatabase System Environment
Application Programs/Queries
Software: Query Processing & Programs
Software: Data Access
DBMSSoftware
DatabaseSystem
Users/Programmers
DatabaseDefinition Database
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 8
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 9
Database PlayersDatabase Players• DBA
– access authorization, coordination & monitoring database usage, problem determination, performance tuning etc
• Designers– identify the requirements & chose the appropriate
structures to represent & store the data• Users (Casual, parametric, Sophisticated, stand-alone)• System analysts & application programmers• DBMS system designers & implementers• Tool developers• Operators & maintenance personnel
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 10
DBMS InterfacesDBMS Interfaces
• Menu-based Interfaces for browsing• Forms-based Interfaces• GUIs• Natural Language Interfaces• Specialized Interfaces• Interfaces for the DBA• Query Language
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 11
Classification of DBMSsClassification of DBMSs
• Data Model Classification – relational, network, hierarchical, object-oriented
• Number of users– single user or multi-user
• Number of Sites– centralized vs distributed
• Cost of the DBMS
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 12
Areas of Database StudyAreas of Database Study• DBMS software • Database Design • Query Languages• Application Programming• Database Administration• Data Warehousing & Data Mining
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 13
• Costs of using a DBMS:– High initial investment and possible need for additional
hardware.– Overhead for providing generality, security, concurrency
control, recovery, and integrity functions.• When a DBMS may be unnecessary:
– If the database and applications are simple, well defined, and not expected to change.
– If there are stringent real-time requirements that may not be met because of DBMS overhead.
– If access to data by multiple users is not required.
When not to use a DBMSWhen not to use a DBMS
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 14
• When no DBMS may suffice:– If the database system is not able to handle the
complexity of data because of modeling limitations– If the database users need special operations not
supported by the DBMS.
When not to use a DBMSWhen not to use a DBMS
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 15
Data ModelData Model
• A collection of concepts that can be used to define the DB structure (data items& types, relationships, operations|behavior, and constraints).
• Some Data Models:– Entity Relationship model– Relational Model– hierarchical & network models– object-data models
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 16
ConceptualModels Entities, attributes
& relationships
ImplementationModels
Record Structures
Record formats, record orderings, access paths
PhysicalModelsCat
egor
ies o
f Dat
a M
odel
s
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 17
• Conceptual (high-level, semantic) data models:– Provide concepts that are close to the way many users perceive
data. • (Also called entity-based or object-based data models.)
• Physical (low-level, internal) data models:– Provide concepts that describe details of how data is stored in
the computer. These are usually specified in an ad-hoc manner through DBMS design and administration manuals
• Implementation (representational) data models:– Provide concepts that fall between the above two, used by
many commercial DBMS implementations (e.g. relational data models used in many commercial systems).
Categories of Data ModelsCategories of Data Models
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 18
Three-Schema ArchitectureThree-Schema Architecture
ExternalView #1
ExternalView #2
ExternalView #n
Conceptual Schema
Internal Schema
mapping
mapping
Stored database
...
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 19
• Defines DBMS schemas at three levels:– Internal schema at the internal level to describe physical
storage structures and access paths (e.g indexes). • Typically uses a physical data model.
– Conceptual schema at the conceptual level to describe the structure and constraints for the whole database for a community of users.
• Uses a conceptual or an implementation data model.– External schemas at the external level to describe the
various user views. • Usually uses the same data model as the conceptual
schema.
Three-Schema ArchitectureThree-Schema Architecture
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 20
Three-Schema ArchitectureThree-Schema Architecture
• Mappings among schema levels are needed to transform requests and data. – Programs refer to an external schema, and are
mapped by the DBMS to the internal schema for execution.
– Data extracted from the internal DBMS level is reformatted to match the user’s external view (e.g. formatting the results of an SQL query for display in a Web page)
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 21
Data IndependenceData Independence
• Logical data independence - ability to change the conceptual schema without having to change the external schemas or application programs
• Physical data independence - ability to change the internal schema without having to change the conceptual (or external) schemas.
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 22
DBMS LanguagesDBMS Languages
• DDL: Data Definition Language– used to define/change the structure of the database
(SDDL, CDDL, VDDL)• DML: Data Manipulation Language
– used to query the database, insert data, change data or delete data
(Nonprocedural|procedural (embedded) DML)(set-at-a-time |record-at-a-time DML)
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 23
DBMS ArchitecturesDBMS Architectures
• Centralized DBMS:– Combines everything into single system including-
DBMS software, hardware, application programs, and user interface processing software.
– User can still connect through a remote terminal – however, all processing is done at centralized site.
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 24
DBMS ArchitecturesDBMS Architectures
Basic 2-tier Client-Server Architectures • Specialized Servers with Specialized functions
– Print server– File server– DBMS server– Web server– Email server
• Clients can access the specialized servers as needed
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 25
Logical two-tier client server architectureLogical two-tier client server architecture
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 26
ClientsClients
• Provide appropriate interfaces through a client software module to access and utilize the various server resources.
• Clients may be diskless machines or PCs or Workstations with disks with only the client software installed.
• Connected to the servers via some form of a network.– (LAN: local area network, wireless network, etc.)
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 27
DBMS ServerDBMS Server
• Provides database query and transaction services to the clients
• Relational DBMS servers are often called SQL servers, query servers, or transaction servers
• Applications running on clients utilize an Application Program Interface (API) to access server databases via standard interface such as:– ODBC: Open Database Connectivity standard– JDBC: for Java programming access
• Client and server must install appropriate client module and server module software for ODBC or JDBC
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 28
DBMS ArchitecturesDBMS Architectures
Three Tier Client-Server Architecture• Common for Web applications• Intermediate Layer called Application Server or Web Server:
– Stores the web connectivity software and the business logic part of the application used to access the corresponding data from the database server
– Acts like a conduit for sending partially processed data between the database server and the client.
• Three-tier Architecture Can Enhance Security: – Database server only accessible via middle tier– Clients cannot directly access database server
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 29
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 30
SummarySummary
• Types of Databases and Database Applications• Basic Definitions• Typical DBMS Functionality• Examples of a Database• Main Characteristics of the Database Approach• Database Users• Advantages of Using the Database Approach• When Not to Use Databases
Dr. Ali El-Bastawissy DB01: Introduction to DB Slide 31
SummarySummary
• Data Models and Their Categories• History of Data Models• Schemas, Instances, and States• Three-Schema Architecture• Data Independence• DBMS Languages and Interfaces• Classification of DBMSs • Database System Utilities and Tools• Centralized and Client-Server Architectures
QuestionsQuestionsDB Unit 01DB Unit 01IntroIntro Finish Finish
LineLine
Dr. Ali H. El-BastawissyFaculty of computers and Informatics
Cairo University