Objective: Design a video streaming platform like YouTube

Before diving into the architecture, let’s establish baseline requirements to understand the scale we’re designing for:

** These numbers justify our architectural decisions around horizontal scaling, CDN usage, and distributed storage systems.

Entities:

User: represents an account (username, email, password etc.)
Video: stores metadata about uploaded videos (title, uploader_id, upload_time, visibility, resolution, duration etc.)
Comment: user comments tied to videos (video_id, user_id, comment_text, created_date)

Core API Endpoints:

POST /videos/upload — Upload a new video
GET /videos/{id} — Get video metadata
DELETE /videos/{id} – Delete a video (if uploader)
GET /videos/{id}/stream — Stream the actual video
POST /videos/{id}/like — Like a video
POST /videos/{id}/comments — Post a comment
GET /videos/{id}/comments – Fetch comments
GET /videos/search?q=query – Search videos by keyword

Pages: 1 2

Discover more from M Chisty - Java Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading