Easy · Media and streaming
Podcast hosting
You host shows for creators. Listeners press play and download big audio files, and creators upload a new episode now and then. The audio is the bill: every episode downloaded costs bandwidth. Practise this easy system design problem for free with a Google or GitHub account.
The brief
You host shows for creators. Listeners press play and download big audio files, and creators upload a new episode now and then. The audio is the bill: every episode downloaded costs bandwidth.
Think of a podcast host.
Users, scale and requirements
- Who uses it
- 200 thousand listeners a month
- Audience in plain numbers
- 200,000 people per month
- Normal peak
- ≈ 40 requests per second
- Request mix
- Stream chunk: 80%; Read: 17%; Write: 2%; Upload: 1%
- Speed for 99 of 100 requests
- Stream chunk: ≈ 1,500 ms; Read: ≈ 400 ms; Write: ≈ 400 ms; Upload: ≈ 8,000 ms
- Successful requests
- 99.9%
- Data safety
- No acknowledged write may be lost.
- Monthly budget
- ≈ $7,700
- Data at rest
- ≈ 40 TB
- Where users are
- North America: 60%; Europe: 30%; Asia Pacific: 10%
- Home region
- North America
- Waiting deadlines
- Stream chunk: 900 seconds; Read: 900 seconds; Write: 3,600 seconds; Upload: 3,600 seconds
≈ marks an approximation, just as in the game. Waiting deadlines measure the age of queued work and are separate from interactive response time.
- An average episode is about 50 MB (approx.). The game groups it into 2 MB stream chunks.
Questions that shape the design
How often does an episode change?
Never after it is published. Audio files are the same for everyone, so copies are safe.
Do listeners all arrive at the same time?
Mostly in the morning commute. But a famous guest can send a huge crowd at once.
Are episodes uploaded often?
No. A few thousand a day across all shows. Uploads are few and can take a few seconds.
What matters most to the creator?
That the episode plays, and that the hosting bill leaves them something to keep.
The traffic day
Morning and evening commute peaks. The clock covers 00:00 to 24:00 in the home region. Events add pressure on top of that normal traffic.
07:30 · Flash crowd
A scheduled launch brings a sudden rush of requests.
Traffic reaches 10 times the scheduled load; rises over 30 seconds, holds for 900 seconds and eases over 1,800 seconds.
12:00 · Cost blowout
A crawler hits uncached pages all day, and every pay-per-use part of the bill multiplies.
Traffic for Read, Search reaches 1.5 times the scheduled load; rises over 600 seconds, holds for 21,600 seconds and eases over 600 seconds. Other request types keep their scheduled load. Billed usage multiplier: 3. Duration: ≈ 21,600 seconds.
What a strong design has to handle
- Where does the money go in a service that sends big files? Think about what you pay per gigabyte sent.
- A very long cache time keeps the CDN bill down, but a creator who replaces an episode must wait or rename the file.
- Collapsing misses means ten thousand people asking for a brand-new episode produce one request to storage, not ten thousand.
Make a prediction, run a full traffic day, then compare the result. The in-game editorial opens after a finished day and includes measured reference designs.
Concepts to practise
Related problems
- Medium
Video streaming
You run a movie and series service for a growing audience. Each viewer pulls a few seconds of video at a time for two hours straight. Bandwidth is the largest cost by far, and everyone wants to start watching in the evening.
- Medium
Patch day downloads
A popular game ships a 5 GB update at 10 am. Millions of players press Update within the same hour. The files are identical for everyone, so the work is moving huge amounts of data without a huge bill, while players still log in and play.
- Easy
Photo sharing
You are building a photo app. People post pictures and everyone else scrolls through them. Almost all the traffic is people looking at photos, and the photos take up far more room than anything else you store.
- Easy
News site
You run a news site. Millions read the same few stories, and when something big happens almost everyone opens the same page in the same minute. Editors publish all day, and readers expect fresh headlines.