Design a Video Processing Pipeline, stage 6 of 14: decide
Showing the instructor what is happening
An instructor watches the video page after uploading. Status changes perhaps four times over 20 minutes: queued, processing, ready or failed. The status lives in Postgres and is changed by workers, which are separate processes from the API servers the browser talks to.
System so far· 8 parts
Select a component to see what it is responsible for and which state it owns.
- 1Instructor browser → Video API: Create upload, report parts, poll status
- 2Instructor browser → Object storage: Upload parts via presigned URLs
- 3Video API → Object storage: Complete multipart upload, verify object
- 4Video API → Postgres: Video row and job row in one transaction
- 5Transcode workers → Postgres: Claim lease, heartbeat, fenced completion
- 6Transcode workers → Object storage: Read raw upload, write attempt output
- 7Reconciler → Postgres: Find abandoned uploads and orphaned output
- 8CDN → Object storage: Origin fetch on cache miss
- 9Student player → CDN: Manifest and segments
- Request / response
- Bulk data
What you need to know
0 of 2 checks done
There are three common ways for a page to learn about changes:
Method How Good for Polling the client asks every few seconds rare changes, delays of seconds acceptable Server-Sent Events the server keeps a one-way stream open frequent server-to-client updates WebSockets a two-way connection both sides sending often (chat, collaboration) Work it out
200 instructors have the upload page open, and each page polls every 5 seconds. About how many requests a second does that add?Check
With SSE, the browser is connected to an API server, but the status is changed by a worker writing to Postgres. How does the API server find out?