Lecture 2 - DB

Download as pdf or txt
Download as pdf or txt
You are on page 1of 40

Databases and Database Users

Chapter 1 1
What is Data Management?

Chapter 1 2
Finding data?

Chapter 1 3
What is a DBMS?

Chapter 1 4
Simplified database system
environment

Chapter 1 5
Typical DBMS Functionality

Chapter 1 6
Typical DBMS Functionality

Chapter 1 7
Why Use a DBMS?

Chapter 1 8
Why Use a DBMS?

Chapter 1 9
Why use a DBMS - Data
Consistency

Chapter 1 10
Basic Definitions
◼ Database schema: The description of a
database is called the database schema,
which is specified during database design
and is not expected to change frequently.

Chapter 1 11
Basic Definitions (cont.)
◼ Schema diagram: A displayed schema is called
a schema diagram.
◼ A schema diagram displays only some aspects
of a schema, such as the names of record types
and data items, and some types of constraints.

Chapter 1 12
Basic Definitions (cont.)
◼ Schema construct: Each object in the
schema is called schema construct. For
example, student or course.

Chapter 1 13
Basic Definitions (cont.)
◼ Database state or snapshot: The data in the
database at a particular moment in time.
◼ It is also called the current set of occurrences or
instances in the database.
◼ In a database state, each schema construct has
its own current set of instances; for example, the
STUDENT construct will contain the set of
individual student entities (records) as its
instances.
Chapter 1 14
Why use a DBMS - Data
Abstraction

Chapter 1 15
Example: University Database

Chapter 1 16
Levels of Database
◼ The database has 3 levels
1. Physical/Internal
2. Conceptual (logical)
3. External

Chapter 1 17
Levels of DBMS Architecture

Chapter 1 18
Levels of Database
◼ Consider an Example of a University
Database. At the different levels this is
how the implementation will look like:

Chapter 1 19
Why use a DBMS - Data
Independence
◼ Data Independence is defined as a property
of DBMS that helps you to change the
Database schema at one level of a database
system without requiring to change the
schema at the next higher level.
◼ Data independence helps you to keep data
separated from all programs that make use of
it.

Chapter 1 20
Types of Data Independence
◼ In DBMS there are two types of data
independence
1. Physical data independence
2. Logical data independence.

Chapter 1 21
Physical Data Independence
◼ Physical data independence helps you to
separate conceptual levels from the
internal/physical levels.
◼ It allows you to provide a logical description of
the database without the need to specify
physical structures.
◼ Compared to Logical Independence, it is easy to
achieve physical data independence.

Chapter 1 22
Examples of changes under
Physical Data Independence
◼ Due to Physical independence, any of the below
change will not affect the conceptual layer.
 Using a new storage device like Hard Drive or Magnetic
Tapes
 Modifying the file organization technique in the Database
 Switching to different data structures.
 Changing the access method.
 Modifying indexes.
 Changes to compression techniques or hashing algorithms.
 Change of Location of Database from say C drive to D Drive

Chapter 1 23
Logical Data Independence
◼ Logical Data Independence is the ability to change the
conceptual scheme without changing
1. External views
2. External API or programs
◼ Any change made will be absorbed by the mapping
between external and conceptual levels.
◼ When compared to Physical Data independence, it is
challenging to achieve logical data independence.

Chapter 1 24
Examples of changes under
Logical Data Independence
◼ Due to Logical independence, any of the below
change will not affect the external layer.
 Add/Modify/Delete a new attribute, entity or
relationship is possible without a rewrite of existing
application programs
 Merging two records into one
 Breaking an existing record into two or more records

Chapter 1 25
Difference between Physical and
Logical Data Independence

Chapter 1 26
Database Languages

1. Data Definition Language (DDL): identify descriptions of the schema


constructs and to store the schema description in the DBMS catalog.
2. Storage Definition Language (SDL): is used to specify the internal
schema (physical schema)
3. View Definition Language (VDL): View definition language is used to
specify user views.
4. Data Manipulation Language (DML): are used to perform
manipulation operation such as retrieval, insertion, deletion, and
modification of the data.

Chapter 1 27
Database System Environment

Chapter 1 28
DBMS Component Modules
◼ DDL compiler-processes schema definitions, specified in the
DDL, and stores descriptions of the schemas (meta-data) in
the DBMS catalog.
◼ Interactive query interface: interface for Casual users and
persons with occasional need for information from the
database.
◼ Query compiler- validates for correctness of the query syntax,
the names of files and data elements & compiles them into an
internal form.
◼ Query optimizer concerned with the rearrangement and
possible reordering of operations, elimination of redundancies,
and use of correct algorithms and indexes during execution.

Chapter 1 29
DBMS Component Modules
(cont.)
◼ Precompiler - extracts DML commands from an
application program and sends to the DML
compiler for compilation into object code for
database access.
◼ Host language compiler - rest of the program is
sent to the host language compiler.
◼ Runtime database processor executes:
1) The privileged commands
2) The executable query plans, and
3) The canned transactions with runtime parameters.

30
Chapter 1
DBMS Component Modules
(cont.)
◼ The runtime database processor handles other
aspects of data transfer, such as management of
buffers in the main memory.
◼ Stored data manager uses basic operating
system services for carrying out low-level
input/output (read/write) operations between the
disk and main memory.
◼ Concurrency control and backup and recovery
systems integrated into the working of the runtime
database processor for purposes of transaction
management.
31
Chapter 1
Database System Utilities
◼ Database utilities help the DBA to manage the database system.
◼ Common utilities have the following types of functions:
 Loading: used to load existing data files such as text files or
sequential files into the database.
 Backup: creates a backup copy of the database, usually by
dumping the entire database onto tape or other mass storage
medium.
 Database storage reorganization: used to reorganize a set
of database files into different file organizations, and create
new access paths to improve performance.
 Performance monitoring: monitors database usage and
provides statistics to the DBA.

Chapter 1 32
CENTRALIZED AND CLIENT-
SERVER ARCHITECTURE FOR
DBMSS

33
Chapter 1
Centralized DBMSs Architecture
◼ All DBMS functionality, application
program execution, and user interface
processing carried out on one machine.

34
Chapter 1
Centralized DBMSs Architecture

35
Chapter 1
Basic Client/Server
Architectures
◼ Define specialized servers with specific
functionalities.
◼ The resources provided by specialized servers
can be accessed by many client machines.
◼ The client machines provide the user with the
appropriate interfaces to utilize these servers
and local processing power to run local
applications

Chapter 1 36
Basic Client/Server
Architectures
◼ The concept of client/server architecture assumes an underlying
framework that consists of many PCs and workstations as well as a
smaller number of mainframe machines, connected via LANs and
other types of computer networks.
◼ The software components are distributed over two systems: client
and server
 Server handles: Query and transaction functionality related to
SQL
 Processing Client handles: User interface programs and
application programs

37
Chapter 1
Disadvantages of Centralized
DBMSs Architecture
◼ When the central site computer or database system
goes down, then everyone is blocked from using the
system.
◼ Communication costs from the terminals to the central
site can expensive.

Chapter 1 38
Assignment
◼ What you know about Three-Tier Architecture,
and how it different from two-tier architecture?

39
Chapter 1
THANKS

Chapter 1 40

You might also like