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

TOPIC-2

DATABASE CONCEPTS & ARCHITECTURE


Components of DBMS
The database management system can be divided into five major
components, they are:
1. Hardware
2. Software
3. Data
4. Procedures
5. Database Access Language

Let's have a simple diagram to see how they all fit together to form a
database management system.

DBMS Components: Hardware


When we say Hardware, we mean computer, hard disks, I/O channels
for data, and any other physical component involved before any data is
successfully stored into the memory.
When we run Oracle or MySQL on our personal computer, then our
computer's Hard Disk, our Keyboard using which we type in all the
commands, our computer's RAM, ROM all become a part of the DBMS
hardware.

DBMS Components: Software


This is the main component, as this is the program which controls
everything. The DBMS software is more like a wrapper around the
physical database, which provides us with an easy-to-use interface to
store, access and update data.
The DBMS software is capable of understanding the Database Access
Language and interpret it into actual database commands to execute
them on the DB.

DBMS Components: Data

Data is that resource, for which DBMS was designed. The motive behind
the creation of DBMS was to store and utilise data.
In a typical Database, the user saved Data is present and meta data is
stored.
Metadata is data about the data. This is information stored by the DBMS
to better understand the data stored in it.

For example: When I store my Name in a database, the DBMS will


store when the name was stored in the database, what is the size of the
name, is it stored as related data to some other data, or is it
independent, all this information is metadata.

DBMS Components: Procedures


Procedures refer to general instructions to use a database management
system. This includes procedures to setup and install a DBMS, To login
and logout of DBMS software, to manage databases, to take backups,
generating reports etc.

DBMS Components: Database Access Language


Database Access Language is a simple language designed to write
commands to access, insert, update and delete data stored in any
database.
A user can write commands in the Database Access Language and
submit it to the DBMS for execution, which is then translated and
executed by the DBMS.
User can create new databases, tables, insert data, fetch stored data,
update data and delete the data using the access language.

Users

• Database Administrators: Database Administrator or DBA is the


one who manages the complete database management system.
DBA takes care of the security of the DBMS, it's availability,
managing the license keys, managing user accounts and access
etc.
• Application Programmer or Software Developer: This user
group is involved in developing and desiging the parts of DBMS.
• End User: These days all the modern applications, web or mobile,
store user data. How do you think they do it? Yes, applications are
programmed in such a way that they collect user data and store
the data on DBMS systems running on their server. End users are
the one who store, retrieve, update and delete data.

Functional Components of a database


management system
All DBMS comes with various integrated components and tools
necessary to carry out almost all database management tasks. Some
DBMS software even provides the ability to extend beyond the core
functionality by integrating with third-party tools and services, directly or
via plugins.

In this section, we will look at the common components that are


universal across all DBMS software, including:
• Storage engine
• Query language
• Query processor
• Optimization engine
• Metadata catalog
• Log manager
• Reporting and monitoring tools
• Data utilities
Storage engine
The storage engine is the core component of the DBMS that interacts
with the file system at an OS level to store data. All SQL queries which
interact with the underlying data go through the storage engine.
Query language

A database access language is required for interacting with a database,


from creating databases to simply inserting or retrieving data. A proper
DBMS must support one or multiple query languages and language
dialects. Structured query language (SQL) and MongoDB Query
Language (MQL) are two query languages that are used to interact with
the databases.

In many query languages, the query language functionality can be


further categorized according to specific tasks:

• Data Definition Language (DDL). This consists of commands


that can be used to define database schemas or modify the
structure of database objects.
• Data Manipulation Language (DML). Commands that directly
deal with the data in the database. All CRUD operations come
under DML.

• Data Control Language (DCL). This deals with the


permissions and other access controls of the database.
• Transaction Control Language (TCL). Command which
deals with internal database transactions.

Query processor
This is the intermediary between the user queries and the database. The
query processor interprets the queries of users and makes them
actionable commands that can be understood by the database to
perform the appropriate functionality.

