Table of contents
1.
Introduction
2.
Types of Data Storage
2.1.
Primary Storage
2.1.1.
Main memory
2.1.2.
Cache
2.2.
Secondary Storage
2.2.1.
Hard Drive
2.2.2.
Magnetic Disk storage
2.3.
Tertiary Storage
2.3.1.
Tape Storage
2.3.2.
Optical Storage
3.
Storage Hierarchy 
4.
Frequently Asked Questions 
5.
Key Takeaways
Last Updated: Mar 27, 2024

DBMS Storage System

Author Apoorv Dixit
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Have you ever wondered why everyone around us is obsessed with getting a perfect space on their devices? Why are RAM sizes generally smaller than hard drives?

What are these devices, how much data can they store? How are they connected, what type of hierarchy do they follow? So many questions; well, we will discuss them all in this article.

Database are the collection of data that provide the ultimate view of the stored data. We all know that data is stored in bits and bytes in different storage devices. At the physical level, actual data is stored in some devices in electromagnetic form. Storage systems can be classified into three types of storage devices now; let's understand these types thoroughly:

Must Recommended Topic, Schema in DBMS,Lock based protocol in DBMS and Checkpoint in DBMS

Types of Data Storage

There are three types of data storage devices namely primary, secondary and tertiary storage. The relationship between them in terms of storage capacity, cost, and speed is shown in the diagram given below. Now let’s study each type in detail                  

Primary Storage

It is the memory storage that is directly accessible to the CPU. It provides quick access to the stored data. These types of storage devices temporarily store the data, and therefore, they are also termed volatile storage. Volatile means that if the system gets off(restarts, gets a power cut, or crashes), the data in these devices are lost permanently, and the space becomes again free, which can be utilized for other purposes.

Since these devices are directly accessible to the CPU, they are placed on the motherboard. These devices are typically small and ultra-fast. CPU's internal memory(registers), cache memory, and main memory(RAM) are all directly accessible to the CPU and are placed on the motherboard's chipset. CPU's main memory and cache are two important primary devices. Let us discuss them right away: 

Main memory

The main memory handles the instructions of the computer. It is generally termed RAM(Random Access Memory). RAM stores operating system software, software applications, and other information for the CPU to have direct access when needed.

 

source:pexels.com

Cache

It is a tiny storage media that is maintained by computer hardware only. A cache is much faster than RAM and makes data retrieving easier and more efficient. 

Secondary Storage

Secondary storage is the storage area that allows you to save and store data permanently, and it is also called 'Online storage.' Secondary storage is 'non-volatile storage, i.e., unlike primary storage, it doesn't lose data if the system restarts, crashes, or gets a power cut. Secondary storage devices work alongside primary computer storage(i.e., cache and RAM), and they are not as fast as primary storage. Some commonly described secondary storage media are:

Hard Drive

A hard drive, hard disk, HDD, or HD is a non-volatile data storage device. It is usually installed on the computer and directly connected to the motherboard. It contains one or more platters housed inside the air-sealed casing; data is written on these platters with a magnetic head/heads that move to and fro as platters spin. These can be of various sizes and can store data as per the user's need. There are two types of HDDs, namely internal HDD and external portable HDD.

 

 

source:pexels.com

Magnetic Disk storage

A magnetic disk is a flat disk covered with a magnetic coating and uses a magnetization process to read, write and access data. It stores data in the form of tracks, spots, and sectors. Floppy disks and zip disks are typical examples of magnetic disks.

 

Tertiary Storage

Tertiary storage devices are devices to store immense amounts of data. These storage devices are external to the computer system and slowest. Generally, these devices are used to back up an entire system. Optical disks(optical storage) and magnetic tapes(tape storage) are commonly used tertiary storage devices. These two types of storage are explained below:

Tape Storage

In a tape storage system, magnetic tape is used as a recording media to store data. Generally, magnetic tapes are used for archiving and backup data for long-term storage.

Optical Storage

In optical storage, data is read and written with a laser. Typically data is written on a Digital Versatile Disc(DVD)  or Compact Disk(CD). Optical media is more durable and less vulnerable to environmental conditions than tape storage.

                                                                                         Source:pixabay.com

Now that we’ve gained a depth of understanding of different storage devices, let us now look at the hierarchy they follow: 

Recommended Topic - Specialization and Generalization in DBMS And Recursive Relationship in DBMS

Storage Hierarchy 

In computers, the storage system has a well-defined hierarchy. Main memory directly connects to the CPU, and the CPU has direct access to primary memory and built-in registers. The access time of the main memory is less than CPU speed; to minimize this speed mismatch, catch memory is introduced, which temporarily saves data, so it does not need to be searched again and again. The storage media can be organized on the basis of data access time, storage speed, cost per unit of data to buy the item. The image below depicts this hierarchy,( memories have been grouped into levels for better understanding):

In the image, the higher levels are fast, and at the same time, they are expensive too. Registers, cache, and main memory are directly accessible to the CPU. It means levels 0, 1, 2 have less access time compared to other lower levels. They have less space than lower levels. Storage capacity continues to increase as we move down the hierarchy.

Level 3 is for secondary storage, it has a larger capacity than the upper level and at the same time, it has a lower access time. It has also less cost per unit storage of data than upper levels.

The last level depicts tertiary storage, it has maximum storage capacity and slowest speed in terms of access time. Due to their slow access, cost per unit of data storage is less.

On moving down the hierarchy, cost per bit decreases, and access time increases. The lower-level devices are slow and cheap hence they can be used to store large amounts of data.

Also See, B+ Tree in DBMS, Multiple Granularity in DBMS and Entity in DBMS

Frequently Asked Questions 

1. What is the purpose of a storage system?

The primary purpose of storage systems and storage devices is to store data and software for later use. Stored data can be accessed again and again, directly loaded on the CPU for further processing, or directed to an output device.

2. Why is RAM called volatile memory?

RAM or Random Access Memory is known as volatile memory because it loses all its data when it turns off

3. Why is RAM called random access?

RAM is called random access memory because any storage location can be accessed directly using RAM. RAM is controlled and organized to enable data to be stored and retrieved directly to specific locations. 

Key Takeaways

In this blog, we have learned about storage systems in DBMS, different storage devices, including commonly used ones. We have also discussed Memory Hierarchy in the computer storage systems followed by some FAQs. 

Don't stop here, Ninja; check out the Top 100 SQL Problems to get hands-on experience with frequently asked interview questions and land your dream job. You can visit Coding Ninjas Studio to practice programming problems for your complete interview preparation. You can also consider our Database Management Course to give your career an edge over others.

Live masterclass