Source
Random-access memory
RAM device and key properties of RAM.
Random access memory (RAM) is a fast but volatile storage layer that the processor needs to work with active data. Permanent storage (HDD/SSD) is much slower, but retains data between restarts.
RAM vs persistent storage
How RAM works
- DRAM is organized into matrices of cells (rows and columns) addressed by the memory controller
- Access by address is random access, but access within one row is faster due to the row buffer
- Memory requires periodic refresh, so there are background delays
- The CPU works through L1/L2/L3 caches, hiding some of the RAM latency
How does permanent storage work?
- Storage devices operate as block devices: reading/writing occurs in pages and blocks
- HDD adds mechanical seek, SSD works with NAND pages and block erase
- Performance depends on I/O queues, concurrency and block size
- File systems and DBMSs build their structures and logs on top of this
RAM
- Volatile: Data disappears when power is removed
- Very low access latency
- High read/write speed
- Relatively high price per GB
Persistent storage
- Persistent: Data is saved without power
- Noticeably higher access latency
- Capacity is orders of magnitude greater
- Lower cost per GB
Order of access delays (approximately)
RAM
tens of nanosecondsSSD
hundreds of microsecondsHDD
millisecondsRAM is orders of magnitude faster than persistent storage, so hot data and indexes are kept in memory.
Source
Hard disk drive
Mechanical disk and its features.
HDD vs SSD
Many DBMSs behave differently on HDDs and SSDs: random operations are expensive on HDDs, so sequential access, batching, and large pages are more valued. SSD tolerates random I/O noticeably better and allows for parallelism and high IOPS.
HDD
- Mechanical components and rotating discs
- High latency due to seek time
- Large capacity and low price
- Good for large archives
SSD
- Flash memory with no moving parts
- Low latency and high IOPS
- Better for random access
- Limited recording resource
Source
Solid-state drive
SSD, flash memory and performance characteristics.
Why is this important for System Design?
- RAM determines latency for hot data, persistent storage determines capacity and durability.
- The difference between HDD and SSD affects the choice of databases, caching and IOPS requirements.
- Understanding the memory hierarchy helps design caches, buffers, and recovery strategies.
For system design, it is important to be able to answer: what data should live in RAM, what on SSD, where HDD is acceptable and how this affects cost and speed.
