BOBBYENCODED
HomeGalleryPhotographySoftwareAbout
HomeGalleryPhotographySoftwareAbout
BOBBYENCODED

Capturing landscapes and stars through the lens. Writing code that makes a difference.

EXPLORE

GalleryPhotographySoftwareAbout

CONNECT

© 2026 BobbyEncoded. All rights reserved.

Photography & Software

System Design: Image CDN Architecture
System Design•May 15, 2024•20 min read

System Design: Image CDN Architecture

Designing an image CDN that can handle millions of requests requires careful consideration of caching, storage, and transformation strategies. Let's walk through the architecture.

Requirements

Functional Requirements

  • Upload images via API
  • Transform images on-the-fly (resize, crop, format conversion)
  • Serve images globally with low latency
  • Support for multiple resolutions and formats

Non-Functional Requirements

  • Handle 10M+ requests per day
  • P99 latency under 100ms
  • 99.9% availability
  • Cost-effective storage

High-Level Architecture

The system consists of several key components:

  1. **Upload Service**: Handles image uploads and storage
  2. **Transform Service**: Processes image transformations
  3. **CDN Layer**: Global edge caching
  4. **Origin Storage**: Durable storage for original images

Storage Strategy

For storage, we use a tiered approach:

  • **Hot storage**: Recently accessed images on SSDs
  • **Warm storage**: Standard object storage (S3)
  • **Cold storage**: Glacier for rarely accessed archives

Transformation Pipeline

Images are transformed on-demand using a URL-based API. The transform service parses the requested transformations, checks if a cached version exists, and if not, fetches the original and transforms it.

Caching Strategy

Multi-layer caching is essential:

  • **Browser cache**: 1 year for immutable URLs
  • **CDN edge cache**: 30 days
  • **Transform cache**: 7 days for processed images

Scaling Considerations

To handle peak traffic:

  • Horizontal scaling of transform workers
  • Pre-warming popular images
  • Graceful degradation for non-critical transforms

This architecture can scale to handle billions of image requests while maintaining low latency and reasonable costs.

Back to Software

STAY UPDATED

Get notified about new photos and articles. No spam, unsubscribe anytime.