You are on page 1of 34

Copyright © 2016 Ramez Elmasri and Shamkant B.

Navathe
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 2
What is data, database, DBMS
 Data: Known facts that can be recorded and have an implicit meaning; raw
 Database: a highly organized, interrelated, and structured set of data about a
particular enterprise
 Controlled by a database management system (DBMS)
 DBMS
 Set of programs to access the data
 An environment that is both convenient and efficient to use
 Database systems are used to manage collections of data that are:
 Highly valuable
 Relatively large
 Accessed by multiple users and applications, often at the same time.
 A modern database system is a complex software system whose task is to
manage a large, complex collection of data.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 3


DBMS
 A database management system (DBMS) is a computerized system that enables
users to create and maintain a database.
 The DBMS is a general-purpose software system that facilitates the processes of
defining, constructing, manipulating, and sharing databases among various users and
applications.
 Defining a database involves specifying the data types, structures, and constraints of
the data to be stored in the database.
 The database definition or descriptive information is also stored by the DBMS in
the form of a database catalog or dictionary; it is called meta-data.
 Constructing the database is the process of storing the data on some storage medium
that is controlled by the DBMS.
 Manipulating a database includes functions such as querying the database to retrieve
specific data, updating the database to reflect changes in the miniworld, and
generating reports from the data.
 Sharing a database allows multiple users and programs to access the database
simultaneously.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 4
DBMS
 An application program accesses the database by sending queries or requests for
data to the DBMS.
 A query typically causes some data to be retrieved;
 A transaction may cause some data to be read and some data to be written into the
database.
 Other important functions provided by the DBMS include protecting the databaseand
maintaining it over a long period of time.
 Protection includes system protection against hardware or software malfunction (or
crashes) and security protection against unauthorized or malicious access.
 A typical large database may have a life cycle of many years, so the DBMS must be
able to maintain the database system by allowing the system to evolve as
requirements change over time.
 Database and DBMS software together is called a database system

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 5


A simplified architecture for a database
system

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 6


Example of a Simple Database

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 7


DBMS
 To construct the UNIVERSITY database, we store data to represent each
student,course, section, grade report, and prerequisite as a record in the appropriate
file.
 Notice that records in the various files may be related.
 For example, the record for Smith in the STUDENT file is related to two records in
the GRADE_REPORT file that specify Smith’s grades in two sections.
 Similarly, each record in the PREREQUISITE file relates two course records: one
representing the course and the other representing the prerequisite.
 Most medium-size and large databases include many types of records and have many
relationships among the records.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 8


DBMS
Database manipulation involves querying and updating.
Examples of queries are as follows:
Retrieve the transcript—a list of all courses and grades—of ‘Smith’

List the names of students who took the section of the ‘Database’ courseoffered in fall

2008 and their grades in that section


List the prerequisites of the ‘Database’ course

Examples of updates include the following:


Change the class of ‘Smith’ to sophomore

Create a new section for the ‘Database’ course for this semester

Enter a grade of ‘A’ for ‘Smith’ in the ‘Database’ section of last semester

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 9


DBMS
 Design of a new application for an existing database or design of a brand new
database starts off with a phase called requirements specification and analysis.

 These requirements are documented in detail and transformed into a conceptual


design that can be represented and manipulated using some computerized tools so
that it can be easily maintained, modified, and transformed into a database
implementation. (Entity-Relationship model)

 The design is then translated to a logical design that can be expressed in a data
model implemented in a commercial DBMS

 The final stage is physical design, during which further specifications are provided
for storing and accessing the database. The database design is implemented,
populated with actual data, and continuously maintained to reflect the state of the
miniworld.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 10


Main Characteristics of the Database
Approach
 In traditional file processing, each user defines and implements the files needed for a
specific software application as part of programming the application.
 This redundancy in defining and storing data results in wasted storage space and in
redundant efforts to maintain common up-to-date data.
 In the database approach, a single repository maintains data that is defined once and
then accessed by various users repeatedly through queries, transactions, and
application programs.
 The main characteristics of the database approach versus the file-processing