Optimization engine
The optimization Engine allows the DBMS to provide insights into the
performance of the database in terms of optimizing the database itself
and queries. When coupled with database monitoring tools, it can
provide a powerful toolset to gain the best performance out of the
database.

Metadata catalog
This is the centralized catalog of all the objects within the database.
When an object is created, the DBMS keeps a record of that object with
some metadata about it using the metadata catalog. Then, this record
can be used to:
• Verify user requests to the appropriate database objects
• Provide an overview of the complete database structure

Log manager
This component will keep all the logs of the DBMS. These logs will
consist of user logins and activity, database functions, backups and
restore functions, etc. The log manager ensures all these logs are
properly recorded and easily accessible.
Reporting & monitoring tools
Reporting and monitoring tools are another standard component that
comes with a DBMS. Reporting tools will enable users to generate
reports while monitoring tools enable monitoring the databases for
resource consumption, user activity, etc.
Data utilities

In addition to all the above, most DBMS software comes with additional
inbuilt utilities to provide functionality such as:
• Data integrity checks
• Backup and restore
• Simple database repair
• Data validations
• Etc.

DBMS Three Level Architecture Diagram

This architecture has three levels:


1. External level
2. Conceptual level
3. Internal level
1. External level (View)
It is also called view level. The reason this level is called “view” is
because several users can view their desired data from this level which
is internally fetched from database with the help of conceptual and
internal level mapping.

The user doesn’t need to know the database schema details such as
data structure, table definition etc. user is only concerned about data
which is what returned back to the view level after it has been fetched
from database (present at the internal level).

External level is the “top level” of the Three Level DBMS Architecture.

2. Conceptual level (Logical)


It is also called logical level. The whole design of the database such as
relationship among data, schema of data etc. are described in this level.
Database constraints and security are also implemented in this level of
architecture. This level is maintained by DBA (database administrator).

3. Internal level (Physical)


This level is also known as physical level. This level describes how the
data is actually stored in the storage devices. This level is also
responsible for allocating space to the data. This is the lowest level of
the architecture.

Database Languages:

The Database languages are called sub-languages. This is because


they do not have all the facilities of a full-fledged programming language.
Several constructs like selection and iterative statements are not
available. The sub-languages has two parts.

❖ Data Definition Language (DDL)

❖ Data Manipulating Language (DML)


Data Definition Language:
Data definition language defines the schema for the database by
specifying entities and the relationship among them. In addition to this,
DDL even defines certain security constraints.

The execution of DDL statements results in new tables which are stored
in "system catalog" also called data dictionary or data directory.

Data dictionary maintains the information of all the definitions of


database schema, low-level data structures (files and records) and the
relationship among various records. Data dictionary provides faster
access to database by maintaining certain indexes.It also contains
information regarding meta data ( that is data about data) stored in
database.

Data definition language allows the user to specify the storage and
access methods using a special language called data storage and
definiton language.

Data Manipulation Language:


Data Manipulation Language allows the user to access or modify the
data the data in accordance to the required data model. The different
operations performed using DML include,

➢ Insertion of new data


➢ Deletion of stored data
➢ Retrieval of stored data
➢ Modification of data

Data manipulations are applied at internal, conceptual and external


levels of schemas. However, the level of complexity at each schema
level varies from one another. For instance, we define complex low-level
procedures to allow efficient access, but procedures focus on ease of
usage, thus involve low complexity.

Data manipulation language that involves in retrieval of data is called


"query language". DML are classified based on the retrieval constructs
as,
❖ Procedural DML
❖ Non-procedural DML

Procedural DML
Using procedural DML, the user can specify "what" data needs to be
retrieved and "how" to retrieve the required data. This means that the
user has to express the operations that would retrieve the desired data.
DML initiates by evaluating these operations. The result of evaluation is
again operated until the desired data is retrieved. The DML statements
are embedded into high-level languages to perform selective and
iterative operations.

Non-procedural DML
Non-procedural languages are also called declarative language that
specify "what" data is to be retrieved but does not specify "how" the data
is to be retrieved. These languages are easy to learn as the user simply
needs the desired data. It is the responsibility of database system
choose an optimal procedure in order to retrieve the required data.
DBMS translates the DML statements into set procedures and retrieves
the data.

