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.

Data Coverage

movies

⚠️ 1 Unrated
1615 rows
My Rating
1614/1615100%
TMDB Rating
1615/1615100%
Poster
1613/1615100%
Backdrop
1591/161599%
Overview
1614/1615100%
IMDB ID
1605/161599%
Date
1614/1615100%
Runtime
1615/1615100%
Collection
637/161539%

shows

⚠️ 5 Unrated
199 rows
My Rating
194/19997%
TMDB Rating
199/199100%
Poster
199/199100%
Backdrop
198/19999%
Overview
199/199100%
IMDB ID
199/199100%
Date
199/199100%
Seasons
199/199100%
Episodes
199/199100%

people

72689 rows
Poster
52930/7268973%
IMDB ID
58537/7268981%
Birth Date
31255/7268943%
Popularity
72688/72689100%
Gender
64108/7268988%
Deceased Date
3626/726895%

episodes

10362 rows
Date
10327/10362100%
Runtime
10347/10362100%

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.013
profile_path/y3geQGnFG8Sbr7smthUTa84fv9v.jpg
place_of_birthToronto, Ontario, Canada
known_for_departmentActing

Relational Tables

TableRowsUnique LeftUnique RightDetails
watch_history10534161489201614 movies, 8920 episodes, 1614 rated
movie_cast610551615361556481 lead, 9293 supporting, 45281 minor
movie_crew16322161274451708 directors
show_cast548841993620254884 with ep count
show_crew867219846013115 directors/creators
movie_genres4420161119
show_genres68719916
movie_countries2434160159
show_countries26019721
seasons677199
collections299
collection_movies10122991012
genres23
countries173
networks58
production_companies2591
show_networks23119858
movie_production_companies558115812283
show_production_companies649191425
person_countries3279032492171

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
28Action74387830
46%
Active
18Drama517155672
37%
Active
53Thriller6060606
33%
Active
12Adventure42587512
28%
Active
878Science Fiction365115480
26%
Active
35Comedy35423377
21%
Active
80Crime29838336
19%
Active
14Fantasy215115330
18%
Active
27Horror2260226
12%
Active
9648Mystery15641197
11%
Active
10749Romance1970197
11%
Active
10751Family79685
5%
Active
16Animation47653
3%
Active
10752War43548
3%
Active
36History46046
3%
Active
10770TV Movie36036
2%
Active
10402Music32032
2%
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 5 shows to rate. Click to open on TMDB.