DBMS-AN OVERVIEW

DATABASE MANAGEMENT SYSTEM

   The collection of inter-related data and several programs that are used to handle the data is known as Database Management System (DBMS). The main aim of DBMS is to store and efficiently retrieve the data from the database. To manage the data in the database, define the structure for storage of information and provide a proper mechanism for manipulation of information. The database system must also ensure the safety of the information that is stored.

DATABASE SYSTEM APPLICATIONS

    Several applications use a database system. Some of the applications are listed below:

  • Accounting: To maintain the data of employees, salaries, and payroll taxes in the company, students in schools, patients in hospitals, database systems are used.
  • Manufacturing: In factories, database systems are used to manage the supply chain and tracking the production of items.
  • In shopping marts: For maintaining customer, product, and purchase information of items, databases are used.
  • Banking: The database systems are useful in maintaining the customer’s account information, loan details and for maintaining the transactions of credit card history.
  • Universities: DBMS is quite useful in maintaining the student details, course details, and accounting in universities.
  • Reservation systems: To maintain the reservation and schedule information, database systems are used in airways and railways reservation systems
  • Telecommunication: For maintaining the records of the call made and generating the bills, DBMS is useful.

PURPOSE OF DATABASE SYSTEMS

  Earlier database systems are created to manage the commercial data. Data are stored in files. For adding new data or updating the data or deleting the data, various programs are written. Separate applications have to be written for the addition of new data. As time evolves, more files and more applications are required by the system. This typical file processing system is supported by an Operating system. In this system, the data is permanently stored in files. It requires different application programs for extracting or adding new information. Before the introduction of the Database Management System (DBMS), the file processing system was in use.

CHARACTERISTICS OF DATABASE SYSTEMS

  • It represents the aspects of real-world applications.
  • For managing the information systematically.
  • Multiple views for representing the data.
  • Operations such as insertion, deletion, and updating can be done efficiently.
  • A logical relationship between records and data is maintained.

ADVANTAGES OF DATABASE SYSTEMS

  • The data redundancy is removed i.e, there is no duplication of data in DBMS.
  • DBMS allows you to retrieve the desired data in an efficient way.
  • Data isolation can be done in separate tables for convenient usage.
  • A simple query language can be used to access the data.
  • In DBMS, the data integrity is maintained.
  • If some operation is performed on the particular data in one table, then the changes will be reflected on the entire database. So, the atomicity of data is maintained in DBMS.
  • Concurrent access to multiple users is possible in database systems.
  • In DBMS, we can also make the user access only the desired part of the data by restricting the access.

DISADVANTAGES OF DATABASE SYSTEMS                              

  • The complexity of database design is high. And it is also time-consuming.
  • If some failure has occurred in either software or hardware, a large amount of investment is needed to repair it.
  • The entire database may get affected if one part of the database gets affected.
  • For converting the file from a conventional file system to a database system, a large investment is needed to buy the required tools and adopting different techniques.
  • More training is needed for the people who design and maintain the database system.

ACID Properties of Transaction

Database Transaction is a logical unit of processing in a DBMS which entails one or more database access operation. It is a sequence of operations that form a single unit of work.

A transaction is often initiated by an application program

  • Begin a transaction

START TRANSACTION

  • Ends a transaction

COMMIT (if successful) or ROLLBACK (if errors)

A transaction T transforms one consistent database state into another consistent database state. During the execution of T, the database may be temporarily inconsistent.

Either the whole transaction must be succeed or the effect of all operations has to be undone (rollback).

There are two main transaction issues

  • concurrent execution of multiple transactions
  • recovery after hardware failures and system crashes

DBMS is the management of data that should remain integrated when any changes are done in it. It is because if the integrity of data is affected, whole data will get distributed and corrupt. Therefore, to maintain integrity of the data, there are four properties which are known as ACID properties.

Operations in Transaction

Following are the two main operations in a transaction:

  • Read operation
  • Write operation

Read Operation:This operation transfers the data item from the database and then stores it in a buffer in main memory.

Write Operation:This operation writes the updated data value back to the database from the buffer.

For example: Let T be a transaction that transfer Rs50 from X account to Y account. This transaction can be defined as:

T : read(X);
X := X – 50;
write(X);
read(Y);
Y := Y + 50;
write(Y);

Assume that the value of both X and Y before starting of the transaction T is 100.

  • The first operation read the value of X (100) from the database and stores it in a buffer. The second operation will decrease X value by 50. So buffer will contain 50. The third operation will write the value of the buffer to the database. So the final value of X will be 50.
  • The fourth operation read the value of Y (100) from the database and stores it in a buffer. The fifth operation will add X value by 50. So buffer will contain 150. The sixth operation will write the value of buffer to the database. So the final value of Y will be 150.

ACID properties are used for maintaining the integrity of database during transaction processing. ACID stands for Atomicity, Consistency, Isolation, and Durability.

  • Atomicity

A transaction is a single unit of operation. You either execute it entirely or do not execute it at all.

For example, in an application that transfers funds from one account to another, the atomicity property ensures that, if a debit is made successfully from one account, the corresponding credit is made to the other account.

  • Consistency

Once the transaction is executed, it should move from one consistent state to another.

For example, in an application that transfers funds from one account to another, the consistency property ensures that the total value of funds in both the accounts is the same at the start and end of each transaction.

  • Isolation

Even though transactions are executing concurrently, they should appear to be executed in isolation – that is, their final effect should be as if each transaction was executed in isolation from start to finish.

For example, in an application that transfers funds from one account to another, the isolation property ensures that another transaction sees the transferred funds in one account or the other, but not in both, nor in neither.

  • Durability

Once a transaction is committed, its changes (writes) applied to the database must never be lost because of subsequent failure.

For example, in an application that transfers funds from one account to another, the durability property ensures that the changes made to each account will not be reversed.