Database Overview

Live snapshot of all tables, data coverage, and relationships. This is made to identify gaps and plan charts.

Neon PostgreSQL Database

  • Primary Datastore: Primary source of truth for up-to-date watch history, title ratings, and metadata records for website caching.
  • Serverless PostgreSQL: High-performance relational backend hosting custom materialized views and stats tables to feed the website's frontend and api.
  • Nightly Sync Pipeline: Aggregated view data and stats tables recompiled automatically via GitHub Actions.
  • Granular Metrics: Calculated by personal ratings of titles throughout the years to determine affinity based stats to use in rankings and charts.

Cloudflare D1 & Edge Workers

  • Instant Search Index: SQLite database pre-compiled offline for edge distribution, executing ultra-fast queries, completely bypassing cold starts that would normally happen in Neon.
  • Secure Edge Proxy: Serves search endpoints and proxies TMDB requests, protecting private API credentials on the server side.
  • Abuse Protection: Implemented edge rate limiting restricts client searches to a maximum of 3 requests per 10 seconds.
  • Live Scrobbling API: Receives real-time playback payloads at minute-based intervals or event triggers from my streaming platform MemoStream to power the live Now-Playing state.

Database Maintenance

Control buttons to use after synchronisation between my streaming application and the database, they work locally as the hosting provider Vercel does not let runtime of functions more than 10 seconds.

Update buttons make a full scan of all attributed tables to update data to the latest state from TMDB.

Update from history button is used for finding the records that are added to history table but failed on updating canonical tables when MemoStream sends scrobble loads. It runs targeted update for those missing movie and show titles.

Enrich buttons fill the empty fields of the tables using the data from TMDB one by one as the appended endpoints for updating from TMDB does not provide some data that I use in this website.

Sample Rows

One row from each core table showing all column names.

movie Sample

The Lord of the Rings: The Fellowship of the Ring
ColumnValue
titleThe Lord of the Rings: The Fellowship of the Ring
imdb_idtt0120737
runtime179
tmdb_id120
overviewYoung hobbit Frodo Baggins, after inheriting a mysterious ring from his uncle Bilbo, must leave his home in order to keep it from falling into the hands of its evil creator. Along the way, a fellowship is formed to protect the ringbearer and make sure that the ring arrives at its final destination: Mt. Doom, the only place where it can be destroyed.
media_keymovie:120
my_rating10
created_at2026-04-24T21:42:25.818+00:00
poster_path/6oom5QYQ2yQTMJIbnvbkBL9cHo6.jpg
tmdb_rating8.4
release_date2001-12-18
backdrop_path/a0lfia8tk8ifkrve0Tn8wkISUvs.jpg
collection_id119
original_titleThe Lord of the Rings: The Fellowship of the Ring
release_languageen
original_languageen

show Sample

Person of Interest
ColumnValue
namePerson of Interest
imdb_idtt1839578
tmdb_id1411
overviewJohn Reese, former CIA paramilitary operative, is presumed dead and teams up with reclusive billionaire Finch to prevent violent crimes in New York City by initiating their own type of justice. With the special training that Reese has had in Covert Operations and Finch's genius software inventing mind, the two are a perfect match for the job that they have to complete. With the help of surveillance equipment, they work "outside the law" and get the right criminal behind bars. 
media_keyshow:1411
my_rating10
created_at2026-04-24T21:28:37.223+00:00
poster_path/f8aIvYk5h7Z8EP3dinCmVgQFYow.jpg
tmdb_rating8.1
backdrop_path/zKFuboGOXA2qs1SJ5JD5zJA2aBS.jpg
original_namePerson of Interest
first_air_date2011-09-22
release_languageen
number_of_seasons5
original_languageen
number_of_episodes103

person Sample

Laura Vandervoort
ColumnValue
nameLaura Vandervoort
gender1
imdb_idnm0888882
tmdb_id43286
deathdaynull
birth_date1984-09-22
popularity2.875
profile_path/y3geQGnFG8Sbr7smthUTa84fv9v.jpg
place_of_birthToronto, Ontario, Canada
known_for_departmentActing

Data Coverage

movies

✓ All Rated
1589 rows
My Rating
1589/1589100%
TMDB Rating
1589/1589100%
Poster
1587/1589100%
Backdrop
1566/158999%
Overview
1589/1589100%
IMDB ID
1585/1589100%
Date
1589/1589100%
Runtime
1589/1589100%
Collection
633/158940%

