In a modern computer system, data resides and it is transported throughout a hierarchy of storage media. The highest speed memory is the most expensive and therefore available with least capacity. The lowest speed memory is offline tape storage which is available in indefinite storage capacity.
The storage capacity is measured in bytes, kilobytes, megabytes and gigabytes.
Types of Storage
Databases typically store large amounts of data that must persist over long periods of time. Most databases are stored permanently on magnetic disk secondary storage for the following reasons:-
- Generally databases are too large to fit entirely in main memory.
- The circumstances that cause permanent loss of stored data arise less frequently for disk secondary storage than for primary storage. Hence, we refer to disk and other secondary storage devices as nonvolatile storage, whereas main memory is often called volatile storage.
- The cost of storage per unit of data is less for disk storage secondary storage than for primary storage.
Magnetic tapes are used for archiving and backup storage of data because storage on tape costs even less than storage on disk.
It provides fast access data for limited Storage and it is operated directly by CPU. At the primary storage level the memory hierarchy includes the most expensive end cache memory which is a static RAM(Random Access Memory). The next level of primary storage is DRAM(Dynamic RAM). The advantage of DRAM is its low cost.Generally programs executes in DRAM. Personal computers and workstations have hundreds of megabytes of data in DRAM. It is becoming possible to load a large part of the database in main memory. Some times, for real time applications the entire database can be kept in main memory leading to a main memory databases.
It is removable media such as Hard Disk, Magnetic Disk, Tapes, etc.
Tertiary storage is built using removal media. Low cost is the defining characteristics of tertiary storage. Common examples of removable media are Floppy disks, and CD-ROMs.
Storage of Database
The techniques used to store large amounts of data on disk are important for database designers, the DBA , and implementers of a DBMS. DBMS system implementer must study data organisation technique so that they can implement them efficiently.
Typical database applications needs only a small portion of database at a time for processing. The data stored on disk is organised as files of records. Each record is a collection of data values that can be interpreted as facts about entities, their attributes, and their relationships. Records should be stored on disk in manner that makes it possible to locate them efficiently when they are needed.
There are several primary file organisation which determine how the file records are physically placed on a disk, and hence how the records can be accessed. A heap file( or unordered file) places the record on disk in no particular order by appending new records at the end of the file, whereas a sorted file (or sequential file) keeps the record ordered by the value of a particular field (called the hash key). Other primary file organisations such as B-trees, use tree structures.
If you liked this article and would like one such blog to land in your inbox every week, consider subscribing to our newsletter: https://skillcaptain.substack.com