PropSpaceX Media Service
Centralized media management — chunked uploads, automatic Sharp optimization (WebP/AVIF), and a provider abstraction over AWS S3 and Cloudinary with metadata in MongoDB.
System Architecture
Uploads stream in as multipart chunks, get optimized by Sharp (resize, WebP/AVIF), and the provider router places them on S3 or Cloudinary. Asset metadata and variants are tracked in MongoDB for responsive delivery.
Database Design
One asset fans out into size variants per provider; upload sessions track chunked transfers until completion.
Engineering Challenges
Image optimization
Automatic resizing and WebP/AVIF conversion cut delivery bandwidth by roughly 60% across listing photos.
Provider abstraction
One upload API in front of S3 and Cloudinary — providers can be switched per asset class without touching callers.
Large files
Chunked uploads and streaming processing keep memory flat for videos and high-resolution imagery.
Protected delivery
Signed URLs and CDN cache invalidation for assets that should not be publicly addressable.