Database
The database is a collection of inter-related data which is used to retrieve, insert and delete the data
efficiently.
For example: The college Database organizes the data about the admin, staff, students and faculty
etc.
Using the database, you can easily retrieve, insert, and delete the information.
Database Management System
Database management system is a software which is used to manage the database. For
example: MySQL, Oracle, etc are a very popular commercial database which is used in
different applications.
DBMS provides an interface to perform various operations like database creation, storing
data in it, updating data, creating a table in the database and a lot more.
It provides protection and security to the database. In the case of multiple users, it also
maintains data consistency.
Advantages of DBMS
Controls database redundancy: It can control data redundancy because it stores all the
data in one single database file and that recorded data is placed in the database.
Data sharing: In DBMS, the authorized users of an organization can share the data among
multiple users.
Easily Maintenance: It can be easily maintainable due to the centralized nature of the
database system.
Reduce time: It reduces development time and maintenance need.
Backup: It provides backup and recovery subsystems which create automatic backup of data
from hardware and software failures and restores the data if required.
multiple user interface: It provides different types of user interfaces like graphical user
interfaces, application program interfaces
Disadvantages of DBMS
Cost of Hardware and Software: It requires a high speed of data processor and large
memory size to run DBMS software.
Size: It occupies a large space of disks and large memory to run them efficiently.
Complexity: Database system creates additional complexity and requirements.
Higher impact of failure: Failure is highly impacted the database because in most of the
organization, all the data stored in a single database and if the database is damaged due to
electric failure or database corruption then the data may be lost forever.
Structure of DBMS
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,
administrators, 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 objects like tables,
indexes in the database for the first time. In other words, they create the structure of the
database.
DDL Compiler: – This part of the database is responsible for processing the DDL
commands. That means this 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 requests 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 a user fires some requests, he is least bothered how it will be fired on
the database. He is not all aware of the 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 the brain!
Stored Data Manager: – This is also known as Database Control System. It is one of the
main central systems of the database. It is responsible for various tasks
It converts the requests received from query optimizer to machine-understandable form. It
makes actual requests 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 are 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 back up the database and recovers data whenever required. Since it is a huge
database and when there is any unexpected exploit of the transaction, and reverting the
changes is 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 are 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 a description of all the tables, view,
materialized views, constraints, indexes, triggers, etc.