0% found this document useful (0 votes)
90 views

Chapter 1 - Databases

The document discusses key characteristics of databases and database management systems (DBMS). It describes databases as collections of related data stored and accessed through a DBMS. The main advantages of a DBMS over file-based data storage are data independence, sharing of data among multiple users, and supporting multiple views of the data. A DBMS also provides features for defining, constructing, manipulating, and protecting database content.

Uploaded by

Syeda mahnoor
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views

Chapter 1 - Databases

The document discusses key characteristics of databases and database management systems (DBMS). It describes databases as collections of related data stored and accessed through a DBMS. The main advantages of a DBMS over file-based data storage are data independence, sharing of data among multiple users, and supporting multiple views of the data. A DBMS also provides features for defining, constructing, manipulating, and protecting database content.

Uploaded by

Syeda mahnoor
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Chapter 1 - Databases

Content
- Introduction

- Characteristics of Database Approach

- Files vs. Databases

- Advantages Of Using DBMS

- When Not To Use DBMS


Introduction
 Databases and database systems are an essential component of life in modern
society.
 Traditional database applications: Most of the information that is stored and
accessed is either textual or numeric.

Deposit or withdraw Making a hotel or Access a computerized Purchase something


funds airline reservation library catalog online

 Social media websites, such as Facebook, Twitter, among many others


 has required the creation of huge databases that store nontraditional data, such as
posts, tweets, images, and video clips.
 New types of database systems, often referred to as big data storage systems, or
NOSQL systems, have been created to manage data for social media applications.
Introduction
 Database - collection of related data.
 Data means known facts that can be recorded and that have some meaning.
 For example, mobile phones have their own simple database software and typically store the following data:
 Names,
 Telephone numbers,
 Addresses of the people
 A database has

Some source from Degree of interaction with An audience interested


which data is derived events in the real world in its contents
 The end users of a database may perform actions (for example, a customer buys a camera) that cause the
information in the database to change.
 A database can be of any size and complexity.
 For example, the list of names and addresses may consist of only a few hundred records.
 A database of even greater size and complexity would be maintained by a social media company such as Facebook,
which has more than a billion users.
Introduction
 A database management system (DBMS) is a computerized system that
enables users to create and maintain a database.
Introduction
 DBMS - General-purpose software system that facilitates the processes of:

1 2
Defining Constructing
Defining a database involves specifying:
Data types, Process of storing the data on some storage
Structures, medium that is controlled by the DBMS.
Constraints of the data.

Meta-data - The database definition stored


by the DBMS in the form of a database
catalog or dictionary.

3 4
Manipulating Sharing
Allows multiple users and programs to
Includes functions such as querying the access the database simultaneously.
database to retrieve specific data, updating
the database and generating reports. An application program accesses the
database by sending queries or requests for
data to the DBMS.
A query causes some data to be retrieved.
A transaction may cause some data to be
read and some data to be written into the
database.
Introduction
 Other important functions provided by the
DBMS include protecting the database and
maintaining it over a long period of time.
 Protection - system protection against
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.
Characteristics of Database Approach
 Traditional file processing - each user defines and implements the files
needed for a specific software application as part of programming the
application.

USER 1 USER 2
Grade reporting office Accounting office
Keep files on students and their Keep track of students’ fees and
grades their payments

 This redundancy in defining and storing data results in wasted storage space.
Characteristics of Database Approach
 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
Characteristics of Database Approach
 Self-Describing Nature of a Database System
 A database system contains not only the database itself but
also a complete definition of the database structure and
constraints.
 This definition stored in the DBMS catalog contains
information such as:
 the structure of each file,
 the type and storage format of each data item,
 and various constraints on the data.
 The information stored in the catalog is called meta-data.
 Figure 1.3 shows some entries in a database catalog.
 Whenever a request is made to access, say, the Name of a
STUDENT record, the DBMS software refers to
 the catalog to determine the structure of the STUDENT file
 and the position and size of the Name data item within a
