You are on page 1of 40

DATABASE DEVELOPMENT AND

ADMINISTRATION

TETE 4105

LECTURE 1
Manual system
■ A Manual system is one that involves data processing which does not make use of
stored program computing equipment
■ The manual filing system works well as long as the number of items to be stored is
small. It even works adequately when there are large numbers of items and we only
have to store and retrieve them. However, the manual filing system breaks down
when we have to cross-reference or process the information in the files.
Manual system cont’d
For example, a typical real estate agent’s office might have a separate file for each property
for sale or rent, each potential buyer and renter, and each member of staff. Consider the
effort that would be required to answer the following questions:
■ What three-bedroom properties do you have for sale with an acre of land and a garage?
■ What apartments do you have for rent within three miles of downtown?
■ What is the average rent for a two-bedroom apartment?
■ What is the annual total for staff salaries?
■ How does last month’s net income compare with the projected figure for this month?
■ What is the expected monthly net income for the next financial year?
File based system
■ Definition: - A collection of application programs that perform services for the end-
users, such as the production of reports.
■ Each program defines and manages its own data. File-based systems were an early
attempt to computerize the manual filing system that we are all familiar with. For
example, an organization might have physical files set up to hold all external and
internal correspondence relating to a project, product, task, client, or employee
To understand what this means, consider the DreamHome example
The Sales Department is responsible for the selling and renting of properties. For
example, whenever a client who wishes to offer his or her property as a rental
approaches the Sales Department, a form similar to the one below is completed. The
completed form contains details on the property, such as address, number of rooms,
and the owner’s contact information.
■ The Sales Department also handles inquiries from clients, and a form similar to the
one below is completed for each one.
■ With the assistance of the DP(Data processing) Department, the Sales Department
creates an information system to handle the renting of property. The system consists of
three files containing property, owner, and client details
■ The Contracts Department is responsible for handling the lease agreements associated
with properties for rent. Whenever a client agrees to rent a property, a form with the client
and property details is filled in by one of the sales staff. This form is passed to the
Contracts Department, which allocates a lease number and completes the payment and
rental period details.
■ Again, with the assistance of the DP Department, the Contracts Department creates an
information system to handle lease agreements. The system consists of three files that
store lease, property, and client details, and that contain similar data to that held by the
Sales Department
■ This shows each department accessing their own files through application programs
written especially for them. Each set of departmental application programs handles data
entry, file maintenance, and the generation of a fixed set of specific reports. More
important, the physical structure and storage of the data files and records are defined in
the application code
Limitations of the File-Based Approach
■ Separation and isolation of data
When data is isolated in separate files, it is more difficult to access data that should be
available. For example, if we want to produce a list of all houses that match the
requirements of clients, we first need to create a temporary file of those clients who
have “house” as the preferred type. We then search the PropertyForRent file for those
properties where the property type is “house” and the rent is less than the client’s
maximum rent. With file systems, such processing is difficult.
■ Duplication of data
Owing to the decentralized approach taken by each department, the file-based
approach encouraged, if not necessitated, the uncontrolled duplication of data. For the
example we can clearly see that there is duplication of both property and client details
in the Sales and Contracts Departments.
Limitations of the File-Based Approach
■ Incompatible file formats
Because the structure of files is embedded in the application programs, the structures
are dependent on the application programming language
■ Atomicity problems.
A computer system, like any other device, is subject to failure. In many applications, it is
crucial that, if a failure occurs, the data be restored to the consistent state that existed
prior to the failure.
Consider a program to transfer $500 from the account balance of department A to the
account balance of department B. If a system failure occurs during the execution of the
program, it is possible that the $500 was removed from the balance of department A
but was not credited to the balance of department B, resulting in an inconsistent
database state. That is, the funds transfer must be atomic—it must happen in its
entirety or not at all. It is difficult to ensure atomicity in a conventional file-processing
system.
Limitations of the File-Based Approach
■ Security
Not every user of the database system should be able to access all the data. For
example, in a university, payroll personnel need to see only that part of the database
that has financial information. They do not need access to information about academic
records. But, since application programs are added to the file-processing system in an
ad hoc manner, enforcing such security constraints is difficult.

