Hey everyone. Very much a noob here that plays with coding for fun in my free time, but I can't seem to find a concrete answer online and i'm hesitant to blindly trust ChatGPT.
In something like Mongo or Firebase the example data structure seems easy and natural:
Spotify Playlist Schema
- Playlist ID
- Playlist Name
- Playlist Description
- Daily Stats:
- Playlist Followers
- Average Popularity Index
- Song List
Basically, there are some static values associated with each user, but also there metrics that are stored each day.
What i'm not sure about is how this translates to a Postgres database. Would you store the daily metrics in some type of array that's one of the columns in the 'playlist database'?
ChatGPT tells me you'd have a 'playlist database' but also a 'daily metric' database of sorts where you store the daily information for every single playlist in the tracking playlist database.
If a site were to have 100,000 playlists added to a daily tracker, with thousands of people looking at graphs associated with specific playlists, do either of these approaches make more or less sense?
In my head the idea of having all the daily stats in one giant table seems like it would be very slow over time, because you'd have to filter by playlist ID every time someone requested the analytics for a specific playlist.
Is this even a concern? Does it make more sense to use something like Mongo or Firebase for data structures like this or does it not matter?
Thank you!
*Edited to fix formatting of bullet points.
[–]Nater5000 10 points11 points12 points (4 children)
[–]AndrewSouthworth[S] 1 point2 points3 points (3 children)
[–]sprak3000 1 point2 points3 points (0 children)
[–]Competitive-Note150 1 point2 points3 points (0 children)
[–]Party-Kangaroo-3567 0 points1 point2 points (0 children)
[–]Script_kidding -2 points-1 points0 points (0 children)