STUDENT record.
Characteristics of Database Approach
 Insulation between programs and data, and data abstraction

Traditional File Processing DBMS

The structure of data files is embedded DBMS access programs do not require
in the application programs, so any such changes in most cases. The structure
changes to the structure of a file may of data files is stored in the DBMS catalog
require changing all programs that access separately from the access programs
that file. known as program-data independence.
Characteristics of Database Approach
 Insulation between programs and data, and data abstraction
 For example, a file access program may be written in such a way that it can access
only STUDENT records of the structure shown.
 If we want to add another piece of data to each STUDENT record, say the Birth_date,
such a program will no longer work and must be changed.
 In a DBMS environment, we only need to change the description of STUDENT records
in the catalog to show the new data item Birth_date; no programs are changed.
Characteristics of Database Approach
 Insulation between programs and data, and data abstraction
 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.
 Operation (also called a function or method) is specified in two parts.
 The interface (or signature) - includes the operation name and the data types of its arguments (or parameters).
 The implementation (or method) - 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 called as program-operation independence.
 For example, an operation CALCULATE_GPA can be applied to a STUDENT object to calculate the grade
point average.
 Data abstraction - The characteristic that allows program-data independence and program-operation.
 A DBMS provides users with a conceptual representation of data that does not include many of the
details of how the data is stored or how the operations are implemented.
 Data model - a type of data abstraction that is used to provide this conceptual representation and
hides storage and implementation details.
Characteristics of Database Approach
 Support of Multiple Views of the Data
 View - a subset of the database or it may contain virtual
data that is derived from the database files but is not
explicitly stored.
 A multiuser DBMS whose users have a variety of distinct
applications must provide facilities for defining multiple
views.
 For example:
 One user of the database may be interested only in
accessing and printing the transcript of each student; the
view for this user is shown in Figure 1.5(a).
 A second user, who is interested only in checking that
students have taken all the prerequisites of each course for
which the student registers, may require the view shown in
Figure 1.5(b).
Characteristics of Database Approach
 Sharing of Data and Multiuser Transaction Processing
 A multiuser DBMS, must allow multiple users to access the database at the same time.
 The DBMS must include concurrency control software to ensure that several users trying to
update the same data do so in a controlled manner so that the result of the updates is correct.
 For example, when several reservation agents try to assign a seat on an airline flight, the DBMS should
ensure that each seat can be accessed by only one agent at a time for assignment to a passenger.
 Transaction - An executing program or process that includes one or more database accesses,
such as reading or updating of database records.
 The DBMS must enforce several transaction properties.
 Isolation - ensures that each transaction appears to execute in isolation from other transactions, even
though hundreds of transactions may be executing at the same time.
 Atomicity - ensures that either all the database operations in a transaction are executed or none are.
Files vs. Databases
Advantages Of Using DBMS
 Controlling Redundancy
 In traditional software development using file processing, every user group maintains
its own files for handling its data-processing applications.
 For example: UNIVERSITY database
 Two groups of users: 1. Course registration personnel 2. Accounting office.
 In the traditional approach, each group independently keeps files on students.
 1.The accounting office keeps data on registration and related billing information
 2. The registration office keeps track of student courses and grades.
Advantages Of Using DBMS
 Controlling Redundancy
 This redundancy in storing the same data multiple times leads to several problems.

1. Need to perform a single logical update such 2. Storage space is wasted when the same
as entering data on a new student multiple data is stored repeatedly.
times, once for each file where student data is
recorded. This leads to duplication of effort.

3. 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.

Even if an update—such as adding a new student—is applied to all the appropriate files, the data
concerning the student may still be inconsistent because the updates are applied independently
by each user group.
 For example, one user group may enter a student’s birth date erroneously as ‘JAN-19-
1988’, whereas the other user groups may enter the correct value of ‘JAN-29-1988’.
Advantages Of Using DBMS
 Restricting Unauthorized Access
 When multiple users share a large database, most users will not be authorized to access all information in the
