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| Column | Value |
|---|---|
| title | The Lord of the Rings: The Fellowship of the Ring |
| imdb_id | tt0120737 |
| runtime | 179 |
| tmdb_id | 120 |
| overview | Young 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_key | movie:120 |
| my_rating | 10 |
| created_at | 2026-04-24T21:42:25.818+00:00 |
| poster_path | /6oom5QYQ2yQTMJIbnvbkBL9cHo6.jpg |
| tmdb_rating | 8.4 |
| release_date | 2001-12-18 |
| backdrop_path | /a0lfia8tk8ifkrve0Tn8wkISUvs.jpg |
| collection_id | 119 |
| original_title | The Lord of the Rings: The Fellowship of the Ring |
| release_language | en |
| original_language | en |
show Sample
Person of Interest| Column | Value |
|---|---|
| name | Person of Interest |
| imdb_id | tt1839578 |
| tmdb_id | 1411 |
| overview | John 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_key | show:1411 |
| my_rating | 10 |
| created_at | 2026-04-24T21:28:37.223+00:00 |
| poster_path | /f8aIvYk5h7Z8EP3dinCmVgQFYow.jpg |
| tmdb_rating | 8.1 |
| backdrop_path | /zKFuboGOXA2qs1SJ5JD5zJA2aBS.jpg |
| original_name | Person of Interest |
| first_air_date | 2011-09-22 |
| release_language | en |
| number_of_seasons | 5 |
| original_language | en |
| number_of_episodes | 103 |
person Sample
Laura Vandervoort| Column | Value |
|---|---|
| name | Laura Vandervoort |
| gender | 1 |
| imdb_id | nm0888882 |
| tmdb_id | 43286 |
| deathday | null |
| birth_date | 1984-09-22 |
| popularity | 2.875 |
| profile_path | /y3geQGnFG8Sbr7smthUTa84fv9v.jpg |
| place_of_birth | Toronto, Ontario, Canada |
| known_for_department | Acting |
Data Coverage
movies
✓ All Ratedshows
⚠️ 4 Unratedpeople
episodes
Relational Tables
| Table | Rows | Unique Left | Unique Right | Details |
|---|---|---|---|---|
| watch_history | 10454 | 1589 | 8865 | 1589 movies, 8865 episodes, 1589 rated |
| movie_cast | 59386 | 1589 | 34919 | 6386 lead, 9158 supporting, 43842 minor |
| movie_crew | 16011 | 1589 | 7297 | 1685 directors |
| show_cast | 49973 | 197 | 32215 | 49973 with ep count |
| show_crew | 8542 | 196 | 4535 | 3093 directors/creators |
| movie_genres | 4355 | 1586 | 19 | |
| show_genres | 683 | 197 | 16 | |
| movie_countries | 2404 | 1579 | 59 | |
| show_countries | 258 | 195 | 21 | |
| seasons | 674 | 197 | — | |
| collections | 296 | — | — | |
| collection_movies | 998 | 296 | 998 | |
| genres | 23 | — | — | |
| countries | 173 | — | — | |
| networks | 58 | — | — | |
| production_companies | 2572 | — | — | |
| show_networks | 229 | 196 | 58 | |
| movie_production_companies | 5517 | 1560 | 2267 | |
| show_production_companies | 643 | 189 | 423 | |
| person_countries | 32609 | 32314 | 171 |
Relationship Map
How core entities connect through junction/relational tables.
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 ID | Genre Name | Movies | Shows | Total Watches | Distribution | Status |
|---|---|---|---|---|---|---|
| 28 | Action | 735 | 87 | 822 | 46% | Active |
| 18 | Drama | 508 | 155 | 663 | 37% | Active |
| 53 | Thriller | 601 | 0 | 601 | 34% | Active |
| 12 | Adventure | 420 | 87 | 507 | 28% | Active |
| 878 | Science Fiction | 358 | 114 | 472 | 26% | Active |
| 35 | Comedy | 349 | 22 | 371 | 21% | Active |
| 80 | Crime | 297 | 38 | 335 | 19% | Active |
| 14 | Fantasy | 212 | 114 | 326 | 18% | Active |
| 27 | Horror | 222 | 0 | 222 | 12% | Active |
| 9648 | Mystery | 155 | 40 | 195 | 11% | Active |
| 10749 | Romance | 192 | 0 | 192 | 11% | Active |
| 10751 | Family | 76 | 6 | 82 | 5% | Active |
| 16 | Animation | 46 | 6 | 52 | 3% | Active |
| 10752 | War | 43 | 5 | 48 | 3% | Active |
| 36 | History | 46 | 0 | 46 | 3% | Active |
| 10770 | TV Movie | 35 | 0 | 35 | 2% | Active |
| 10402 | Music | 25 | 0 | 25 | 1% | Active |
| 37 | Western | 24 | 1 | 25 | 1% | Active |
| 99 | Documentary | 11 | 0 | 11 | 1% | Active |
| 107681 | Politics | 0 | 5 | 5 | 0% | Active |
| 10762 | Kids | 0 | 1 | 1 | 0% | Active |
| 10764 | Reality | 0 | 1 | 1 | 0% | Active |
| 10766 | Soap | 0 | 1 | 1 | 0% | Active |
Unrated Movies or Shows
0 movies and 4 shows to rate. Click to open on TMDB.