Open jjPlusPlus opened 11 months ago
We're at the stage where we need to start thinking about how we store the Player submissions each round. There are three paths we could take to do this with varying levels of difficulty to implement. We don't want to spend too much time on this because it is really just an intermediary step before we get WebRTC going.
players
table (which is a JOIN table between Matches and Users), but there are two problems with this approach. The first issue is that we (might not?) don't want to convolute a JOIN table. I'm generally fine with this if it were a good solution. The second and more pressing issue is that the players
rows live for an entire Match, not just a single round, so the submissions would persist from round-to-round. Rounds
table. The format would tie the submissions for that round to the player ID's. I don't know if the base64-encoded images would be feasible here because of their long character lengths. This strategy might then need to be paired with a hosted image solution (via Supabase storage which uses s3 under the hood). We can talk about this down the road but for scalability reasons we would want to run a daily job to delete images older than (n) hourssubmissions
(between Players and Rounds, player_id, round_id, created_at, uri
). Again, a join table with "extra" columns.
Overview: Time to build some game logic. We can further break this into sub-issues
<Drawer/>
end_round
in matchUtils) to an edge fn~ I am fine with this being where it's at