DS

3.3 Data Storage

Understanding primary storage (RAM and ROM), secondary storage (magnetic, optical, solid-state), virtual memory, and cloud storage.

Learning Objectives

By the end of this lesson, you will be able to:

  • Understand what is meant byprimary storage(RAM and ROM) and why a computer needs both
  • Understand what is meant bysecondary storage
  • Describe the operation ofmagnetic,opticalandsolid-state (flash memory)storage and give examples of each
  • Describe what is meant byvirtual memory, how it is created and used, and why it is necessary
  • Understand what is meant bycloud storage
  • Explain theadvantages and disadvantagesof storing data on the cloud in comparison to storing it locally

Key Terms

Primary Storage

Storage that is directly accessed by the CPU — includes RAM, ROM, registers and cache.

RAM (Random Access Memory)

Volatile read/write memory that holds programs and data currently in use by the CPU.

ROM (Read Only Memory)

Non-volatile read-only memory that holds the bootstrap/BIOS startup instructions.

Volatile

Contents are lost when the power is turned off (e.g. RAM).

Non-volatile

Contents are retained when the power is turned off (e.g. ROM, secondary storage).

DRAM (Dynamic RAM)

RAM that uses capacitors and needs constant refreshing. Used for main system memory.

SRAM (Static RAM)

Faster RAM that uses flip-flops and doesn't need refreshing. Used for cache memory.

Secondary Storage

Non-volatile storage not directly accessed by the CPU — holds programs and data permanently.

Magnetic Storage

Uses platters divided into tracks and sectors; data is read/written using electromagnets (e.g. HDD).

Optical Storage

Uses lasers to create and read pits and lands on a disc (e.g. CD, DVD, Blu-ray).

Solid-State Storage

Uses NAND or NOR technology with floating gate and control gate transistors. No moving parts (e.g. SSD, USB flash).

Virtual Memory

An extension of RAM located on secondary storage. Used when RAM is full — pages of data are transferred between RAM and virtual memory.

Cloud Storage

Long-term storage of data on remote servers, accessible via the internet.

Latency

The time it takes for a specific block of data on a data track to rotate around to the read-write head.

Platter

A circular magnetic surface inside a hard disk drive that stores data.

Track

A single circular area of a platter that works all the way around the surface. Tracks are concentric.

Sector

A specific portion of a platter which splits each track.

Floating Gate

Part of a solid-state transistor that can hold a charge (0 or 1). Retains charge due to a dielectric coating.

Control Gate

Top layer of a solid-state transistor that controls whether current can flow through the transistor.

Bootstrap

The startup instructions stored in ROM that a computer needs to begin the boot process.

BIOS

Basic Input Output System — stored in ROM, it initialises hardware during startup.

1. Primary Storage (RAM and ROM)

Primary storageis directly accessed by the CPU. It holds the data and instructions that the CPU needs to access while the computer is running. The CPU can access data from primary storage much faster than secondary storage.

RAM (Random Access Memory)

  • Holds programs and datacurrently in useby the CPU.
  • Volatile— contents are lost when the computer is powered off.
  • Read and write— data can be read from and written to.
  • Larger than ROM.
  • Access time is much faster than secondary storage.
  • When you run an application, data is retrieved from secondary storage and placed temporarily into RAM.

ROM (Read Only Memory)

  • Holdsstartup instructionsfor the computer, known as thebootstrap.
  • Contains theBIOS(Basic Input Output System).
  • Non-volatile— contents are retained when the computer is powered off.
  • Read-only— cannot be written to.
  • Smaller than RAM.
  • In embedded systems, programs may be stored in ROM.

Why a Computer Needs Both RAM and ROM

  • ROMstores the permanent instructions needed to start the computer (BIOS/bootstrap). Without ROM, the computer wouldn't know how to start up.
  • RAMprovides the temporary workspace for running programs. Without RAM, there would be no space to run programs efficiently.
  • RAM is volatile and can be written to, while ROM is non-volatile and read-only — they serve different purposes.

