Numbers To Know medium
What is a realistic compression ratio for JSON/Text data using GZIP/Brotli?
- A 100:1
- B 2:1 (saving 50%)
- C 20:1
- D 3:1 to 5:1 (saving 70% to 80%)
Answer: D. 3:1 to 5:1 (saving 70% to 80%)
Structured text data like JSON, XML, or Log files is highly repetitive, making it an ideal candidate for compression algorithms like GZIP or Brotli. In most production environments, you can reliably expect these formats to shrink by 70% to 80% (a 4:1 ratio). This is an incredibly 'cheap' optimization, as the small amount of CPU time spent compressing the data is far less expensive than the time and money spent sending large, uncompressed files across the network. For visual assets like JPGs or PNGs, however, this technique is useless because those formats are already compressed at the character level.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What is the maximum allowed downtime per year for a system targeting '99.9%' (Three Nines) availability?
- What is the typical size of a standard ASCII character (e.g., 'A')?
- What is the typical Round Trip Time (RTT) for a single network packet traveling between New York and London (Transatlantic)?
- Network bandwidth is usually denoted in **bits** per second (Gbps), while storage is in **Bytes** (GB). What is the conversion ratio?
- Storing a password using a secure algorithm like bcrypt (cost 10) or Argon2 typically consumes how much storage per user?
- How much power does a typical fully-loaded rack-mount server consume?