The Real Fullstack

Design a File Upload Service

Your API servers spend 80 % of their time streaming bytes they never look at. How should uploads flow?

工程师12 分钟架构构建器
s3cdnsqsvirus-scanning

此挑战尚未翻译为简体中文,你正在阅读英文版本。

任务:Build an architecture where clients upload directly to object storage with short-lived permission, processing happens asynchronously, and downloads are cached — within the budget.背景 · 学习目标 ▾

Hollow Basket lets sellers upload product photos and videos up to 2 GB. Today the API receives every upload, scans it synchronously and writes it to storage. Uploads time out, API pods run out of memory, and downloads come from a public bucket.

任务: Build an architecture where clients upload directly to object storage with short-lived permission, processing happens asynchronously, and downloads are cached — within the budget.

学习目标

  • Use presigned URLs so the API authorises but does not proxy bytes.
  • Process uploads asynchronously from storage events.
  • Serve downloads through a CDN, never from a public bucket.
模拟模拟数据
seller app → upload APIseller app → private object storageupload API → private object storageupload API → metadata DBprivate object storage → event queueevent queue → malware scannermalware scanner → thumbnail workerthumbnail worker → private object storagemalware scanner → metadata DBseller app → CDNCDN → private object storageupload API → malware scannerseller app → public bucketseller appupload APImetadata DBCDNprivate object storageevent queuemalware scannerthumbnail workerpublic bucket

选择组件和连接。键盘操作:使用示意图下方的列表。

运行模拟

运行模拟以查看输出。