DRAM vs SRAM

DRAM (Dynamic RAM)SRAM (Static RAM)
Uses transistors and capacitorsUses flip-flops to hold each bit
Needs constant refreshingDoes not need refreshing
Less complex circuitryMore complex circuitry
Consumes more power (needs refreshing)Consumes less power
Less expensive to manufactureMore expensive to manufacture
Slower data access timeFaster data access time
Higher memory capacityLower memory capacity
Used in main system memoryUsed in processor cache memory

Real-Life Example: Remote-Controlled Toy Car

ROM
  • Stores the factory settings such as remote control frequencies
  • Stores the 'start-up' routines when the toy car is first switched on
  • Stores the set routines — how buttons control turning left, acceleration, stopping, etc.
RAM
  • The user may wish to program in their own routines; these new instructions would be stored in the RAM chip
  • The RAM chip stores the data/instructions received from the remote control

Activity 1: RAM and ROM

  1. Describe the purpose of the ROM in a computer. [2]
  2. Describe the purpose of the RAM in a computer. [2]
  3. Explain why a computer needs both RAM and ROM. [4]
Solution:
  1. ROM stores the start-up instructions / bootstrap [1]. It is used to start the computer / contains the BIOS [1].
  2. RAM stores the parts of the OS / programs that are running [1]. It stores data currently in use for access by the CPU [1].
  3. ROM stores the permanent instructions needed to start the computer [1]. RAM provides the temporary workspace for running programs [1]. Without ROM, the computer wouldn't know how to start up [1]. Without RAM, there would be no space to run programs efficiently [1].

Check Your Understanding: Primary Storage

  • [1]Storage that is directly accessed by the CPU
  • [1]Includes RAM, ROM, registers and cache
  • [1]Volatile memory loses its contents when the power is turned off (e.g. RAM)
  • [1]Non-volatile memory retains its contents when the power is turned off (e.g. ROM)
  • [1]Startup instructions / bootstrap / BIOS
  • [1]The instructions needed for a computer to start up once the power is switched on
  • [1]DRAM uses capacitors and needs constant refreshing
  • [1]SRAM uses flip-flops and does not need refreshing
  • [1]SRAM is faster but more expensive; DRAM is slower but cheaper
  • [1]DRAM is used for main memory; SRAM is used for cache memory
  • [1]Current channel being watched / current video being streamed
  • [1]Web browser / applications that are running / data being downloaded or buffered
  • [1]RAM stores user settings (time, weight, defrost settings)
  • [1]RAM stores temporary data such as the current time remaining
  • [1]ROM stores the microwave wavelength / pre-programmed cooking times
  • [1]ROM stores safety systems / the control program

2. Secondary Storage

Secondary storageis non-volatile storage that is not directly accessed by the CPU. It is used for the permanent storage of programs and data that are currently not in use. Secondary storage is needed because ROM is read-only and RAM is volatile.

Magnetic Storage

Uses platters divided into tracks and sectors. Data is read/written using electromagnets.

Examples:Hard Disk Drive (HDD), magnetic tape

Optical Storage

Uses lasers to create and read pits and lands on a disc.

Examples:CD, DVD, Blu-ray

Solid-State Storage

Uses NAND or NOR technology. Floating gate and control gate transistors store data.

Examples:SSD, USB flash drive, memory card

Magnetic Storage: Hard Disk Drive (HDD)

  • A magnetic hard disk is made up of several metal discs coated with a magnetic material — these are calledplatters.
  • Iron particles on each platter are magnetised to represent a 0 or 1.
  • Each platter is divided by concentric circles creating severaltracksand wedge-shapedsectors.
  • Where they intersect is atrack sector.
  • The hard drive spins the metal disk(s) at a high speed (typically 5400–7200 RPM) using a motor.
  • A read/write arm, controlled by an actuator, moves the head over the surface of the disc to the location of the data.
  • The data is read/written usingelectromagnets.
