
总结:
- 存储持久性:硬盘用于持久存储数据,即使断电也不会丢失;RAM和cache在断电后不能保持数据。
- 存储容量:硬盘的容量以TB计,RAM以GB计,cache以MB计。
- 访问速度:硬盘访问速度最慢,以毫秒(ms 10^-3)计;RAM访问速度较快,以微秒(us 10^-6)计;cache访问速度最快,以纳秒(ns 10^-9)计。
- 数据优化:为提高效率,常用数据从RAM存入cache。
- 一致性考虑:管理RAM和cache时需注意数据一致性,特别是在系统崩溃或重启时,确保数据可以从硬盘恢复。
- 性能提升限制:虽然晶体管数量增加,但处理器效能提升已趋缓,显示出分布式系统处理大规模任务的重要性。
Disk (Hard Disk Drive / SSDs(faster))
- Function: Stores data persistently, ensuring that data remains available even after a computer restarts or crashes.
- Capacity: Typically measured in gigabytes (GB) or terabytes (TB).
- Speed: Slower compared to RAM, with read and write operations measured in milliseconds($ms$). Hard disks (HDDs) use rotating disks to read and write data, which makes them slower than SSDs that use flash memory.
Random Access Memory (RAM)
- Function: Temporarily stores data and the information needed for running programs.
- Capacity: Much smaller than disk, ranging from a few gigabytes (GB) to tens of gigabytes.
- Content: RAM holds both the executable code and the data used by running programs. Code is stored as compiled instructions that the CPU can execute, while data can include variables and temporary files needed by these programs.

- Speed: Much faster than hard disks, with read and write speeds measured in microseconds($\mu s$).
Central Processing Unit (CPU)