DEV Community

Backend Beginner
Backend Beginner

Posted on • Edited on

Types of Computer Memory and Storage

Types of Memory and Storage Explained

Diagram showing types of computer memory and storage including SRAM, DRAM, ROM, HDD, SSD, and NVMe with volatile vs non-volatile classification

RAM (Random Access Memory) is the main working memory of a computer. It is volatile, meaning it loses all data when the power is turned off.

RAM is divided into two main categories:

1. SRAM (Static Random Access Memory)

  • Extremely fast and does not require refreshing
  • More expensive and consumes more power
  • Primarily used in CPU Cache (L1, L2, and L3) and registers
  • Ideal when ultra-quick access is critical

What is Cache Memory?
Cache Memory is a small, extremely fast memory located very close to the CPU. Its main job is to store frequently used data and instructions so the CPU can access them almost instantly.

Why Do We Need Cache?
The CPU is much faster than main RAM (DRAM). This speed difference creates a problem called the Memory Wall. Cache helps solve this by keeping the most-used data ready for the CPU.

Cache Hierarchy
Modern CPUs use a multi-level cache system:

  • L1 Cache: Smallest and fastest (per core)
  • L2 Cache: Medium size and speed
  • L3 Cache: Largest, shared among all cores
  • Speed Order: L1 > L2 > L3 >> DRAM

Key Points

  • Cache is built using SRAM (very fast but expensive)
  • It is automatically managed by the CPU
  • Cache Hit = Data found in cache → Super fast
  • Cache Miss = Data not found → CPU fetches from slower RAM

This cache system is one of the biggest reasons modern computers feel fast.

2. DRAM (Dynamic Random Access Memory)

  • Slower than SRAM
  • Requires constant refreshing to retain data
  • Much cheaper and offers higher capacity
  • Used as the main system memory in PCs, laptops, and servers

Modern versions of DRAM (as of 2026):

  • DDR5 — The current standard for system RAM. Offers higher speed, better power efficiency, and improved data transfer rates.
  • GDDR6 / GDDR7 — Specialized high-bandwidth memory used in GPUs and AI accelerators for massive parallel processing.

While volatile memory like RAM provides the speed needed for active computing, computers also need memory that can retain data even when powered off. This brings us to Non-Volatile Memory.

Non-Volatile Memory

Unlike RAM, Non-Volatile Memory retains data even when the power is turned off. It is mainly used for storing permanent instructions and boot information.

Common types include:

  • ROM / Firmware (BIOS/UEFI) — Stores critical boot instructions and hardware initialization code.
  • Flash Memory / EEPROM — Electrically erasable and rewritable memory. This is the foundation of modern SSDs and USB drives.

Once we move beyond primary memory (RAM and ROM), we need a different category for long-term data storage. This is where Secondary Storage comes in.

Secondary Storage

Storage is used for long-term data retention — your operating system, applications, files, and large datasets. Here are the most common types in 2026:

  • HDD (Hard Disk Drive): Offers very high capacity but slower access speeds. Still used for bulk and archival storage.
  • SSD (Solid State Drive): Flash-based storage that is significantly faster and more reliable than HDDs. The standard choice for everyday use.
  • NVMe SSD: The current high-performance standard for fast storage.

What are PCIe Lanes?

PCIe lanes are high-speed data highways that connect components like NVMe SSDs and GPUs directly to the CPU or chipset.

Most consumer NVMe SSDs use 4 PCIe lanes (called PCIe x4). The more lanes a device uses, the higher the bandwidth and the lower the latency it can achieve.

This direct connection allows NVMe SSDs to deliver extremely high read/write speeds — often 7,000–14,000+ MB/s in 2026 with PCIe Gen5.

CXL Memory (Compute Express Link)

As AI and data-intensive applications continue to grow, even fast NVMe storage and large amounts of DRAM are sometimes not enough. This is where CXL (Compute Express Link) comes into play.

CXL is a modern high-speed interconnect technology built on top of the PCIe interface. It allows the CPU to access additional memory attached to other devices (such as memory expanders or GPUs) as if it were local RAM, while maintaining full cache coherency.

Why CXL is becoming important in 2026:

  • Traditional DDR5 has limited capacity per CPU socket.
  • AI models require massive amounts of memory.
  • CXL enables memory expansion and memory pooling — multiple servers can efficiently share a large pool of memory.

This results in near-DRAM performance with much higher total memory capacity, making it especially valuable for large-scale AI training and inference.


PS

  1. Power ON → ROM (BIOS/UEFI) starts first. (ROM is a small chip on the motherboard that contains basic boot instructions.)

  2. ROM performs basic hardware checks (POST) and tells the system to load the OS from the SSD (Flash Storage).

  3. The OS files are copied from the SSD into DRAM (Main RAM).

  4. CPU (Processor) starts executing the OS. → It uses data and instructions from DRAM (RAM) and its own internal SRAM Cache (L1, L2, L3) for speed.

  5. The SSD remains connected through PCIe lanes so the CPU can quickly read/write data whenever needed.

Top comments (0)