Computer and Information TechnologyUnit 311 min read
Memory & Storage: Types, Hierarchy & Data Management
Unit 3 of Computer and Information Technology explores primary (RAM, ROM) and secondary storage (HDD, SSD, cloud), memory hierarchy, data representation (binary/hexadecimal), and real-world applications in tourism systems (e.g., reservation databases, payment gateways). Covers how storage devices work, their speeds, ca
TAKEAWAYS:
- Memory hierarchy (CPU registers → cache → RAM → SSD → HDD → cloud) balances speed, cost, and capacity using a 6-layer pyramid (visualized below).
- Volatile vs. non-volatile storage: RAM loses data on power-off; HDD/SSD retain data permanently (critical for tourism booking systems like eSewa or Daraz).
- Data representation: Binary (0/1) and hexadecimal (0-F) encode text, numbers, and commands (e.g., a hotel room booking ID
A1B2=10100001 00011010 10110010 00100010in binary). - Storage devices: HDDs use magnetic platters (slow, cheap); SSDs use NAND flash (fast, expensive); cloud storage (e.g., Google Drive) distributes data across servers.
- Fragmentation: Over time, files split into non-contiguous clusters, slowing access (fix with de-fragmentation tools like Windows Disk Defragmenter).
- Backup strategies: RAID (Redundant Array of Independent Disks) mirrors data for reliability (used by banks like Nabil Bank for transaction logs).
1. Memory Hierarchy: The Speed-Cost-Capacity Trade-off
Computers use a multi-layered memory system to balance speed, cost, and storage capacity. The closer the memory is to the CPU, the faster but more expensive it is. Here’s the hierarchy with real-world analogies:
Why this matters for tourism?
- Primary memory (RAM): Stores active data like a hotel reservation system’s live bookings (e.g., Yatra.com or Nepal Tourism Board’s website). If RAM fills up, the system slows down or crashes.
- Secondary storage (HDD/SSD): Holds historical booking data, customer profiles, and payment records (e.g., Khalti’s transaction logs).
- Cloud storage: Used by global platforms like Booking.com to store petabytes of data across servers worldwide.
Worked Example: eSewa Payment Gateway When you book a flight on Yatra.com and pay via eSewa, the process involves:
- CPU registers/cache: Temporarily hold your card details during encryption.
- RAM: Stores the transaction in progress (e.g.,
User_ID: 12345, Amount: NPR 5000, Status: Pending). - SSD: Saves the transaction permanently in eSewa’s database.
- Cloud backup: A copy is stored in AWS or Google Cloud for disaster recovery.
2. Primary Memory: RAM and ROM
Primary memory is directly accessible by the CPU and is divided into two types:
A. RAM (Random Access Memory)
- Volatile: Loses data when power is off.
- Types:
- DRAM (Dynamic RAM): Cheaper, slower (used in desktops).
- SRAM (Static RAM): Faster, expensive (used in CPU cache).
- Capacity: Measured in GB (e.g., 8GB RAM).
- Speed: Accesses data in nanoseconds (ns).
Real Picture of RAM:
Why RAM is critical for tourism software?
- Example: A travel agency’s GDS (Global Distribution System) like Amadeus or Sabre uses RAM to process real-time flight/hotel searches. If RAM is insufficient, searches slow down, losing customers.
B. ROM (Read-Only Memory)
- Non-volatile: Retains data even when powered off.
- Types:
- PROM: Programmable once.
- EPROM/EEPROM: Erasable and reusable.
- Flash Memory: Used in USB drives and SSDs.
- Use in tourism: Stores firmware for POS machines (e.g., Khalti’s payment terminals) or BIOS in airport check-in kiosks.
Comparison Table: RAM vs. ROM
| Feature | RAM | ROM |
|---|---|---|
| Volatility | Volatile (loses data) | Non-volatile (retains data) |
| Speed | Faster (ns access) | Slower (ms access) |
| Cost | Expensive per GB | Cheaper |
| Usage | Temporary data (e.g., live bookings) | Permanent data (e.g., BIOS) |
3. Secondary Storage: HDD vs. SSD vs. Cloud
Secondary storage permanently holds data even when the computer is off. Key devices:
A. HDD (Hard Disk Drive)
- How it works:
- Uses magnetic platters and a read/write head to store data.
- Slower (50–150 MB/s) but cheaper (e.g., $0.03/GB).
- Used in:
- Older servers (e.g., NTC’s legacy billing systems).
- Backup drives (e.g., Nepal Rastra Bank’s audit logs).
Real Picture of HDD:
B. SSD (Solid State Drive)
- How it works:
- Uses NAND flash memory (no moving parts).
- Faster (300–3500 MB/s) but expensive (e.g., $0.10/GB).
- Used in:
- Laptops for travel agents (e.g., MacBook Air).
- High-speed databases (e.g., Nepal Stock Exchange’s trading system).
Worked Example: NEPSE Trading System
- HDD: Too slow for real-time stock price updates.
- SSD: Used to store live trading data and execute orders in milliseconds (critical for high-frequency trading).
C. Cloud Storage
- How it works:
- Data is stored on remote servers (e.g., Google Cloud, AWS).
- Accessed via internet (latency depends on connection speed).
- Used in:
- Global travel platforms (e.g., Booking.com, Expedia).
- Nepali companies (e.g., Daraz’s inventory management).
Comparison Table: HDD vs. SSD vs. Cloud
| Feature | HDD | SSD | Cloud Storage |
|---|---|---|---|
| Speed | Slow (50–150 MB/s) | Fast (300–3500 MB/s) | Medium (depends on latency) |
| Cost | Cheap ($0.03/GB) | Expensive ($0.10/GB) | Pay-as-you-go (e.g., $0.02/GB/month) |
| Durability | Prone to failure (moving parts) | No moving parts (more reliable) | Depends on provider (e.g., AWS SLA) |
| Use Case | Backups, archival data | OS, apps, fast databases | Scalable storage (e.g., customer reviews for TripAdvisor) |
4. Data Representation: Binary and Hexadecimal
Computers store all data in binary (0s and 1s). For humans, hexadecimal (0-F) is used for compact representation.
A. Binary Numbers
- Example: The number
5is0101in binary. - Text storage: Uses ASCII or Unicode (e.g.,
A = 65in decimal =01000001in binary).
Worked Example: Hotel Room Booking ID
- Suppose a hotel assigns room IDs as
A1B2. - Binary representation:
A=101000011=00000001B=101100102=00000010
- Combined:
10100001 00000001 10110010 00000010
B. Hexadecimal Numbers
- Base-16 system (0–9, A–F).
- Example:
A1B2in hex =10100001 00000001 10110010 00000010in binary.
Why hexadecimal?
- Used in memory addresses (e.g.,
0x7FFE). - Networking: MAC addresses (e.g.,
00:1A:2B:3C:4D:5E) are hexadecimal.
5. Storage Management: Fragmentation and RAID
A. Fragmentation
- Over time, files are split into non-contiguous clusters, slowing access.
- Example: A 1GB file might be stored in 100 different clusters across an HDD.
- Solution: Defragmentation (e.g., Windows Disk Defragmenter).
Mermaid Diagram: Fragmented vs. Defragmented File
B. RAID (Redundant Array of Independent Disks)
- Combines multiple disks for speed, redundancy, or both.
- Types:
- RAID 0: Striping (faster, no redundancy).
- RAID 1: Mirroring (redundancy, same capacity as one disk).
- RAID 5: Striping + parity (balance of speed and redundancy).
Real-World Use in Tourism:
- Nabil Bank’s ATM network uses RAID 1 to ensure transaction logs are never lost.
- Airport security systems use RAID 5 for real-time passenger data.
6. Backup Strategies for Critical Data
Tourism businesses (hotels, airlines, travel agencies) cannot afford data loss. Common backup methods:
- Full Backup: Copy all data (time-consuming but comprehensive).
- Incremental Backup: Only new/changed data since last backup.
- Differential Backup: All changes since the last full backup.
Example: Nepal Airlines Reservation System
- Primary storage: SSD for live bookings.
- Backup: Cloud storage (AWS) + RAID 1 for redundancy.
- Disaster recovery: Offsite backups in Pokhara data center.
In the Real World
eSewa and Khalti Payment Gateways
- Idea Used: RAM for temporary transaction storage and SSD/cloud for permanent records.
- How: When you pay for a flight on Yatra.com, the transaction is first stored in RAM (volatile) for processing, then moved to SSD/cloud (non-volatile) for permanent records. If the power goes out during processing, the transaction is lost (hence the need for backup power supplies in data centers).
Daraz’s Inventory Management
- Idea Used: Database indexing on SSDs for fast product searches.
- How: Daraz uses SSDs to store product catalogs (e.g.,
Product_ID: 12345, Name: "Nike Shoes", Price: NPR 5000). When you search for "running shoes," the SSD retrieves results in milliseconds instead of seconds (as HDDs would).
Nepal Stock Exchange (NEPSE) Trading System
- Idea Used: RAID 0 for speed and RAID 1 for redundancy.
- How: During trading hours, NEPSE’s system uses RAID 0 to process thousands of orders per second. At the end of the day, a RAID 1 mirror ensures all trades are backed up instantly in case of a crash.
Exam Tip
Memory Hierarchy: Always draw the 6-layer pyramid (CPU registers → cache → RAM → SSD → HDD → cloud) and explain the speed-cost-capacity trade-off. Examiners love this visual!
- Example Question: "Why does a computer use both RAM and HDD?"
- Answer: RAM is fast but volatile (for active tasks like live bookings), while HDD is slow but non-volatile (for permanent storage like customer databases).
RAM vs. ROM: Know the key differences (volatile/non-volatile, speed, cost) and give real-world examples (e.g., RAM for eSewa transactions, ROM for airport kiosk firmware).
HDD vs. SSD: Compare speed, cost, and durability with tourism examples (e.g., SSDs for NEPSE trading, HDDs for NTC billing backups).
Data Representation: Be able to convert decimal to binary/hex and vice versa. For exam questions, show step-by-step conversion (e.g.,
A1B2→ binary).- Example Question: "Convert the hexadecimal value
1A3Fto binary." - Answer:
1 = 0001 A = 1010 3 = 0011 F = 1111 Combined: 0001 1010 0011 1111
- Example Question: "Convert the hexadecimal value
Fragmentation and RAID: Explain why fragmentation slows down storage and how RAID improves reliability. Use banking or airline examples (e.g., Nabil Bank’s RAID 1).
Backup Strategies: Know the difference between full, incremental, and differential backups and why tourism businesses need them (e.g., hotel reservation crashes during peak season).
Final Visual Summary:
graph LR A["CPU"] -->|"Fastest"| B["Cache"] B --> C["RAM"] C -->|"Volatile"| D["Loses data on power off"] C -->|"Slower"| E["SSD"] E -->|"Non-volatile"| F["Retains data"] E -->|"Slower"| G["HDD"] G -->|"Slowest"| H["Cloud"] H -->|"Redundant"| I["RAID/Backups"]
Based on the TU BTTM syllabus for Computer and Information Technology (ITC307), unit 3.
Discussion
Loading…