AlgoViz

Design a podcast hosting platform

medium 45 min

Creators upload episodes; thousands of apps we do not control find and download them through one public file, the feed.

Video lesson · Chapter 1 of 5

A podcast upload stalls inside a train tunnel

0:00 / 4:04

Theory

Read or listen first. About 2 min.

What it is

A podcast hosting platform stores the episodes of a show and publishes a feed: an XML file in RSS format that lists them. Podcast apps check the feed, see a new episode and download its audio file.

The platform does not own the player. The feed is the product: if it is correct, the episode appears in many apps; if it is broken, it appears in none. And because others play the audio, the platform counts downloads, not listening.

This page is an exercise, inspired by services such as Buzzsprout, Libsyn and Spotify for Creators. It does not describe any company's system.

Why it exists

A creator wants to upload once and be found everywhere, without agreements with each app. An open file that everybody may check makes that possible.

The work behind it is hard to do alone: large uploads on weak networks, equal loudness, petabytes of traffic, and numbers that sponsors believe.

A short history

  1. December 2000

    RSS 0.92 adds the enclosure element, which lets a feed point at a media file.

  2. August 2002

    RSS 2.0, the version that podcast feeds still use.

  3. February 2004

    Ben Hammersley suggests the word podcasting in The Guardian.

  4. June 2005

    Apple adds podcasts and a directory to iTunes 4.9.

  5. December 2017

    IAB Tech Lab publishes version 2.0 of its podcast measurement guidelines. Version 2.3 followed in September 2026.

  6. 2024

    Google Podcasts closes. Feeds keep working in other apps, because nobody owns the list.

Words to know

RSS feed
An XML file with facts about a show and an item for each episode.
Enclosure
The part of an item that gives the audio's URL, length in bytes and type.
GUID
An episode's permanent name. If it changes, apps see a new episode.
Byte range
A request for part of a file, such as bytes 0 to 999,999.
Conditional request
Give me the file only if it changed: ETag and 304.
LUFS
A unit of perceived loudness over a whole recording.
Download
A counted event: enough bytes for one minute of content, once in a time window.
Dynamic ad insertion
Choosing ads when the file is requested.

Solve it like an interview

New to it? Start with Approach. Revising? Go straight to the mock.

  1. 1ApproachWhat this question tests, where it gets hard, and how to spend the time.
  2. 2ScopeAsk what changes the design, then commit to a short list.
  3. 3NumbersWork out a number when the answer changes what you build.
  4. 4API and dataThe contract first, then the data that serves it.
  5. 5DesignStart with the smallest system that works. Change it only when something breaks.
  6. 6Deep divesCompare the options before you open them, then say which you would pick.
  7. 7Explain your choicesAnswer first. Then compare your reasoning.
  8. 8By levelThe same question is judged differently for mid, senior and staff.
  9. 9MockAnswer against the clock, then score yourself.

Understand it

The storyteller's cassettes
1 sea1One tape, one list

One list on a door, many players that check it, and a clerk who counts fairly.

Scope

What are we building?

Upload and process episodes, publish feeds, deliver audio, schedule releases, and count downloads. An embedded player and several shows for each account are small additions. Video, live shows, discovery and comments are out.

  • Upload

    Large files that continue after a break.

  • Feed

    One correct file that many apps read.

  • Deliver

    28.8 PB a month, from the edge.

  • Count

    Downloads that a sponsor can trust.

The finished system

Where the design ends up

The whole system

A creator calls the podcast API through a gateway and uploads straight to raw storage. Jobs go through a queue to audio workers, which write object storage. The API publishes on schedule into PostgreSQL, and a feed builder checks and writes feed files. Podcast apps, outside our system, read feeds and audio from a CDN. Its logs go through Kafka and a counting job to ClickHouse.
Pink is publishing, blue is what apps read, orange is counting. Dashed means only on a miss, or later.

Podcasts next to music streaming

QuestionPodcast hostMusic service
Who owns the player?OthersWe do
How is audio fetched?One file, often ahead of timeSmall pieces, several qualities
What can be counted?DownloadsPlays, skips, seconds
What lasts?URLs and GUIDs in other people's appsOur own manifest, changed any time
Who pays?CreatorsListeners
The other column is music streaming.

Ideas and where they are explained

Idea hereConcept page
Uploads in partsFile upload APIs
Audio at the edgeCDN and invalidation
Where files liveObject storage
Jobs that may run twiceQueues and idempotency
Events after a commitChange data capture
Counting a streamStream processing
One service or manyMicroservices and monolith

Summary

The whole topic in one minute.

Uploads go straight to storage in parts. A queue gives each episode to a worker, which checks it, evens out the loudness and writes one file to serve. A database transaction publishes the episode, and a builder writes, checks and swaps the feed.

Apps read feeds and audio from a CDN. Its logs become counts: enough bytes for a minute, once for each address, app and episode in 24 hours, without robots. Private feeds and changing ads are the hard additions, because they break caching.

  • The feed is the product: check it, then swap it.
  • GUIDs and enclosure URLs never change.
  • Bytes go from storage to edge to app; services carry text.
  • A download is a rule, not a request.
  • Ads chosen per request must stay the same for every range of that download.

Sources