In DBMS (Data Base Management System), there are mainly four kinds
of commands are available. They are: DQL, DDL, DML, TCL, and DCL

1. DQL (Data Query Language) : SELECT


2. DDL (Data Definition Commands): CREATE, DROP, TRUNCATE,
ALTER
3. DML (Data Manipulation Commands): DELETE, INSERT, UPDATE
4. DCL (Data Control Commands): GRANT, REVOKE
5. TCL (Transaction Control Commands): COMMIT, ROLLBACK,
SAVEPOINT

What is Database Schema?


• A database schema is the logical representation of a database,
which shows how the data is stored logically in the entire database.
It contains list of attributes and instruction that informs the database
engine that how the data is organized and how the elements are
related to each other.

• A database schema contains schema objects that may


include tables, fields, packages, views, relationships, primary
key, foreign key,

• In actual, the data is physically stored in files that may be in


unstructured form, but to retrieve it and use it, we need to put it in a
structured form. To do this, a database schema is used. It provides
knowledge about how the data is organized in a database and how
it is associated with other data.

• The schema does not physically contain the data itself; instead,
it gives information about the shape of data and how it can be
related to other tables or models.

• A database schema object includes the following:


o Consistent formatting for all data entries.
o Database objects and unique keys for all data entries.
o Tables with multiple columns, and each column contains its
name and datatype.

• The complexity & the size of the schema vary as per the size of the
project. It helps developers to easily manage and structure the
database before coding it.

• The given diagram is an example of a database schema. It contains


three tables, their data types. This also represents the relationships
between the tables and primary keys as well as foreign keys.
Types of Database Schema
The database schema is divided into three types, which are:

1. Logical Schema
2. Physical Schema
3. View Schema
1. Physical Database Schema
A physical database schema specifies how the data is stored physically
on a storage system or disk storage in the form of Files and Indices.
Designing a database at the physical level is called a physical schema.

2. Logical Database Schema


The Logical database schema specifies all the logical constraints that
need to be applied to the stored data. It defines the views, integrity
constraints, and table. Here the term integrity constraints define the set
of rules that are used by DBMS (Database Management System) to
maintain the quality for insertion & update the data. The logical schema
represents how the data is stored in the form of tables and how the
attributes of a table are linked together.

At this level, programmers and administrators work, and the


implementation of the data structure is hidden at this level.

3. View Schema
The view level design of a database is known as view schema. This
schema generally describes the end-user interaction with the database
systems.
Difference between the Physical and Logical Database Schema

Physical database schema Logical Database schema

It does not include the attributes. It includes the attributes.

It contains both primary & It also contains both primary &


secondary Keys. secondary keys.

It contains the table name. It contains the names of the


tables.

It contains the column names and It does not contain any column
their data types. name or datatype.

Database Development Life Cycle


The Database Life Cycle (DBLC) contains six phases, as shown in the
following Figure: database initial study, database design, implementation
and loading, testing and evaluation, operation, and maintenance and
evolution.
1. The Database Initial Study:
I
n the Database initial study, the designer must examine the current
system’s operation within the company and determine how and why the
current system fails. The overall purpose of the database initial study is
to:

• Analyze the company situation.


• Define problems and constraints.
• Define objectives.
• Define scope and boundaries.

a. Analyze the Company Situation:

The company situation describes the general conditions in which a


company operates, its organizational structure, and its mission. To
analyze the company situation, the database designer must discover
what the company’s operational components are, how they function, and
how they interact.

b. Define Problems and Constraints:

The designer has both formal and informal sources of information. The
process of defining problems might initially appear to be unstructured.
Company end users are often unable to describe precisely the larger
scope of company operations or to identify the real problems
encountered during company operations.

c. Define Objectives:

A proposed database system must be designed to help solve at least the


major problems identified during the problem discovery process. In any
case, the database designer must begin to address the following
questions:

• What is the proposed system’s initial objective?


