Computer scientists delineate between two classes of storage for data, primary and secondary. Both types of storage are necessary for the operation of a computer. You will find them represented in various forms in modern computers.
Random access memory (RAM) is the main form of primary storage. The computer processor uses this RAM to hold code, perform computations and manage the operation of the machine because it is the fastest form of storing bytes of information. It is volatile, however, which means when the computer is turned off everything in RAM is deleted. Other types of primary storage include the processor cache and, for nonintegrated graphics cards, the on-board memory that serves the graphics processing unit (GPU).
The disk drives in the computer are the most common form of secondary storage. The disk drive is nonvolatile and retains the information written to it after the power is turned off to the computer. Because it is a mechanical device, the disk drive is much slower than primary storage devices. All nonvolatile storage devices fall into the secondary storage class, including optical and tape drives.
Primary storage usually has a higher cost than secondary storage. The cost difference limits the amount of primary storage versus secondary storage. Primary storage has faster access to the processor due to its proximity. Secondary storage must transfer its data over a longer distance and through other channels before it can reach the processor.