Each class of storage device is used to store files and data but they are accessed in different ways by the computer's CPU. Here's a brief explanation of the differences.
Primary Computer Storage Devices
Primary storage refers to the computer's memory, which connects directly to the computer's CPU. The computer's memory evolved into what is now known as random access memory (RAM) which is a volatile form of storage. Volatile storage means that you totally lose data when you switch the system off.
Aside from the RAM, two other primary storage areas can be found; these are on the CPU itself; the Processor registers and the Processor cache. The Processor register is some form of small storage which resides on the CPU and can contain data which can be accessed quickly. The processor registers are measured by the amount of data the can hold, that is either, 8 bit, 32 bit or 64 bit.
Processor cache on the other hand is used by the CPU for reducing the time it takes to access the main memory. It stores data coming from the most frequently used applications of the CPU. During normal operations, the CPU checks the processor cache before checking the main memory, making the processing time faster.
Secondary Computer Storage Devices
These storage devices are external in nature and non-volatile as compared to primary storage devices. Secondary storage devices do not lose data even when they are turned off. Hence, they are the ideal back-up and data storage devices.
Examples of secondary storage devices include; CD and DVD; flash memory; floppy disks; paper and magnetic tape; RAM disks, also called SSDs; ZIP drives; and punch cards. Since secondary storage devices are not attached to the computer's CPU, it takes a longer time for the CPU to access them. Secondary storage devices need to be formatted before they can store data. Secondary storage devices are formatted based on a filesystem format data are organized into files and directories. It also includes other pertinent information about the data, which is described in what is called the metadata.
Tertiary Computer Storage Devices
This type of computer storage device is not as popular as the other two storage device types. Its main use is for storing data at a very large-scale. This includes optical jukeboxes and tape libraries. Tertiary storage devices require a database to organize the data that are stored in them, and the computer needs to go through the database to access those data.
Aside from these three types of computer storage devices, there is also another type - offline or disconnected storage. It is not directly connected to the computer and is used as a transfer medium only. Offline storage devices are remotely located and accessed as per need only. This storage device also needs human intervention to be read properly by the main computer system.
Offline storage aside, from its use as a data transmission medium, can also serve as a good back-up device since it is remotely located, hence it will not be affected by any disaster that might hit the direct source of data. Offline storage also provides good security for data since you can't easily access it from a computer system.