• Will the system interface with other existing or future systems in the
company?
• Will the system share the data with other systems or users?
d. Define Scope and Boundaries:

The designer must recognize the existence of two sets of limits: scope
and boundaries. The system’s scope defines the extent of the design
according to operational requirements. Will the database design
encompass the entire organization, one or more departments within the
organization, or one or more functions of a single department? Knowing
the scope helps in defining the required data structures, the type and
number of entities, the physical size of the database, and so on.

The proposed system is also subject to limits known as boundaries,


which are external to the system. Boundaries are also imposed by
existing hardware and software.

2. Database Design:
The second phase focuses on the design of the database model that will
support company operations and objectives. This is arguably the most
critical DBLC phase: making sure that the final product meets user and
system requirements. As you examine the procedures required to
complete the design phase in the DBLC, remember these points:

• The process of database design is loosely related to the analysis and


design of a larger system. The data component is only one element of a
larger information system.

• The systems analysts or systems programmers are in charge of


designing the other system components. Their activities create the
procedures that will help transform the data within the database into
useful information.

3. Implementation and Loading:


The output of the database design phase is a series of instructions
detailing the creation of tables, attributes, domains, views, indexes,
security constraints, and storage and performance guidelines. In this
phase, you actually implement all these design specifications.

a. Install the DBMS:

This step is required only when a new dedicated instance of the DBMS
is necessary for the system. The DBMS may be installed on a new
server or it may be installed on existing servers. One current trend is
called virtualization. Virtualization is a technique that creates logical
representations of computing resources that are independent of the
underlying physical computing resources.

b. Create the Database(s):

In most modern relational DBMSs a new database implementation


requires the creation of special storage-related constructs to house the
end-user tables. The constructs usually include the storage group (or file
groups), the table spaces, and the tables.

c. Load or Convert the Data:

After the database has been created, the data must be loaded into the
database tables. Typically, the data will have to be migrated from the
prior version of the system. Often, data to be included in the system
must be aggregated from multiple sources. Data may have to be
imported from other relational databases, non relational databases, flat
files, legacy systems, or even manual paper-and-pencil systems

4. Testing and Evaluation:


In the design phase, decisions were made to ensure integrity, security,
performance, and recoverability of the database. During implementation
and loading, these plans were put into place. In testing and evaluation,
the DBA tests and fine-tunes the database to ensure that it performs as
expected. This phase occurs in conjunction with applications
programming.

a. Test the Database:

During this step, the DBA tests the database to ensure that it maintains
the integrity and security of the data. Data integrity is enforced by the
DBMS through the proper use of primary and foreign key rules. In
database testing you must check Physical security allows, Password
security, Access rights, Data encryption etc.

b. Fine-Tune the Database:

Although database performance can be difficult to evaluate because


there are no standards for database performance measures, it is
typically one of the most important factors in database implementation.
Different systems will place different performance requirements on the
database. Many factors can impact the database’s performance on
various tasks. Environmental factors, such as the hardware and software
environment in which the database exists, can have a significant impact
on database performance.

c. Evaluate the Database and Its Application Programs:

As the database and application programs are created and tested, the
system must also be evaluated from a more holistic approach. Testing
and evaluation of the individual components should culminate in a
variety of broader system tests to ensure that all of the components
interact properly to meet the needs of the users. To ensure that the data
contained in the database are protected against loss, backup and
recovery plans are tested.

5. Operation
Once the database has passed the evaluation stage, it is considered to
be operational. At that point, the database, its management, its users,
and its application programs constitute a complete information system.
The beginning of the operational phase invariably starts the process of
system evolution.

6. Maintenance and Evolution

The database administrator must be prepared to perform routine


maintenance activities within the database. Some of the required
periodic maintenance activities include:

• Preventive maintenance (backup).


• Corrective maintenance (recovery).

• Adaptive maintenance (enhancing performance, adding entities and


attributes, and so on).

• Assignment of access permissions and their maintenance for new and


old users.
Functions of Database Management System (DBMS)
DBMS performs several important functions that guarantee the integrity
and consistency of the data in the database. The most important
functions of Database Management System are