approach are the following:
 Self-describing nature of a database system
 Insulation between programs and data, and data abstraction
 Support of multiple views of the data
 Sharing of data and multiuser transaction processing

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 11


Main Characteristics of the Database
Approach
 Self-describing nature of a database system

 A DBMS catalog stores the description of a particular database


(e.g. data structures, types, and constraints)
 The description is called meta-data*.
 This allows the DBMS software to work with different database
applications.
 The catalog is used by the DBMS software and also by database
users who need information about the database structure.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 12


Example of a Simplified Database Catalog

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 13


Main Characteristics of the Database
Approach
 Insulation between programs and data:
 The structure of data files is stored in the DBMS catalog separately
from the access programs.
 This property is Called program-data independence

 Allows changing data structures and storage organization without

having to change the DBMS access programs


 We only need to change the description of STUDENT records in the
catalog to reflect the inclusion of the new data item Birth_date; no
programs are changed.
 The next time a DBMS program refers to the catalog, the new
structure of STUDENT records will be accessed and used.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 14


Main Characteristics of the Database
Approach
 Insulation between programs and data:
 In some types of database systems, such as object-oriented and object-relational
systems, users can define operations on data as part of the database definitions.

 An operation (also called a function or method) is specified in two parts. The


interface (or signature) of an operation includes the operation name and the data
types of its arguments (or parameters).
 The implementation (or method) of the operation is specified separately and can
be changed without affecting the interface.
 User application programs can operate on the data by invoking these operations
through their names and arguments, regardless of how the operations are
implemented.
 This may be termed program-operation independence.
 The characteristic that allows program-data independence and program-
operation independence is called data abstraction.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 15


Main Characteristics of the Database
Approach (continued)
 Data abstraction:
 A data model is used to hide storage details and present
the users with a conceptual view of the database.
 Programs refer to the data model constructs rather than
data storage details

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 16


Main Characteristics of the Database
Approach (continued)
 Support of multiple views of the data:
 Each user may see a different view of the database,
which describes only the data of interest to that user.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 17


Main Characteristics of the Database
Approach (continued)
 Sharing of data and multi-user transaction processing:
 Allowing a set of concurrent users to retrieve from and to update
the database.
 Concurrency control within the DBMS guarantees that each
transaction is correctly executed or aborted
 Recovery subsystem ensures each completed transaction has its
effect permanently recorded in the database
 OLTP (Online Transaction Processing) is a major part of database
applications; allows hundreds of concurrent transactions to
execute per second.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 18


Main Characteristics of the Database
Approach (continued)
 Sharing of data and multi-user transaction processing:
 A transaction is an executing program or process that includes one
or more database accesses, such as reading or updating of
database records.
 Each transaction is supposed to execute a logically correct
database access if executed in its entirety without interference
from other transactions.
 The DBMS must enforce several transaction properties.
 The isolation property ensures that each transaction appears to
execute in isolation from other transactions, even though hundreds
of transactions may be executing concurrently.
 The atomicity property ensures that either all the database
operations in a transaction are executed or none are.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 19


Advantages of Using the Database
Approach
 Controlling redundancy in data storage and in development
and maintenance efforts.
 This redundancy in storing the same data multiple times leads
to several problems.
 First, there is the need to perform a single logical update—
such as entering data on a new student—multiple times: once
for each file where student data is recorded. This leads to
duplication of effort.
 Second, storage space is wasted when the same data is stored
repeatedly, and this problem may be serious for large
databases.
 Third, files that represent the same data may become
inconsistent. This may happen because an update is applied to
some of the files but not to others.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 20


Advantages of Using the Database
Approach
 Restricting unauthorized access to data. Only the DBA
staff uses privileged commands and facilities.
 For example, financial data such as salaries and bonuses
is often considered confidential, and only authorized
persons are allowed to access such data. In addition,
some users may only be permitted to retrieve data,
whereas others are allowed to retrieve and update.
 Hence, the type of access operation—retrieval or update
—must also be controlled.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 21


Advantages of Using the Database
Approach
 Providing persistent storage for program Objects
 a complex object in C++can be stored permanently in
