Here's a modified version of the Markdown content optimized for Squarespace. Squarespace may not support complex formatting directly, so using simpler Markdown and adjusting formatting manually can make it display better.


Back of the Envelope Calculations Cheat Sheet


1. Powers of 10 (for large counts)

  • 1 million = 10^6
  • 10 million = 10^7
  • 100 million = 10^8
  • 1 billion = 10^9
  • 1 trillion = 10^12

2. Storage Units in Bytes

  • 1 Byte (B) = 10^0 bytes (base unit)
  • 1 Kilobyte (KB) = 10^3 bytes = 1,000 bytes
  • 1 Megabyte (MB) = 10^6 bytes = 1,000,000 bytes
  • 1 Gigabyte (GB) = 10^9 bytes = 1 billion bytes
  • 1 Terabyte (TB) = 10^12 bytes = 1 trillion bytes
  • 1 Petabyte (PB) = 10^15 bytes = 1 quadrillion bytes

3. Common Calculations for Certain Sizes

  • 1 KB × 1 million:
    10^3 × 10^6 = 10^9 bytes = 1 GB

  • 1 KB × 10 million:
    10^3 × 10^7 = 10^10 bytes = 10 GB

  • 1 KB × 100 million:
    10^3 × 10^8 = 10^11 bytes = 100 GB


4. Time Units

  • Seconds in a minute: 60
  • Seconds in an hour:
    60 × 60 = 3,600 seconds
  • Seconds in a day:
    3,600 × 24 = 86,400 seconds
  • Seconds in a 30-day month:
    86,400 × 30 = 2,592,000 seconds
  • Seconds in a year (approximate):
    365 × 86,400 = 31,536,000 seconds

5. Requests Per Second (RPS) for Common EC2 Instances

  • t3.medium: ~200–500 RPS (depending on workload)
  • m5.large: ~1,000–2,000 RPS
  • c5.large: ~2,000–5,000 RPS (for optimized applications)

6. Average Database Query Latency (in milliseconds)

  • DynamoDB: 10–20 ms (single read/write)
  • PostgreSQL: 1–10 ms for simple queries, up to 100 ms for complex queries
  • Redis (in-memory): < 1 ms (often sub-millisecond)

7. Average Network Request Latency (Round-Trip)

  • Within the same data center (in-region): 1–2 ms
  • Cross-region (e.g., US-East to US-West): 50–100 ms
  • From client to server (average public internet): 50–200 ms

Additional Notes

  • Bandwidth Formula:
    Bandwidth (bytes/second) = File size (bytes) ÷ Transfer time (seconds)

  • 1 Mbps Bandwidth:
    1 Mbps = 10^6 bits/second ≈ 125,000 bytes/second

  • Disk IOPS (Input/Output Operations Per Second):

    • SSD: ~10,000–100,000 IOPS
    • HDD: ~100–200 IOPS

Key Takeaways

  • Latency adds up: Disk reads, network hops, and DB lookups can slow things down—using cache layers like Redis improves performance.
  • Throughput considerations: Higher throughput can require sharding databases and using load balancers.
  • Data transfer optimization: Data compression and batching improve transfer speed for large files.

Squarespace Markdown Tips

  • Use HTML blocks if needed: If Markdown isn’t displaying well, switch to a Code or HTML block for better formatting.
  • Avoid nested lists: Squarespace Markdown can break with nested lists, so use line breaks instead.

This version avoids too much complex Markdown and provides clear spacing for Squarespace rendering. Let me know if you'd like more edits!