In either case, the outcome was unacceptable. Another solution was required
Database
■ Definition: A shared collection of logically related data and its description, designed
to meet the information needs of an organization.
■ The database is a single, possibly large repository of data that can be used
simultaneously by many departments and users.
■ Instead of disconnected files with redundant data, all data items are integrated with
a minimum amount of duplication. The database is no longer owned by one
department but is a shared corporate resource. The database holds not only the
organization’s operational data, but also a description of this data
■ For this reason, a database is also defined as a self-describing collection of
integrated records. The description of the data is known as the system catalog (or
data dictionary or metadata—the “data about data”)
Scenario 1
■ Purchases from the supermarket
When you purchase goods from your local supermarket, it is likely that a database is
accessed. The checkout assistant uses a bar code reader to scan each of your
purchases. This reader is linked to a database application that uses the bar code to find
out the price of the item from a product database.
The application then reduces the number of such items in stock and displays the price
on the cash register. If the reorder level falls below a specified threshold, the database
system may automatically place an order to obtain more of that item. If a customer
telephones the supermarket, an assistant can check whether an item is in stock by
running an application program that determines availability from the database
Scenario 2
■ Studying at College
If you are at college, there will be a database system containing information about
yourself, your major and minor fields, and the courses you are enrolled in, details about
your financial aid, the classes you have taken in previous years or are taking this year,
and details of all your examination results.
There may also be a database containing details relating to the next year’s admissions
and a database containing details of the staff working at the university, giving personal
details and salary related details for the payroll office
Characteristic of a good database

■ Should be able to store all kinds of data that exists in this real world
■ Should be able to relate the entities / tables in the database by means of a relation.
i.e.; any two tables should be related
■ Data and application should be isolated. Because database is a system which gives
the platform to store the data, and the data is the one which allows the database to
work
■ There should not be any duplication of data in the database. Data should be stored
in such a way that it should not be repeated in multiple tables.
Characteristic of a good database are

■ Multiple users should be able to access the same database, without affecting the
other user. i.e.; if teachers want to update a student’s marks in Results table at the
same time, then they should be allowed to update the marks for their subjects,
without modifying other subject marks
■ Database should also provide security, i.e.; when there are multiple users are
accessing the database, each user will have their own levels of rights to see the
database
Database management system (DBMS)
■ Definition:-A database management system (DBMS) is a collection of programs that
manages the database structure and controls access to the data stored in the
database. In a sense, a database resembles a very well-organized electronic filing
cabinet in which powerful software, known as a database management system,
helps manage the cabinet’s contents.
■ Can also b defined as a software system that enables users to define, create,
maintain, and control access to the database. The DBMS is the software that
interacts with the users’ application programs and the database.
Advantages of a DBMS
■ Improved data sharing.
The DBMS helps create an environment in which end users have better access to more
data and better-managed data. Such access makes it possible for end users to respond
quickly to changes in their environment.
■ Improved data security.
The more users access the data, the greater the risks of data security breaches.
Corporations invest considerable amounts of time, effort, and money to ensure that
corporate data are used properly. A DBMS provides a framework for better enforcement
of data privacy and security policies.
■ Better data integration.
Wider access to well-managed data promotes an integrated view of the organization’s
operations and a clearer view of the big picture. It becomes much easier to see how
actions in one segment of the company affect other segments.
Advantages of a DBMS
■ Minimized data inconsistency.
Data inconsistency exists when different versions of the same data appear in different
places. For example, data inconsistency exists when a company’s sales department
stores a sales representative’s name as “Bill Brown” and the company’s personnel
department stores that same person’s name as “William G. Brown”
■ Improved data access.
The DBMS makes it possible to produce quick answers to ad hoc queries.
■ Improved decision making.
Better-managed data and improved data access make it possible to generate better
quality information, on which better decisions are based.
Disadvantages of the database
■ Complexity
The provision of the functionality that we expect of a good DBMS makes the DBMS an
extremely complex piece of software. Database designers and developers, data and
database administrators, and end-users must understand this functionality to take full
advantage of it. Failure to understand the system can lead to bad design decisions,
which can have serious consequences for an organization.
■ Size
The complexity and breadth of functionality makes the DBMS an extremely large piece
of software, occupying many megabytes of disk space and requiring substantial
amounts of memory to run efficiently.
■ Cost of DBMSs
The cost of DBMSs varies significantly, depending on the environment and functionality
provided. For example, a single-user DBMS for a personal computer may only cost
$100. However, a large mainframe multi-user DBMS servicing hundreds of users can be
extremely expensive, perhaps $100,000 or even $1,000,000. There is also the
recurrent annual maintenance cost, which is typically a percentage of the list price
Disadvantages of the database
■ Additional hardware costs
The disk storage requirements for the DBMS and the database may necessitate the
purchase of additional storage space
■ Cost of conversion
In some situations, the cost of the DBMS and extra hardware may be relatively small
compared with the cost of converting existing applications to run on the new DBMS and
hardware. This cost also includes the cost of training staff to use these new systems,
and possibly the employment of specialist staff to help with the conversion and running
of the systems
Disadvantages of the database
■ Performance
Typically, a file-based system is written for a specific application, such as invoicing. As a
result, performance is generally very good. However, the DBMS is written to be more
general, to cater for many applications rather than just one. The result is that some
applications may not run as fast as they used to.
■ Greater impact of a failure
The centralization of resources increases the vulnerability of the system. Because all
users and applications rely on the availability of the DBMS, the failure of certain
components can bring operations to a halt.
Database architecture
The architecture of a database system is greatly influenced by the underlying computer
system on which the database system runs. Database systems can be centralized, or
client-server, where one server machine executes work on behalf of multiple client
machines.