➢ Data Dictionary Management,


➢ Data Storage Management,
➢ Data Transformation and Presentation,
➢ Security Management,
➢ Multi user Access Control,
➢ Backup and Recovery Management,
➢ Data Integrity Management,
➢ Database Access Languages andApplication Programming
Interfaces and
➢ Database Communication interfaces.

1. Data Dictionary Management

Data Dictionary Management is the one of the most important function of


database management system.

DBMS stores definitions of the data elements and their relationships


(metadata) in a data dictionary.

So, all programs that access the data in the database work through the
DBMS.

The DBMS uses the data dictionary to look up the required data
component structures and relationships which relieves you from coding
such complex relationships in each program.

Additionally, any changes made in a database structure are


automatically recorded in the data dictionary, thereby freeing you from
having to modify all of the programs that access the changed structure.
In other words, the DBMS system provides data abstraction, and it
removes structural and data dependence from the system.

2. Data Storage Management

One of the DBMS functionality is creating and managing the complex


structures required for data storage, thus relieving you from the difficult
task of defining and programming the physical data characteristics.
A modern DBMS system provides storage not only for the data, but also
for related data entry forms or screen definitions, report definitions, data
validation rules, procedural code, structures to handle video and picture
formats, and so on.

Data storage management is also important for database performance


tuning. Performance tuning relates to the activities that make the
database perform more efficiently in terms of storage and access speed.
So, the data storage management is another important function of
Database Management System.

3. Data transformation and presentation


The DBMS transforms entered data in to required data structures. The
DBMS relieves you of the chore of making a distinction between the
logical data format and the physical data format. That is, the DBMS
formats the physically retrieved data to make it conform to the user’s
logical expectations.

For example, imagine an enterprise database used by a multinational


company. An end user in England would expect to enter data such as
July 11, 2009, as “11/07/2009.” In contrast, the same date would be
entered in the United States as “07/11/2009.” Regardless of the data
presentation format, the DBMS system must manage the date in the
proper format for each country.

4. Security Management

Security Management is another important function of Database


Management System(DBMS). The DBMS creates a security system that
enforces user security and data privacy. Security rules determine which
users can access the database, which data items each user can access,
and which data operations (read, add, delete, or modify) the user can
perform. This is especially important in multiuser database systems.

5. Multi User Access Control

Multiuser access control is another important DBMS Function. To


provide data integrity and data consistency, the DBMS uses
sophisticated algorithms to ensure that multiple users can access the
database concurrently without compromising the integrity of the
database.
6. Backup and Recovery Management

The DBMS provides backup and data recovery to ensure data safety
and integrity.

Current DBMS systems provide special utilities that allow the DBA to
perform routine and special backup and restore procedures. Recovery
management deals with the recovery of the database after a failure,
such as a bad sector in the disk or a power failure. Such capability is
critical to preserving the database’s integrity.

7. Data Integrity Management

Data integrity management is another important DBMS function.


The DBMS promotes and enforces integrity rules, thus minimizing data
redundancy and maximizing data consistency.

The data relationships stored in the data dictionary are used to enforce
data integrity. Ensuring data integrity is important DBMS functionality in
transaction-oriented database systems.

8. Database Access Languages and Application Programming


Interfaces

The DBMS provides data access through a query language. A query


language is a non procedural language—one that lets the user specify
what must be done without having to specify how it is to be done.
Structured Query Language (SQL) is the defacto query language and
data access standard supported by the majority of DBMS vendors.

9. Database Communication Interfaces

Current-generation DBMS's accept end-user requests via multiple,


different network environments. For example, the DBMS might provide
access to the database via the Internet through the use of Web browsers
such as Mozilla Firefox or Microsoft Internet Explorer. In this
environment, communications can be accomplished in several ways:
• End users can generate answers to queries by filling in screen
forms through their preferred Web browser.
• The DBMS can automatically publish predefined reports on a
Website.
• The DBMS can connect to third-party systems to distribute
information via e-mail or other productivity applications.

You might also like