shows

⚠️ 4 Unrated
197 rows
My Rating
193/19798%
TMDB Rating
197/197100%
Poster
197/197100%
Backdrop
196/19799%
Overview
197/197100%
IMDB ID
197/197100%
Date
197/197100%
Seasons
197/197100%
Episodes
197/197100%

people

67475 rows
Poster
52479/6747578%
IMDB ID
57972/6747586%
Birth Date
31097/6747546%
Popularity
67474/67475100%
Gender
63312/6747594%
Deceased Date
3614/674755%

episodes

10330 rows
Date
10295/10330100%
Runtime
10309/10330100%

Relational Tables

TableRowsUnique LeftUnique RightDetails
watch_history10454158988651589 movies, 8865 episodes, 1589 rated
movie_cast593861589349196386 lead, 9158 supporting, 43842 minor
movie_crew16011158972971685 directors
show_cast499731973221549973 with ep count
show_crew854219645353093 directors/creators
movie_genres4355158619
show_genres68319716
movie_countries2404157959
show_countries25819521
seasons674197
collections296
collection_movies998296998
genres23
countries173
networks58
production_companies2572
show_networks22919658
movie_production_companies551715602267
show_production_companies643189423
person_countries3260932314171

Relationship Map

How core entities connect through junction/relational tables.

movieswatch_historytmdb_id → tmdb_id (movie)
episodeswatch_historytmdb_id → tmdb_id (episode)
showsepisodestmdb_id → show_tmdb_id
showsseasonstmdb_id → show_tmdb_id
moviesmovie_casttmdb_id → movie_tmdb_id
moviesmovie_crewtmdb_id → movie_tmdb_id
showsshow_casttmdb_id → show_tmdb_id
showsshow_crewtmdb_id → show_tmdb_id
peoplemovie_casttmdb_id → person_tmdb_id
peoplemovie_crewtmdb_id → person_tmdb_id
peopleshow_casttmdb_id → person_tmdb_id
peopleshow_crewtmdb_id → person_tmdb_id
moviesmovie_genrestmdb_id → movie_tmdb_id
showsshow_genrestmdb_id → show_tmdb_id
genresmovie_genresid → genre_id
genresshow_genresid → genre_id
moviesmovie_countriestmdb_id → movie_tmdb_id
showsshow_countriestmdb_id → show_tmdb_id
countriesmovie_countriesiso → country_iso
countriesshow_countriesiso → country_iso
countriesperson_countriesiso → country_iso
peopleperson_countriestmdb_id → person_tmdb_id
collectionsmoviestmdb_id → collection_id
collectionscollection_moviestmdb_id → collection_tmdb_id
networksshow_networkstmdb_id → network_tmdb_id
showsshow_networkstmdb_id → show_tmdb_id
production_companiesmovie_production_companiestmdb_id → company_tmdb_id
production_companiesshow_production_companiestmdb_id → company_tmdb_id
moviesmovie_production_companiestmdb_id → movie_tmdb_id
showsshow_production_companiestmdb_id → show_tmdb_id

Genre Data Coverage

Number of movie and show entries associated with each genre. Combined TMDB genres (like "Sci-Fi & Fantasy") are flagged with a warning if they contain records.

Genre IDGenre NameMoviesShowsTotal WatchesDistributionStatus
28Action73587822
46%
Active
18Drama508155663
37%
Active
53Thriller6010601
34%
Active
12Adventure42087507
28%
Active
878Science Fiction358114472
26%
Active
35Comedy34922371
21%
Active
80Crime29738335
19%
Active
14Fantasy212114326
18%
Active
27Horror2220222
12%
Active
9648Mystery15540195
11%
Active
10749Romance1920192
11%
Active
10751Family76682
5%
Active
16Animation46652
3%
Active
10752War43548
3%
Active
36History46046
3%
Active
10770TV Movie35035
2%
Active
10402Music25025
1%
Active
37Western24125
1%
Active
99Documentary11011
1%
Active
107681Politics055
0%
Active
10762Kids011
0%
Active
10764Reality011
0%
Active
10766Soap011
0%
Active

Unrated Movies or Shows

0 movies and 4 shows to rate. Click to open on TMDB.