Secondary storage is the media we use to store digital data or programs when the computer is switched off. An analogy of this is a person's long-term memory, therefore it is non-volatile.
Recall Storage Access Methods
Data that is stored needs to be read, otherwise it is useless. We already touched on the two ways stored data can be read in Chapter 3. The card below should refresh your memory.
Why is this then? How data is stored and read varies with the kind of device and the type of physical material it is made from.
Physical Material | Storage Medium | Examples | Access Method |
Paper | Perforated Tape | -- | Sequential |
Paper | Punched Card | -- | Sequential |
Magentic | Tape | Casette | Sequential |
Magnetic | Disk | Floppy, HD | Direct |
Optical | Laser Disk | CD, DVD, Blue ray | Both |
Semiconductor | Flash Memory | SSD, USB, microSD | Direct |
You might be thinking... if there are storage devices that support both access methods, isn't this true also for devices that support direct access? Can't one access direct locations in a certain order? Yes! Data can be accessed sequentially on any direct-access device. It is important to realise though that you can never have direct-access on a sequential-access medium.
By the way, did you know that paper mediums were used in the age of the...?
Ok maybe not, seriously though that technology is really old, but it did take us to the moon!
Storage Medium and Popular Devices
Let's look into various kinds of storage mediums starting with the most popular.
Flash Memory
Flash memory is quite similar to RAM except that it is non-volatile. It is widely used in our devices and we love it because it has the following advantages:
No moving parts so it is durable.
Data can be deleted or overwritten "in a flash".
Not a lot of power is needed.
Very silent.
There are a few disadvantages which you need to be aware of:
Write speeds vary and can be slower than other medium.
Quite expensive.
Limited capacity in comparison to magnetic disks.
Limited number of read/write cycles.
Need to be used frequently otherwise they can get damaged.
The most popular forms you are definitely familiar with are USB drives which are portable and solid-state drives, SSD in short, which can be found in most laptops these days.
Magnetic Disk
Both floppy disk drives and hard disk drives work in a similar fashion. Before USB drives became popular, people used small floppy disks as portable secondary storage but they are not used anymore. The term floppy was coined because the disk inside felt very flimsy.
Magnetic disks having moving read/write heads, all attached to a single arm, that contain electromagnets. Data is written on disk by creating magnetic charges in one of two directions, up (1) or down (0). The diagram below illustrates the different parts. A track is a group of contiguous memory locations on a surface. Every individual memory location on the track is called a sector. For direct access the heads move to the right track first and then the spindle rotates the disks until the sector is covered.
These are still widely popular today due to the following advantages:
Fast data retrieval.
Very compact meaning you get can a lot of capacity without adding bulk.
Does not require a lot of power.
Although nothing is perfect and there are disadvantages you should be wary of:
There are a lot of moving parts so it is slightly more delicate and can break.
Dirt and dust can get trapped and cause it to malfunction.
Quite expensive.
Noisy.
Optical
Optics is the study of light and how it interacts with materials. An optical device like a DVD is made up of various thin layers but two of these layers are more important:
A really shiny layer that is super reflective on top.
A polycarbonate layer which is anti-reflective underneath.
Data is written by forming tiny dents on the surface to reveal the polycarbonate layer. A beam of light is then used to read the data on a disk, if the light beam bounces back because the surface is shiny then it represents a 1, otherwise it means that the there is a dent so that is a 0.
Device | Variation | Comments |
*CD-ROM | Read only | Up to 700 Mb storage |
CD-R | Writeable only once | |
CD-RW | Writeable more than once | |
*DVD | Variations as applicable for CD | Up to 4.7 Gb storage |
* CD refers to compact disk **DVD refers to digital video disk
Advantages of optical storage devices:
Easy to store, carry and use.
Durable with the proper care.
Disadvantages of optical storage devices:
Many devices do not come with a disk drive these days, you have to buy one separately. My personal opinion is that CDs are moving out of fashion.
Not all disks are rewriteable.
Cloud Storage
Nowadays many companies provide a service allowing us to make use to remote secondary storage. We do not buy a device and take care of it but rather we pay a service to store our files in "the cloud" and interact with it as though we actually have the device ourselves.
Advantages:
Has become very reliable and secure. There is less fear that data will be lost. These companies are very good at taking back-ups.
You do not need to buy a physical device and carry it with you.
Generous free plans are widely available: Google Drive, One Drive, iCloud and Drop Box are notable examples.
Disadvantages:
Can only be used with an internet connection.
Memory Fragmentation
You: "But Miss, this is not a device..."
Miss: True, but we need to talk about the elephant in the room and this is the best place. All kinds of memory, especially our hard disk, suffers from memory fragmentation.
We really need storage devices to store our files. The whole purpose of using these is to put in documents or programs when we need to and perhaps remove or replace as time goes by.
Think of memory as a grid made up of equally sized blocks, and a file that you save can occupy one or more blocks.
Ideally when you save a file of a certain size, a contiguous set of blocks almost equal to that size is available so that most parts of the file can be found next to each other like File 7 (above). Over time however, this tends to become a difficult task. Sort of like when over time our cupboards that have our books and games get cluttered and we need to organise them. The same happens to our disk!
Take a look at the image above and notice that File 3 is saved all over the disk, no contiguous blocks were available at the time of saving!
How will a human use a storage device?
In Chapter 14 we talk about a very important component in any computer system; the Operating System. Whenever we talk about storage devices it is very natural to talk about the OS because it is the component that gives us a way to easily use our storage devices and access our files.
You are probably really familiar with the view below. This is how the file system in Windows 10 looks like. If you are a Mac user the view in Finder is pretty similar.
The ingenious idea behind the file system is that files can be organised in a hierarchy as can be seen in the picture on the right. Individual files can be grouped inside folders, and a folder can contain folders. In computer science we call this form of organisation a tree. Every individual file has a unique path down the tree.
Comments