■ Two tier architecture


In this architecture, the application resides at the
client machine, where it invokes database system
functionality at the server machine through query
language statements.
Imagine a front end application of School, where we
need to display the reports of all the students who
are opted for different subjects. In this case, the
application will directly interact with the database
and retrieve all required data.
Advantages of 2-tier Architecture

■ Easy to understand as it directly communicates with the database.


■ Requested data can be retrieved very quickly, when there is less number of users.
■ Easy to modify – any changes required, directly requests can be sent to database
Disadvantages of 2-tier architecture:

■ It would be time consuming, when there is huge number of users. All the requests
will be queued and handed one after another. Hence it will not respond to multiple
users at the same time.
■ Three tier architecture
In contrast, in a three-tier architecture, the client machine acts as merely a front end
and does not contain any direct database calls. Instead, the client end communicates
with an application server, usually through a forms interface. The application server in
turn communicates with a database system to access data
Three-tier applications are more appropriate for large applications, and for applications
that run on the World Wide Web.
Advantages of 3-tier architecture

■ Easy to maintain and modify. Any changes requested will not affect any other data in
the database. Application layer will do all the validations.
■ Improved security. Since there is no direct access to the database, data security is
increased. There is no fear of mishandling the data.
■ Good performance. Since this architecture cache the data once retrieved, there is
no need to hit the database for each request.
Disadvantages 3-tier Architecture

■ Disadvantages of 3-tier architecture are that it is little more complex and little more
effort is required in terms of hitting the database.
Components of the DBMS Environment
■ Hardware
The DBMS and the applications require hardware to run. The hardware can range from
a single personal computer to a single mainframe or a network of computers
■ Software
The software component comprises the DBMS software itself and the application
programs, together with the operating system, including network software if the DBMS
is being used over a network.
■ Data
Perhaps the most important component of the DBMS environment—certainly from the
end-users’ point of view—is the data. we observe that the data acts as a bridge between
the machine components and the human components. The database contains both the
operational data and the metadata, the “data about data.” The structure of the
database is called the schema.
Components of the DBMS Environment

■ Users

■ Procedures
Database administration
This is the function of managing and maintaining database management systems
(DBMS) software.

■ A database administrator (DBA) directs or performs all activities related to


