ImgFast is building an image optimization service (like Cloudinary / imgix). Website owners point their image URLs through ImgFast, which dynamically transforms images on the fly. Features:
- On-the-fly transformations - resize, crop, rotate, blur, watermark, and change format via URL parameters (e.g., `/img/photo.jpg?w=400&h=300&format=webp&quality=80`).•Format auto-detection - serve WebP to Chrome, AVIF to supported browsers, JPEG to others (based on Accept header).•Responsive images - generate srcset variants automatically for different screen sizes.•CDN caching - cache transformed images at edge PoPs. The same transformation should never be computed twice.•Origin pull - fetch the original image from the customer's storage (S3, GCS, or any HTTP URL) on first request.•Smart cropping - AI-based face/subject detection to center the crop on the important part of the image.•Usage analytics - bandwidth saved, transformations per day, and cache hit ratio per customer.
Process 50 million image requests per day with 10 million unique transformations.
Design an image optimization CDN that resizes, compresses, and converts images on-the-fly for web performance. Build this architecture under realistic production constraints, then validate tradeoffs in the design lab simulation.
Request path: The solution keeps ingress, service logic, and stateful dependencies separated so each layer can scale independently.
Reference flow: Web Clients -> DNS -> CDN Edge -> Load Balancer -> API Gateway -> API Service -> Primary SQL DB -> Redis Cache