Advantages of HDDDisadvantages of HDD
High storage capacityMoving parts can get damaged if dropped
Low cost per gigabyteHeavy & bulky making them less convenient for transport
Relatively fast write speedProne to mechanical failure
Loud (spinning disks)

Latency and Fragmentation

  • Latencyis the time it takes for a specific block of data on a data track to rotate around to the read-write head.
  • When data is stored on HDD, the sectors allocated may not be adjacent to each other — this is calledfragmentation.
  • Over time, HDD performance deteriorates due to fragmentation — it takes longer and longer to access data.
  • Defragmentation softwarecan improve this by 'tidying up' the disk sectors.

Solid-State Storage (Flash Memory)

  • Solid-state storage usesNAND or NOR technologyand has no moving parts.
  • Data is stored by controlling the movement of electrons within NAND or NOR chips.
  • Data is stored as 0s and 1s in millions of tiny transistors.
  • Each cell contains a transistor that acts as a switch.
  • The transistor contains acontrol gateand afloating gate.
  • Adielectric coatingseparates the two gates, allowing the floating gate to retain its charge.
  • The floating gate has a value of 1 when charged and 0 when not charged.
  • To program a cell, a voltage is applied to the control gate and electrons are trapped in the floating gate.
Advantages of SSDDisadvantages of SSD
More reliable (no moving parts)More expensive per gigabyte
Very fast read/write accessLess storage capacity
Faster start up time (no latency)Limited number of read/write cycles (SSD endurance)
Less noise / lower power consumption / runs cooler
Smaller and more portable

Optical Storage: CD, DVD and Blu-ray

  • Optical storage useslasersto burn the surface of a disk, creatingpitsandlandssuitable for storing binary 0s and 1s.
  • All optical devices work by shining a laser at the disk and processing the reflection.
  • In CD-Rs, a laser burns the data permanently onto the disk, by creating pits and lands.
  • When the laser light hits the point where the pit changes into a land (or vice versa), the light scatters and is not reflected back as well.
  • This is captured by a sensor and can be interpreted as a change in the binary value.
Disk TypeLaser ColourWavelengthCapacity (Single Layer)
CDRed780 nm~700 MB
DVDRed650 nm4.7 GB
Blu-rayBlue405 nm25 GB

Why Blu-ray Stores More Data

  • Blu-ray uses a blue laser with a shorter wavelength (405 nm) compared to DVD's red laser (650 nm).
  • The shorter wavelength allows much smaller pits and lands to be created.
  • This means more data can be stored on the same surface area — up to 5 times more than a DVD.
  • Blu-ray also uses a single 1.1 mm thick polycarbonate disk, while DVDs use a sandwich of two 0.6 mm thick disks.

Activity 2: Secondary Storage

  1. Describe how data is stored on a magnetic hard disk drive. [4]
  2. Explain the difference between magnetic, optical and solid-state storage. [6]
  3. Explain two differences between a DVD and a Blu-ray. [4]
Solution:
  1. Data is stored in a digital format on magnetic surfaces of platters [1]. Bits are arranged in concentric circular paths called tracks [1]. Each track is broken into smaller areas called sectors [1]. Read-write heads access the surfaces, attached to actuator arms [1].
  2. Magnetic:Uses platters and electromagnets to read/write data (e.g. HDD) [1].Optical:Uses lasers to create and read pits and lands on a disc (e.g. CD/DVD) [1].Solid-state:Uses NAND/NOR chips with floating gate and control gate transistors — no moving parts [1]. Magnetic has high capacity but slow access [1]. Optical has low capacity and slow access [1]. Solid-state has fast access and is durable but more expensive [1].
  3. DVD uses a red laser whereas Blu-ray uses a blue/violet laser [1]. DVD has a smaller storage capacity; Blu-ray has a larger capacity [1]. DVD uses two layers of polycarbonate whereas Blu-ray uses a single 1.1 mm layer [1]. Blu-ray has a faster data transfer rate [1].