an object-oriented DBMS. Such an object is said to be
persistent, since it survives the termination of program
execution and can later be directly retrieved by another
program.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 22


Advantages of Using the Database
Approach
 Providing Storage Structures and Search Techniques for Efficient
Query Processing
 must provide capabilities for efficiently executing queries and updates.
 Because the database is typically stored on disk, the DBMS must
provide specialized data structures and search techniques to speed up
disk search for the desired records.
 Auxiliary files called indexes are often used for this purpose.
 In order to process the database records needed by a particular query,
those records must be copied from disk to main memory.
 Therefore, the DBMS often has a buffering or caching module that
maintains parts of the database in main memory buffers.
 The query processing and optimization module of the DBMS is
responsible for choosing an efficient query execution plan for each
query based on the existing storage structures.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 23


Advantages of Using the Database
Approach (continued)
 Providing backup and recovery services
 A DBMS must provide facilities for recovering from
hardware or software failures.
 The backup and recovery subsystem of the DBMS is
responsible for recovery. For example, if the computer
system fails in the middle of a complex update
transaction,the recovery subsystem is responsible for
making sure that the database is restored to the state it
was in before the transaction started executing.
 Disk backup is also necessary in case of a catastrophic
disk failure.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 24


Advantages of Using the Database
Approach (continued)
 Providing multiple interfaces to different classes of users
 Because many types of users with varying levels of technical
knowledge use a database, a DBMS should provide a variety
of user interfaces.
 These include apps for mobile users, query languages for
casual users, programming language interfaces for
application programmers, forms and command codes for
parametric users, and menu-driven interfaces and natural
language interfaces for standalone users.
 Both forms-style interfaces and menu-driven interfaces are
commonly known as GUI

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 25


Advantages of Using the Database
Approach (continued)
 Representing complex relationships among data
 A database may include numerous varieties of data that
are interrelated in many ways.
 DBMS must have the capability to represent a variety
of complex relationships among the data, to define new
relationships as they arise, and to retrieve and update
related data easily and efficiently.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 26


Advantages of Using the Database
Approach (continued)
 Enforcing integrity constraints on the database
 Drawing inferences and actions from the stored data
using deductive and active rules and triggers

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 27


Advantages of Using the Database
Approach (continued)
 Additional Implications of Using the Database
Approach :

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 28


Additional Implications of Using the
Database Approach
 Potential for enforcing standards:
 Standards refer to data item names, display formats,
screens, report structures, meta-data (description of
data), Web page layouts, etc.
 Reduced application development time:
 Incremental time to add each new application is
reduced.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 29


Additional Implications of Using the
Database Approach (continued)
 Flexibility to change data structures:
 Database structure may evolve as new requirements are
defined.
 Availability of current information:
 Extremely important for on-line transaction systems
such as shopping, airline, hotel, car reservations.
 Economies of scale:
 Wasteful overlap of resources and personnel can be
avoided by consolidating data and applications across
departments.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 30


When not to use a DBMS
 The overhead costs of using a DBMS are due to the
following:
 High initial investment in hardware, software, and
training
 The generality that a DBMS provides for defining and
processing data
 Overhead for providing security, concurrency control,
recovery, and integrity functions

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 31


When not to use a DBMS
 Therefore, it may be more desirable to develop
customized database applications under the following
circumstances:
 Simple, well-defined database applications that are not
expected to change at all
 Stringent, real-time requirements for some application
programs that may not be met because of DBMS
overhead
 Embedded systems with limited storage capacity, where
a general-purpose DBMS would not fit
 No multiple-user access to data

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 32


When not to use a DBMS
 Main inhibitors (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 access to data by multiple users is not required
 When a DBMS may be infeasible
 In embedded systems where a general-purpose DBMS may not fit
in available storage

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 33


When not to use a DBMS
 When no DBMS may suffice:
 If there are stringent real-time requirements that

may not be met because of DBMS overhead (e.g.,


telephone switching systems)
 If the database system is not able to handle the
complexity of data because of modeling limitations
(e.g., in complex genome and protein databases)
 If the database users need special operations not
supported by the DBMS (e.g., GIS and location-based
services).

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 34

You might also like