Bird
Raised Fist0
HLDsystem_design~10 mins

Video upload and processing pipeline in HLD - Scalability & System Analysis

Choose your learning style9 modes available
Scalability Analysis - Video upload and processing pipeline
Growth Table: Video Upload and Processing Pipeline
ScaleUsersUploads per secondStorage NeededProcessing LoadNetwork Bandwidth
Small1001-210-20 GBSingle server, basic transcoding100 Mbps
Medium10,000100-2001-2 TBMultiple processing workers, queue system1 Gbps
Large1,000,00010,000+100+ TBDistributed processing, sharded storage10+ Gbps
Very Large100,000,000100,000+10+ PBMassive distributed systems, CDN integration100+ Gbps
First Bottleneck

At small to medium scale, the video processing workers become the first bottleneck. Video transcoding is CPU and memory intensive. A single server can handle only a limited number of concurrent video conversions.

As scale grows, storage I/O and network bandwidth also become bottlenecks due to large video file sizes.

Scaling Solutions
  • Horizontal scaling: Add more processing worker servers to handle transcoding in parallel.
  • Queue system: Use message queues to manage upload and processing tasks asynchronously.
  • Caching: Cache frequently accessed videos or thumbnails using CDN to reduce load.
  • Sharding storage: Distribute video files across multiple storage nodes to improve I/O.
  • CDN integration: Use Content Delivery Networks to serve processed videos closer to users, reducing bandwidth load on origin servers.
  • Auto-scaling: Automatically add or remove processing resources based on upload traffic.
Back-of-Envelope Cost Analysis
  • At 10,000 uploads per second, assuming average video size 20 MB, storage needed per day: 10,000 * 20 MB * 3600 * 24 ≈ 17.28 TB/day (requires compression and retention policies).
  • Processing: Each transcoding takes ~5 CPU-minutes; 10,000 uploads/sec means 50,000 CPU-minutes/sec -> requires massive parallelism.
  • Network bandwidth: 10,000 uploads/sec * 20 MB = 200 GB/s (~1.6 Tbps) inbound bandwidth needed.
Interview Tip

Start by clarifying the scale and requirements. Then identify the main components: upload, storage, processing, delivery. Discuss bottlenecks at each scale and propose targeted solutions. Use real numbers to justify your choices. Always mention asynchronous processing and CDN usage for video systems.

Self Check

Your video processing system handles 1000 uploads per second. Traffic grows 10x to 10,000 uploads per second. What do you do first?

Answer: Add more processing worker servers horizontally and implement or scale the queue system to handle the increased load. Also, consider sharding storage and increasing network bandwidth to avoid bottlenecks.

Key Result
Video processing bottlenecks first at transcoding CPU load; horizontal scaling of workers and sharded storage with CDN delivery are key to handle growth from thousands to millions of uploads.