Check Your Understanding: Secondary Storage

  • [1]Non-volatile storage that is not directly accessed by the CPU
  • [1]Used for permanent storage of programs and data when the computer is turned off
  • [1]A laser is shone at the tracks of the disk
  • [1]The laser reflects from the track and directs the reflected light into a sensor
  • [1]The intensity of the reflected light determines whether it is interpreted as a 1 or a 0
  • [1]If the laser hits a pit, the light does not reach the sensor (recorded as 1); if it hits a land, it reflects (recorded as 0)
  • [1]Faster access / read/write speeds
  • [1]Smaller in physical size / lighter
  • [1]More durable / no moving parts / lower power consumption
  • [1]Uses NAND or NOR technology with millions of tiny transistors
  • [1]Each transistor has a control gate and a floating gate
  • [1]A dielectric coating allows the floating gate to retain its charge
  • [1]Floating gate = 1 when charged; 0 when not charged
  • [1]Latency is the time it takes for a specific block of data on a data track to rotate around to the read-write head
  • [1]It slows down access to data on an HDD
  • [1]CD
  • [1]DVD
  • [1]Blu-ray

3. Virtual Memory

Virtual memoryis an extension of primary storage (RAM) located on secondary storage. It is used when RAM is close to being full, allowing the computer to remain operational.

RAM
Virtual Memory

How Virtual Memory Works

  1. The computer is turned on and the elements of the operating system are loaded into RAM.
  2. The user opens some software (e.g. spreadsheet and video editing software) but RAM becomes full.
  3. The program not currently being used (e.g. video editing) is transferred tovirtual memory.
  4. When the user wants to use the video editing software again, it is transferred back from virtual memory to RAM.
  5. Programs are stored aspagesof data and are transferred between RAM and virtual memory when needed.

Important Notes

  • Virtual memory ismuch slowerthan RAM and its use will impact negatively on system performance.
  • Virtual memory doesnot increasethe actual size of RAM — it creates temporary space on secondary storage.
  • It makes the systemusable, not faster.
  • To avoid the use of virtual memory, increase the size of the RAM.

Activity 3: Virtual Memory

  1. A computer only has 4GB of RAM. Explain how virtual memory can compensate for the lack of RAM. [3]
  2. Explain why it would be beneficial to get more RAM instead of relying on virtual memory. [2]
Solution:
  1. Virtual memory is used when RAM is full [1]. Part of the secondary storage is used as temporary RAM [1]. Data from RAM is moved to virtual memory to make space in RAM [1]. When data in virtual memory is needed, it is moved back to RAM [1].
  2. More RAM will improve the performance of the computer / speed up access to data [1]. Virtual memory is slower to access than RAM because data has to go back to RAM first / moving data between RAM and VM takes processor time [1].

Check Your Understanding: Virtual Memory

  • [1]An extension of primary storage (RAM) located on secondary storage
  • [1]Used when RAM is close to being full, so the computer remains operational
  • [1]When there is not enough physical RAM to store the open programs
  • [1]Virtual memory is much slower than RAM
  • [1]Its use will impact negatively on system performance
  • [1]Programs are stored as pages of data which are transferred between RAM and virtual memory when needed
  • [1]No — it creates temporary space on secondary storage. It makes the system usable, not faster.
  • [1]Increase the size of the RAM

4. Cloud Storage

Cloud storageis a term to describe long-term (secondary) storage of data that resides in a remote location, accessible only via a wide area network (Internet). Data is stored on remote servers, typically using magnetic storage (HDD), but increasingly using solid state (SSD).