maintaining a successful database environment.
Responsibilities include designing, implementing, and maintaining the database
system; establishing policies and procedures pertaining to the management, security,
maintenance, and use of the database management system; and training employees in
database management and use
Types of database administration
■ Systems DBAs: focus on the physical aspects of database administration such as
DBMS installation, configuration, patching, upgrades, backups, restores, refreshes,
performance optimization, and maintenance and disaster recovery.
■ Application DBAs: Application DBAs straddle the fence between the DBMS and the
application software and are responsible for ensuring that the application is fully
optimized for the database and vice versa. They usually manage all the application
components that interact with the database and carry out activities such as
application installation and patching, application upgrades, database cloning,
building and running data cleanup routines, data load process management, etc
Developing a Database Specification
■ Purpose. Define the purpose(s) of the database. Be specific about the broad
functions the database will perform and how these will support the work of your
organization.
■ Alternatives. Consider whether any of these objectives could be better met by some
other means. A database application is not always the right solution.
■ Data Items. Make a list of the major entities about which information will be
captured eg. Clients, Organizations, Orders, Products, Sales etc
■ Entity Relationships. For each of the entities identified above, describe how it relates
to other entities. For example, “each Student will be enrolled in one or more
Courses”, “a Class consists of one Teacher and between 10 and 20 students”.
■ Functionality. Document how the data will be used. What specific operations will the
database perform (eg. automate mail-outs, generate reports, facilitate searching
and matching, perform statistical analysis, etc).
■ Business Rules. Define any business rules which apply to the data. For example,
what determines whether a client is consi0dered “active”? Are certain pieces of
client information (such as name and address) mandatory? Who has the authority to
authorize particular transactions
■ User Interface. Describe any ideas you have about how the user interface should
look and behave. Consider how the user might navigate between different parts of
the application, as well as specific functionality such as searching, adding new
records, updating existing records, and so on.
■ Security. Think about whether access to your data needs to be restricted in any way.
Will the database contain sensitive information? Will it be accessible to people
outside your organisation (eg. via the Internet)? Does it need to be accessible to
staff who aren’t connected to your local or wide area network? Who should be able
to view, add, edit or delete data?
■ Scale Consider the likely size of the database and the amount of work it may be
required to do.
Database languages

■ Data Definition Language (DDL) and


■ Data Manipulation Language (DML).

The Data Definition Language is used for specifying the database schema like
CREATE,ALTER and DROP tables
Data Manipulation Language is used for both reading and updating the database like
SELECT, INSERT, UPDATE
Structure of Database Management System (DBMS)
At very high level, a database is considered as shown in below diagram. Let us see them in detail
below.
■ Applications: - It can be considered as a user friendly web page where the user enters the
requests. Here he simply enters the details that he needs and presses buttons to get the data.
■ End User: - They are the real users of the database. They can be developers, designers,
administrator or the actual users of the database.
■ DDL: - Data Definition Language (DDL) is a query fired to create database, schema, tables,
mappings etc in the database. These are the commands used to create the objects like tables,
indexes in the database for the first time. In other words, they create structure of the database.
■ DDL Compiler: - This part of database is responsible for processing the DDL commands. That
means these compiler actually breaks down the command into machine understandable codes.
It is also responsible for storing the metadata information like table name, space used by it,
number of columns in it, mapping information etc.
■ DML Compiler: - When the user inserts, deletes, updates or retrieves the record from
the database, he will be sending request which he understands by pressing some
buttons. But for the database to work/understand the request, it should be broken
down to object code. This is done by this compiler. One can imagine this as when a
person is asked some question, how this is broken down into waves to reach the brain!
■ Query Optimizer: - When user fires some request, he is least bothered how it will be
fired on the database. He is not all aware of database or its way of performance. But
whatever be the request, it should be efficient enough to fetch, insert, update or delete
the data from the database. The query optimizer decides the best way to execute the
user request which is received from the DML compiler. It is similar to selecting the best
nerve to carry the waves to brain!
■ Stored Data Manager: - This is also known as Database Control System. It is one the main
central system of the database. It is responsible for various tasks
– It converts the requests received from query optimizer to machine understandable
form. It makes actual request inside the database. It is like fetching the exact part of the
brain to answer.
– It helps to maintain consistency and integrity by applying the constraints. That means, it
does not allow inserting / updating / deleting any data if it has child entry. Similarly it
does not allow entering any duplicate value into database tables.
– It controls concurrent access. If there is multiple users accessing the database at the
same time, it makes sure, all of them see correct data. It guarantees that there is no data
loss or data mismatch happens between the transactions of multiple users.
– It helps to backup the database and recover data whenever required. Since it is a huge
database and when there is any unexpected exploit of transaction, and reverting the
changes are not easy. It maintains the backup of all data, so that it can be recovered.
■ Data Files: - It has the real data stored in it. It can be stored as magnetic tapes,
magnetic disks or optical disks.
■ Compiled DML: - Some of the processed DML statements (insert, update, delete) are
stored in it so that if there is similar requests, it will be re-used.
■ Data Dictionary: - It contains all the information about the database. As the name
suggests, it is the dictionary of all the data items. It contains description of all the
tables, view, materialized views, constraints, indexes, triggers etc.
THE END

You might also like