database.
 For example, financial data such as salaries and bonuses is often considered confidential, and only authorized persons
are allowed to access such data.
 A DBMS should provide a security and authorization subsystem, which the DBA uses to create accounts and to
specify account restrictions.
 For example, only the DBA’s staff may be allowed to use certain privileged software, such as the software for creating
new accounts.
 Providing Persistent Storage for Program Objects
 Databases can be used to provide persistent storage for program objects and data structures.
 Programming languages typically have complex data structures, such as structs or class definitions in C++ or
Java. The values of program variables or objects are discarded once a program terminates, unless stored in
permanent files.
 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.
Advantages Of Using DBMS
 Providing Storage Structures and Search Techniques for Efficient Query Processing
 The DBMS must provide specialized data structures and search techniques to speed up disk
search for the desired records.
 Indexes are often used for this purpose.
 Indexes are typically based on tree data structures or hash data structures that are suitably
modified for disk search.
 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.
 Providing Backup and Recovery
 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.
Advantages Of Using DBMS
 Providing Multiple User Interfaces
 Many types of users with different levels of technical knowledge use a database, so a DBMS
should provide a variety of user interfaces that include:
 apps for mobile users,
 query languages for casual users,
 programming language interfaces for application programmers,
 forms and menu-driven interfaces for standalone users.
 Representing Complex Relationships among Data
 A database may include many varieties of data that are interrelated in many ways.
 The record for ‘Brown’ in the STUDENT file is related to four records in the GRADE_REPORT
file.
Advantages Of Using DBMS
 Enforcing Integrity Constraints
 Most database applications have integrity constraints that must hold.
 The simplest type of integrity constraint involves specifying a data type for
each data item.
 For example, we specified that the value of the Class data item within each
STUDENT record must be a one-digit integer and that the value of Name must be a
string of no more than 30 alphabetic characters.
 A more complex type of constraint that involves specifying that a record in
one file must be related to records in other files known as a referential
integrity constraint.
 For example, in Figure 1.2, we can specify that every section record must be
related to a course record.
 Another type of constraint specifies uniqueness on data item values, such as
every course record must have a unique value for Course_number. This is
known as a key or uniqueness constraint.
Advantages Of Using DBMS
 Permitting Inferencing and Actions Using Rules and Triggers
 Some database systems provide capabilities for defining deduction rules for
inferencing new information from the stored database facts. Such systems are called
deductive database systems.
 For example, there may be complex rules for determining when a student is on probation.
These can be specified as rules, which when compiled and maintained by the DBMS can
determine all students on probation.
 A trigger is a form of a rule activated by updates to the table, which results in
performing some additional operations to some other tables, sending messages, and
so on.
 More involved procedures to enforce rules are popularly called stored procedures,
they become a part of the overall database definition and are invoked when certain
conditions are met.
When Not to Use a DBMS
 There are a few situations in which a DBMS may involve unnecessary overhead costs that would not be incurred in
traditional file processing. The overhead costs of using a DBMS are due to the following:
 High initial investment in hardware, software, and training - This is because, for DBMS, it is mandatory to have a high-
speed processor and also a large memory size. The requirement of this large amount of space and a high-speed processor
needs expensive hardware and expensive software too. Educated staff (database administrator, application programmers,
data entry operations) who maintains the database management system are required.
 The generality that a DBMS provides for defining and processing data
 Overhead for providing security, concurrency control, recovery, and integrity functions
 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
 Certain industries and applications have elected not to use general-purpose DBMSs.
 For example, many computer-aided design (CAD) tools used by mechanical and civil engineers have proprietary file and
data management software that is geared for the internal manipulations of drawings and 3D objects.
 GIS implementations often implement their own data organization schemes for efficiently implementing
functions related to processing maps, physical contours, lines, polygons, and so on.

You might also like