Advantages of Cloud Storage

  • Accessibility:Data can be accessed at any time from any device anywhere in the world, provided internet access is available.
  • Scalability:Cloud storage providers allow customers to increase or decrease their storage capacity as needed.
  • Reliability:Providers often use multiple servers to store and backup data, reducing the risk of data loss due to hardware failure.
  • Collaboration:Multiple people can access the same file at the same time.
  • No physical transfer needed:Data can easily be shared without a USB drive or other physical device.

Disadvantages of Cloud Storage

  • Internet dependency:If the user has a slow or unstable internet connection, they would have problems accessing or downloading their data.
  • Cost:Can be expensive if large storage capacity is required; may need to pay for high download/upload data transfer limits.
  • Security:Data being sent over the internet has the potential to be intercepted. Security is managed by the provider, but the user is still legally responsible.
  • Provider failure:The potential failure of the cloud storage company is always possible — this poses a risk of loss of all back-up data.

Cloud Storage Data Warehouse

Remember, although this type of storage is thought of as virtual, your data actually resides on some kind of physical, permanent storage media in a remote location. Cloud storage warehouses often have thousands of servers containing hard drives.

Activity 4: Cloud Storage

A school currently stores all of their data on local servers. They are considering upgrading their system to utilise cloud storage.

  1. Explain two disadvantages to the school of storing their data in the cloud. [4]
  2. Explain two advantages to the school of storing their data in the cloud. [4]
Solution:
  1. Any two from: [4]
    • You need a constant internet connection — if the internet connection failed, teachers would not be able to access lesson files/student data
    • Reliant on third party to carry out security procedures, but the school is still legally responsible if data is accessed by unauthorised people
    • Data stored on the cloud could be hacked or intercepted
    • Ongoing subscription costs
  2. Any two from: [4]
    • Additional storage can be purchased if needed
    • The cloud hosting company provides back up
    • The cloud hosting company provides security
    • Data can be accessed from anywhere and from any device provided there is an internet connection — teachers and students can access work from home

Check Your Understanding: Cloud Storage

  • [1]Long-term (secondary) storage of data that resides in a remote location
  • [1]Accessible via a wide area network (Internet)
  • [1]Data can be accessed at any time from any device, provided internet access is available
  • [1]Data can easily be shared without physical transfer / easy collaboration with shared documents
  • [1]Can be expensive if large storage capacity is required
  • [1]Slow to access if connectivity is poor / no internet connection means no access
  • [1]On physical storage media (e.g. hard drives) in a remote location
  • [1]Cloud storage warehouses often have thousands of servers
  • [1]Local storage is directly accessible without an internet connection; cloud storage requires internet access
  • [1]Local storage is a one-off purchase; cloud storage is often a subscription
  • [1]Cloud storage can be accessed from any device; local storage is device-specific
  • [1]Cloud storage offers easier collaboration and automatic backups; local storage requires manual backup
  • [1]Data sent over the internet has the potential to be intercepted
  • [1]Security is managed by the cloud provider, but the business is still legally responsible for ensuring data is secure

Key Takeaways

  • Primary storageis directly accessed by the CPU — includes RAM, ROM, registers and cache.
  • RAMis volatile, read/write memory that holds programs and data currently in use.
  • ROMis non-volatile, read-only memory that holds the bootstrap/BIOS startup instructions.
  • DRAMuses capacitors and needs refreshing;SRAMuses flip-flops and is faster but more expensive.
  • Secondary storageis non-volatile storage not directly accessed by the CPU — used for permanent storage.
  • Magnetic storage(HDD) uses platters divided into tracks and sectors, read/written by electromagnets.
  • Optical storage(CD/DVD/Blu-ray) uses lasers to create and read pits and lands.
  • Solid-state storage(SSD, USB flash) uses NAND/NOR technology with floating gate and control gate transistors — no moving parts.
  • Virtual memoryis an extension of RAM on secondary storage — used when RAM is full. It is slower than RAM.
  • Cloud storageis long-term storage on remote servers accessed via the internet.
  • Cloud storage advantages: accessibility, scalability, reliability, collaboration. Disadvantages: internet dependency, cost, security concerns.
  • Blu-ray uses a blue laser (405 nm) compared to DVD's red laser (650 nm), allowing smaller pits and higher capacity.
  • SSDs have no moving parts, so they are faster, more durable, quieter and more energy-efficient than HDDs.

