Introduction to Database Systems

Introduction to Database Systems

Modeling and Designing the Database

Introduction

Database System Management (DBMS) is so prominently used in various fields. Be it like finance, credit card system, Social media sites, online shopping, railways, and education sector.. and the list goes on. One of the fastest-growing fields like Data Science's whole system relies on DBMS.

Before we move on, let us first truly understand the terms we just got to know:

  • Database : It can be defined as a collection of related data built to meet the requirements of any sort of organization for the purpose of monitoring and analyzing.

  • DBMS is a collection of interrelated data and a set of programs to access those data. It's general-purpose software that lets us facilitate, manipulate, manage databases and share among the users.

Before storing the data we design the structure or description for the data. In any kind of DBMS we must make sure that data should be efficiently stored then only it can be analyzed.

✅Some popular database management systems are as follows:

Most-Popular-DBMS-Database-Management-Systems.jpg

We will take an example of a simple database table which is also called flatfile.

2.png

We can see the table has two entries with the same name. This creates confusion that which one got what marks. This is called redundancy, meaning repetition of data in large tables in a system.

Hence a common way to differentiate duplicate data is to assign a unique number to each entry.

3.png

We can make another column named student_ID which will have only unique values. This type of column that only contains unique values is called the primary key.

When adding a column we also change the design of the table. So make sure that the original data is not altered.

Traditional file oriented data storage

This was an approach that was earlier used by the people for data storage in which data is stored in one or more separate computer files managed by different applications.

The Cloud Simplified (1).png

As you can see, information is stored in flat files which are maintained by the file system under the operating system's control. These flatfiles contain records which have no structural relationship among them.

This kind of approach was discarded due to various reasons and disadvantages that we will now see by discussing each of them:

1) Inconsistency and Data redundancy

Lets take an example of a company's data storage system which is a traditional approach

The Cloud Simplified (2).png

In this, All the bottom flat files will contain personal info with that data which that file is concerned with its application for example for salary application, its file will contain current salary data with the employee's personal info.

A similar trend will be seen in the other two files, now let's say that the employee's residential address has been changed, this change can only be applied to one file but professionally, this change should be visible in all the files to maintain consistency of the data. However here, we see the change will occur only in one application which will lead to Inconsistency of the data.

Also, we can't have a common personal info file that is related to all applications because in the traditional approach there is no relation among the applications which leads to data redundancy further leading to higher costs and access cost as same info will be unnecessarily repeated.

2) Data Isolation

When we refer to data for making a new application, the data which needs to be retrieved is very difficult.

3) Difficulty in accessing data

The data is accessed sequentially hence the data is not retrieved in a convenient and efficient manner. This becomes more hectic as we need to write a new program to carry out each new task.

✅ With DMBS, one can access data without even writing a whole new set of programs every time.

4) Integrity problem

Let's say that an application was built based on some constraints but if in the case in future some constraints need to get updated or changed, implementation of them becomes very tough. Hence its hard to add nee constraints stated explicitly.

DBMS allows changing the constraints even when the application is running.

5) Atomicity of updates

In cases of failures, the database is left inconsistent state rather than getting updated. For example, if there's a translation between two accounts, an equal amount must be reduced from the sender's account and exactly that amount must be added to the receiver's account. If there's a failure, the process must be stopped immediately and no account should be left half-completed, however, this isn't monitored by the traditional approach.

The Cloud Simplified (3).png

✅ On the other hand, DBMS is able to monitor this and stop the process in case of any failure.

6) Concurrent access by many users:

Suppose that there is a common account between two users and if one user removes some amount, that change in amount should be seen/reflected for the other user as well. However, this is not Concurrent which leads to Inconsistency.

The Cloud Simplified (4).png

✅ DBMS uses the concurrency control technique to make sure Inconsistency doesn't happen.

7) Security Problems:

Enforcing Security constraints is difficult when the application is added to the file processing system. User authentication implementation is also hard to provide.

Conclusion

As we observe so many drawbacks faced by the traditional approach of storing data, so the world did many years back and hence we have adapted the technology of DBMS.

=============================================================

Thank you for reading the blog.🙌🏻📃

Follow for further parts of DBMS, coming soon...

🔰 Keep Learning !! Keep Sharing !! 🔰

I would love to connect with you. Give me a Hello on the below socials:

🚀 Feel free to connect with me :

Keep Growing and don't forget to have fun :) 🍻*