InterviewHubPRO
Section Overview
Q46

Question 46 of 50

Part 5: Back-of-the-Envelope Estimation & Production Calculations (44 - 50)

92%
System Design (50 Qs)•Part 5: Back-of-the-Envelope Estimation & Production Calculations (44 - 50)

Storage Capacity and Disk IOPS Sizing for 5-Year Projections.

In Simple Words: Sizing raw storage and IOPS requirements for long-term data retention:

typescript
export function estimateStorage(writesPerDay: number, bytesPerWrite: number, years = 5) {
  const daysPerYear = 365;
  const rawBytesPerYear = writesPerDay * bytesPerWrite * daysPerYear;
  const total5YearRaw = rawBytesPerYear * years;
  
  // Factor in 3x Replication Factor (Standard in Cassandra/HDFS/Kafka)
  const totalWithReplication = total5YearRaw * 3;
  const inTerabytes = (totalWithReplication / 1e12).toFixed(2);

  return { totalWithReplicationTb: inTerabytes };
}
// Example: 50M writes/day, 1KB per record
// 5-Year Storage with 3x replication = 50M * 1KB * 365 * 5 * 3 ≈ 273.75 TB