Question Bank

  • [1]RAM is volatile / ROM is non-volatile
  • [1]RAM loses its contents when power is lost / ROM retains its contents
  • [1]RAM can be read from and written to / ROM is read-only
  • [1]RAM stores data/programs currently in use / ROM stores the BIOS/startup instructions
  • [1]A laser is shone at the tracks of the disk
  • [1]The laser reflects from the track and directs the reflected light into a sensor
  • [1]The intensity of the reflected light determines whether it is interpreted as a 1 or a 0
  • [1]If the laser hits a pit, the light does not reach the sensor (1); if it hits a land, it reflects (0)
  • Secondary storage [2]:Non-volatile storage not directly accessed by the CPU [1]. Used for permanent storage of programs and data when the computer is turned off [1].
  • Off-line storage [2]:Any data storage device that can hold data and is not permanently connected to a computer [1]. Used for backing up data / transporting data between devices [1].
  • [1]A laser is used to burn the data onto the disk
  • [1]The laser creates pits and lands in the surface of the disk
  • [1]Pits and lands represent binary 0s and 1s
  • [1]The data is stored on a single spiral track running from the centre to the edge
  • [1]Solid state
  • [1]No moving parts so it is durable / not affected by movement of the drone
  • [1]Fast read/write speeds / lightweight / low power consumption
  • [1]DVD uses a red laser whereas Blu-ray uses a blue/violet laser
  • [1]Blu-ray has a larger storage capacity than DVD
  • [1]DVD has two layers of polycarbonate whereas Blu-ray uses a single 1.1 mm layer
  • [1]Blu-ray has a faster data transfer rate than DVD
  • [1]Virtual memory is an extension of primary storage (RAM) located on secondary storage
  • [1]It is used when RAM is close to being full
  • [1]Programs and data not currently being executed are transferred to virtual memory
  • [1]They are transferred back to RAM when needed / this keeps the computer operational
  • [1]Faster access/read/write speeds
  • [1]Smaller in physical size / more durable (no moving parts)
  • [1]Lower power consumption / runs cooler / quieter
  • [1]More expensive per gigabyte
  • [1]Smaller capacity / limited number of read/write cycles
  • Primary [2]:Storage directly accessed by the CPU [1]. Example: RAM / ROM [1].
  • Secondary [2]:Non-volatile storage not directly accessed by the CPU [1]. Example: HDD / SSD [1].
  • Off-line [2]:Storage not permanently connected to a computer [1]. Example: USB flash drive / DVD [1].
  • Stores the programs and data that are currently in use →RAM
  • Used to boot up the computer when power is turned on →ROM
  • Contents are retained when power is turned off →ROM
  • [1]Data is stored in a digital format on magnetic surfaces of platters
  • [1]Bits are arranged in concentric circular paths called tracks
  • [1]Each track is broken into smaller areas called sectors
  • [1]Read-write heads access the surfaces, attached to actuator arms / data is read/written using electromagnets
  • [1]Both use a red laser to read/write data
  • [1]Both store data in pits and lands on a single spiral track
  • [1]Both are optical storage media / both have the same physical dimensions
  • [1]You need a constant internet connection
  • [1]If the internet connection failed, teachers would not be able to access lesson files / student data
  • [1]Reliant on third party to carry out security procedures
  • [1]But the school is still legally responsible if data is accessed by unauthorised people
  • [1]Additional storage can be purchased if needed
  • [1]The cloud hosting company provides back up
  • [1]Data can be accessed from anywhere and from any device provided there is an internet connection
  • [1]So teachers/students would be able to access work from home