Storage in the computer: Punched cards to the cloud storage
Next Topic(s):
Created:
31st of July 2025
01:39:01 PM
Modified:
1st of August 2025
09:32:14 AM
Primary and Secondary Memory
Computers organise storage into two categories: Primary Memory (main memory) and Secondary Memory (persistent storage). Primary Memory—Random Access Memory (RAM)—holds data the CPU uses right now. Secondary Memory keeps data long-term, even when power is off.
RAM: Transient Storage
• RAM stores running programmes and their data in addressable cells. Each memory address maps to one byte (or more) that the CPU can read or write in any order—hence “random access.”
• Volatile: contents vanish when power is lost, so RAM is ideal only for temporary working space.
Persistent Storage
• To keep files, databases and system software across reboots, we use Secondary Memory devices: hard disk drives (HDD), solid-state drives (SSD), optical discs, tapes or cloud stores.
• These devices use different technologies—magnetic, flash (NAND), optical—and trade off speed, capacity and durability.
File System Addressing
Operating systems organise Secondary Memory into file systems that map file names to physical locations. Early schemes like File Allocation Table (FAT) required contiguous free blocks and tracked each cluster in a table. Modern file systems (ext4, NTFS, APFS) use extents—ranges of blocks—to reduce fragmentation.
• Contiguous allocation simplifies read/write pointers but struggles when disk fills up—large files need large free spans.
• Linked allocation uses pointers in each block to the next, avoiding large free spans but adding overhead per block.
• Extent-based groups many blocks into one descriptor, balancing speed and flexibility.
Tip: Early FAT limits meant maximum disk sizes of 2 GB (FAT16). FAT32 extended this to 2 TB; exFAT and NTFS removed the barrier altogether.
Storage Area Networks (SAN)
Storage Area Network (SAN) provides block-level networked storage using Fibre Channel or iSCSI. SANs let multiple servers share high-speed access to large disk arrays, essential for big data and virtualisation.
• Benefits: centralized management, fast failover, and high throughput.
• Challenges: complexity of setup, zoning, and ensuring consistent file locks across hosts.
File Locking and Concurrency
When multiple processes or machines access the same file, file locks prevent corruption:
- Advisory locks (POSIX flock): processes agree to respect locks but OS doesn’t enforce.
- Mandatory locks (some Windows shares): enforced by the OS kernel.
Proper locks ensure databases or shared documents remain consistent when many users read and write concurrently.
Tip: In clustered file systems (GFS2, OCFS2), distributed locking services coordinate access across nodes to avoid conflicts.
Why It Matters
Even without writing code, understanding how storage works helps you choose the right device for your needs—whether you archive family photos on SSDs, avoid tape backups for daily work, or appreciate why a database performs faster on SAN than on local USB drives.
Cloud Storage
Cloud Storage offers virtually unlimited capacity over the internet. Providers expose an Application Programming Interface (API) that handles data placement, replication, versioning and integrity checks. You simply read and write objects or blocks, while the service manages the underlying hardware and distribution.
In the next section (“Block Diagram of the Computer”), we’ll see how CPU addresses travel via serial and parallel buses to storage controllers, which translate them into tracks, sectors or flash pages—tying together all these memory and storage concepts.