• Several types of data storage exist in most
• These storage media are classified by the
speed with which data can be accessed, by the
cost per unit of data to buy the medium, and
by the medium’s reliability.
Types Of Storage Media
• main memory
• flash memory
• magnetic disk
• optical disk
• magnetic tapes
• The cache is the fastest and most costly form
• Cachememory is relatively small
• its use is managed by the computer system
• We shall not be concerned about managing
cache storage in the database system.
• It is, however, worth noting that database
implementors do pay attention to cache
effects when designing query processing data
structures and algorithms.
• The storage medium used for data that are
available to be operated on is main memory.
• Although main memory may contain several
gigabytes of data on a personal computer, or
even hundreds of gigabytes of data in large
server systems, it is generally too small (or too
expensive) for storing the entire database.
• The contents of main memory are usually lost
if a power failure or system crash occurs.
• Flash memory differs from main memory in
that stored data are retained even if power is
turned off (or fails).
• Two Types of Flash Memory:
• NAND flash has a much higher storage
capacity for a given cost, and is widely used
for data storage in devices such as cameras,
music players, and cell phones, and
increasingly, in laptop computers as well.
• Flash memory has a lower cost per byte than
main memory, in addition to being
nonvolatile; that is, it retains stored data even
if power is switched off.
• Flash memory is alsowidely used for storing
data in “USB keys,” which can be plugged into
the Universal Serial Bus (USB) slots of
• Flash memory is also increasingly used as a
replacement for magnetic disks for storing
moderate amounts of data.
• Such disk-drive replacements are called solid-
• As of 2009, a 64 GB solid-state hard drive
costs less than $200, and capacities range up
to 160 GB.
• Further, flash memory is increasingly being
used in server systems to improve
performance by caching frequently used data,
since it providesfaster access than disk, with
larger storage capacity than main memory (for
a given cost).
• The primary medium for the long-term online
storage of data is the magnetic disk.
• Usually, the entire database is stored on
• The system must move the data from disk to
main memory so that they can be accessed.
• After the system has performed the
• operations, the data that have been modified
must be written to disk.
• As of 2009, the size of magnetic disks ranges
from 80 gigabytes to 1.5 terabytes, and a 1
terabyte disk costs about $100.
• Disk capacities have been growing at about 50
percent per year, and we can expect disks of
much larger capacity every year.
• Disk storage survives power failures and
• Disk-storage devices themselves may
sometimes fail and thus destroy data,
• but such failures usually occur much less
frequently than do system crashes.
• The most popular forms of optical storage
• Compact disk (CD), which can hold about
700 megabytes of data and has a playtime of
about 80 minutes
• Digital video disk (DVD), which can hold 4.7
or 8.5 gigabytes of data per side of the disk
(or up to 17 gigabytes on a two-sided disk).
• The expression digital versatile disk is also
used in place of digital video disk, since DVDs
can hold any digital data, not just video data.
• Data are stored optically on a disk, and are
read by a laser.
• A higher capacity format called Blu-ray DVD
can store 27 gigabytes per layer, or 54
gigabytes in a double-layer disk.
• The optical disks used in read-only compact
disks (CD-ROM) or read-only digital video
disks (DVD-ROM) cannot be written, but are
supplied with data prerecorded.
• There are also “record-once” versions of
compact disk (called CD-R) and digital video
disk (called DVD-R and DVD+R), which can be
written only once. such disks are also called
write-once, read-many (WORM) disks.
• There are also “multiple-write” versions of
compact disk (called CD-RW) and digital video
disk (DVD-RW, DVD+RW, and DVD-RAM),
which can be written multiple times.
• Optical disk jukebox systems contain a few
drives and numerous disks that can be loaded
into one of the drives automatically (by a
robot arm) on demand.
• Tape storage is used primarily for backup and
• Although magnetic tape is cheaper than disks,
access to data is much slower, because the
tape must be accessed sequentially from the
• For this reason, tape storage is referred to as
• In contrast, disk storage is referred to as
direct-access storage because it is possible to
read data from any location on disk.
• Tape libraries (jukeboxes) are used to hold
exceptionally large collections of data such as
data from satellites,which could include as
much as hundreds of terabytes (1 terabyte =
1012 bytes), or even multiple petabytes (1
petabyte = 1015 bytes) of data in a few cases.
• The fastest storage media—for example, cache and
main memory—are referredto as primary storage.
• The media in the next level in the hierarchy—for
example, magnetic disks—are referred to as secondary
storage, or online storage.
• The media in the lowest level in the hierarchy—for
example, magnetic tape and optical-disk jukeboxes—
are referred to as tertiary storage, or offline storage.
• In addition to the speed and cost of the various storage
systems, there is also the issue of storage volatility.
Volatile storage loses its contents when the power to
the device is removed
• In the hierarchy shown in Figure 10.1, the
storage systems from main memory up are
volatile, whereas the storage systems
belowmain memory are nonvolatile. Data
must be written to nonvolatile storage for