The Official Listen Notes Blog, published 2025-02-18
Architecture
Listen Notes describes its main web application as one podcast database with three interfaces: a website, a developer API and raw data exports. The code is a monorepo with a Django backend, whose monolith includes the API gateway, and it uses several data stores: Postgres, Elasticsearch, Redis and ClickHouse. Requests to the website and the API pass through Cloudflare.
Section: How We Build Listen Notes Software | Near: now part of our monolithic Django app | Near: Podcast API pass through Cloudflare
Components
Component
Role
Where
Postgres
The primary data store and single source of truth, holding podcast metadata from the ingest workers and most website and API data. The cluster typically has 3 instances: one primary for writes and some reads, and read-only replicas with short query timeouts.
Section: The Single Source of Truth: Postgres
Elasticsearch
The search engine. Documents are synced from Postgres whenever a podcast or episode is added, updated or deleted, and periodic jobs keep the two copies almost in sync. Searches from the website, the API and internal scripts all go to it.
Section: Search Engine: Elasticsearch
ClickHouse
Stores analytics data such as API, listen and search logs. It joined the stack around 2020.
Section: Analytics: ClickHouse
Redis
A cache used for rate limiting, feature switches and other performance-critical functions.
Section: Fast & Ephemeral Datastore: Redis
Website
A Django application served by uwsgi under supervisord behind an nginx load balancer, with pages rendered partly by Django templates and partly by a React application.
Section: UI #1: The Website (listennotes.com)
API gateway
Part of the Django monolith. It handles rate limits, authentication, authorization, caching and the processing of each API request.
Section: UI #2: The Podcast API (PodcastAPI.com)
Async workers
Python code on async worker servers ingests and processes podcast metadata into Postgres. Separately, Celery async workers take tasks triggered by user events such as sending transactional email.
Near: ingests and processes podcast metadata | Near: we offload to Celery async workers
Cloudflare
Every request to the website and the API passes through it for CDN, firewall and DDoS protection, with custom firewall rules per page and endpoint. Internal tools call its API to block or challenge an IP address.
Section: Fighting Bad Guys/Bots
Figures, as the source states them
Figure
As stated
Note
Where
Size of the Postgres primary data store
1.2 TB
Over; Postgres only, not Elasticsearch, ClickHouse or Redis
Near: which has grown to over 1.2 TB
Documents in the Elasticsearch index
200 million documents
Approximate, stated as over; all public podcasts and episodes
Near: now totaling over ~200 million documents
Instances in the Postgres cluster
3 instances
Typical; sometimes 4 or 5; one primary and the rest read-only replicas
Near: Our Postgres cluster typically has 3
Query timeout on read-only Postgres replicas
30 seconds
Given as an example of a short timeout
Near: short query timeouts (e.g., 30 seconds)
Yearly cost of the earlier monitoring tools
3,500 US dollars per year
Approximate; Datadog, PagerDuty and Atlassian Statuspage together
Run open-source datastores on EC2 instances and avoid AWS managed database products
listennotes-2025-tech-stack#d1at corpus version 26a1b3a7e3dd
Chosen
The company runs on AWS but does not pay for its managed database products: it runs open-source datastore software on EC2 instances. Postgres runs on storage-optimized instances, and custom bash scripts, some scheduled, do its routine DBA tasks.
Section: One Database | Section: The Single Source of Truth: Postgres
Rejected
AWS RDS for Postgres. Avoided for cost and for control; the lack of root access is the example given.
Near: We avoid AWS RDS for cost and
Reasoning
Cost efficiency. The author says sustainability is key: the aim is to give excellent service without running out of money.
Replace RapidAPI with an API gateway built into the Django monolith
listennotes-2025-tech-stack#d2at corpus version 26a1b3a7e3dd
Chosen
The team built its own API gateway, now part of the monolithic Django application, which handles rate limits, authentication, authorization, caching and request processing for the API.
Section: UI #2: The Podcast API (PodcastAPI.com)
What forced it
The team experienced multiple RapidAPI outages.
Near: after experiencing multiple RapidAPI outages
Reasoning
RapidAPI took a 20% commission, which the author calls acceptable for a side project but too high for a serious API business.
Near: paying RapidAPI's 20% commission fee
What worked before
At first the API was managed and monetized through RapidAPI, then called Mashape. The API launched in December 2017.
Near: we used RapidAPI (then Mashape) to manage | Near: We launched the API in December 2017
Cost
Building the gateway took a month.
Near: we spent a month building our own
Outcome
The author reports that the change improved reliability and ended the 20% commission payments.
Dump Postgres daily from a read-only replica, encrypt it, and upload it to three cloud providers
listennotes-2025-tech-stack#d3at corpus version 26a1b3a7e3dd
Chosen
Postgres is replicated across several servers in real time. A daily cron job also runs pg_dump on one of the read-only servers, encrypts the dump with GPG and uploads it to AWS S3, Google Cloud Storage and Cloudflare R2.
Section: Data Backup
Reasoning
The author says that with the Postgres dump the business could be restored even if the code and servers were gone, and that he hopes the three storage companies do not all lose the data at once.
Near: with our Postgres dump, the business could | Near: lose our data all at once
Stay on AWS with prepaid reserved instances although cheaper hosts exist
listennotes-2025-tech-stack#d4at corpus version 26a1b3a7e3dd
Chosen
The company has stayed on AWS since early 2018. For EC2 it always buys reserved instances and prepays where it can, and it changes instance types over time for price and performance.
Cheaper hosting providers. The author says downtime or poor support costs far more, in people's effort and in customer trust.
Near: While cheaper alternatives exist
What worked before
In 2017 the service ran on three DigitalOcean droplets at $10 a month each. It moved to AWS in early 2018, which the author credits to $5,000 of AWS credits from WeWork.
Near: we used three $10/month DigitalOcean droplets
Cost
AWS is the company's second biggest expense after people, and the author calls the reserved instances a significant expense.
Near: second biggest expense after human costs | Near: It’s a significant expense
Deploy from a laptop with an Ansible script while nginx takes some uwsgi processes out of rotation
listennotes-2025-tech-stack#d7at corpus version 26a1b3a7e3dd
Chosen
Django and React code is deployed straight from a MacBook Pro by an Ansible-orchestrated script: it compiles the JavaScript and CSS assets, uploads them to Cloudflare R2 to be served by the Cloudflare CDN, and checks out the latest Django code on the production servers. The nginx load balancer temporarily removes some uwsgi processes during a deployment so that there is no downtime. Servers are also provisioned with Ansible.
Section: Code Deployment | Near: We provision servers using Ansible