Bird
Raised Fist0
HLDsystem_design~10 mins

Storage access patterns in HLD - Scalability & System Analysis

Choose your learning style10 modes available
Scalability Analysis - Storage access patterns
Growth Table: Storage Access Patterns
Users / Data Size100 Users10K Users1M Users100M Users
Read Requests per Second~100-500~10K~1M~100M
Write Requests per Second~50-200~5K~500K~50M
Data SizeGBsTBsPBsExabytes
Access PatternMostly sequential, low concurrencyMixed sequential and random, moderate concurrencyHighly random, high concurrencyHighly random, extreme concurrency, multi-region
Latency SensitivityLow to moderateModerateHighVery high
Storage TypeLocal disks or single DBDistributed storage, caching introducedSharded DBs, SSDs, caching layersMulti-region distributed storage, tiered storage
First Bottleneck

At small scale (100 users), storage access is simple and local disks or single database handle requests well.

At medium scale (10K-1M users), the first bottleneck is the storage I/O throughput and latency. Random access patterns cause disk seek delays and slow queries.

At large scale (100M users), the bottleneck shifts to storage system scalability and network bandwidth between distributed storage nodes.

Scaling Solutions
  • Caching: Use in-memory caches (Redis, Memcached) to reduce read load on storage.
  • Sharding: Split data horizontally across multiple storage nodes to distribute load.
  • Data Partitioning: Organize data by access patterns to optimize sequential reads and reduce random I/O.
  • Tiered Storage: Use fast SSDs for hot data and slower disks for cold data.
  • Replication: Use read replicas to scale read throughput and improve availability.
  • CDN: For static content, use Content Delivery Networks to reduce storage access and latency.
  • Compression and Compaction: Reduce storage size and improve I/O efficiency.
  • Asynchronous Writes: Buffer writes to reduce write latency and batch operations.
Back-of-Envelope Cost Analysis

Assuming 1M users with 1M read and 500K write requests per second:

  • Storage IOPS needed: ~1.5 million per second (reads + writes)
  • Network bandwidth: For 1KB average request size, ~1.5 GB/s (~12 Gbps)
  • Storage capacity: Petabyte scale, depending on data retention
  • Cache size: Tens to hundreds of GBs to hold hot data
  • Number of storage nodes: Hundreds to thousands, depending on node capacity
Interview Tip

When discussing storage access patterns scalability, start by describing the current access pattern (sequential vs random, read/write ratio).

Explain how these patterns affect storage I/O and latency.

Identify the bottleneck clearly (I/O throughput, latency, network).

Then propose targeted solutions like caching, sharding, replication, and tiered storage.

Always connect solutions to the specific bottleneck caused by access patterns.

Self Check

Your database handles 1000 QPS. Traffic grows 10x. What do you do first?

Answer: Add read replicas and implement caching to reduce load on the primary database before considering sharding or hardware upgrades.

Key Result
Storage access patterns impact I/O throughput and latency; caching and sharding are key to scaling as user and data volume grow.

Practice

(1/5)
1. Which storage access pattern reads data in the order it is stored, one piece after another?
easy
A. Sequential access
B. Random access
C. Batch access
D. Streaming access

Solution

  1. Step 1: Understand sequential access meaning

    Sequential access means reading data in the exact order it is stored, one after another.
  2. Step 2: Compare with other patterns

    Random access reads data in any order, batch access reads groups of data, streaming processes data continuously.
  3. Final Answer:

    Sequential access -> Option A
  4. Quick Check:

    Sequential = ordered reading [OK]
Hint: Sequential means reading data in stored order [OK]
Common Mistakes:
  • Confusing random access with sequential
  • Thinking batch means single item reading
  • Mixing streaming with batch processing
2. Which of the following is the correct description of random access in storage systems?
easy
A. Data is read in fixed-size batches only
B. Data is accessed only once and then discarded
C. Data is streamed continuously without breaks
D. Data can be read or written at any location without following order

Solution

  1. Step 1: Define random access

    Random access allows reading or writing data at any position without following a sequence.
  2. Step 2: Eliminate incorrect options

    Batch access reads fixed-size groups, streaming is continuous flow, and discarding after one access is not random access.
  3. Final Answer:

    Data can be read or written at any location without following order -> Option D
  4. Quick Check:

    Random access = any location access [OK]
Hint: Random means any location, no order needed [OK]
Common Mistakes:
  • Confusing batch with random access
  • Thinking streaming means random access
  • Assuming random access is sequential
3. Consider a system that processes logs by reading 1000 entries at once, then writes results back. Which access pattern best describes this?
medium
A. Random access, because entries are accessed individually
B. Streaming access, because data flows continuously
C. Batch access, because data is processed in groups
D. Sequential access, because logs are read in order

Solution

  1. Step 1: Identify processing style

    The system reads 1000 entries at once, meaning it processes data in groups or batches.
  2. Step 2: Match with access patterns

    Batch access means handling data in fixed-size groups, streaming is continuous single flow, random is unordered, sequential is one by one.
  3. Final Answer:

    Batch access, because data is processed in groups -> Option C
  4. Quick Check:

    Batch = group processing [OK]
Hint: Batch means processing data in groups [OK]
Common Mistakes:
  • Confusing batch with streaming
  • Assuming sequential means batch
  • Thinking random access fits batch processing
4. A developer implemented streaming access but notices high latency and data loss. What is the most likely cause?
medium
A. Not handling backpressure in the streaming pipeline
B. Reading data sequentially instead of randomly
C. Using batch processing instead of continuous streaming
D. Accessing data in random order causing delays

Solution

  1. Step 1: Understand streaming issues

    Streaming requires managing data flow to avoid overload, called backpressure handling.
  2. Step 2: Identify cause of latency and loss

    If backpressure is not handled, data can pile up causing delays and loss.
  3. Final Answer:

    Not handling backpressure in the streaming pipeline -> Option A
  4. Quick Check:

    Streaming needs backpressure control [OK]
Hint: Streaming needs backpressure handling to avoid loss [OK]
Common Mistakes:
  • Confusing batch with streaming
  • Ignoring backpressure importance
  • Assuming random access causes streaming issues
5. You design a video streaming service that must deliver smooth playback and allow users to jump to any timestamp instantly. Which storage access pattern combination is best?
hard
A. Sequential access for playback and batch access for buffering
B. Streaming access for playback and random access for seeking
C. Batch access for playback and sequential access for seeking
D. Random access for playback and streaming access for buffering

Solution

  1. Step 1: Analyze playback needs

    Smooth playback requires continuous data flow, which is streaming access.
  2. Step 2: Analyze seeking needs

    Jumping to any timestamp instantly requires random access to data at any position.
  3. Step 3: Combine patterns for best design

    Use streaming for continuous playback and random access for quick seeking.
  4. Final Answer:

    Streaming access for playback and random access for seeking -> Option B
  5. Quick Check:

    Playback = streaming, seeking = random [OK]
Hint: Streaming for play, random for jump [OK]
Common Mistakes:
  • Using sequential for seeking which is slow
  • Confusing batch with streaming for playback
  • Ignoring random access need for seeking
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard