deebow started a new conversation+100 XP
5mos ago
Most of my career has been spent working with Angular. While I’ve also used Vue 2 and React in the past, Angular is where I’m most comfortable mainly because it’s opinionated, structured, and follows an MVC-style approach, so I never have to worry too much about organizing the project.
I’m starting a new project now and want to build the frontend using either Vue 3 or React. Before I dive in, I’d like to explore solid references or boilerplates that follow industry best practices for either framework.
If you have any recommendations, whether it’s a starter template, a well-structured repository, or a best-practice guide, I’d really appreciate it.
Thanks!
deebow wrote a reply+100 XP
5mos ago
JUST HOW DUMB AM I?
Why would I even need a team_participant_round table when I already have game_participants and rounds tables. I can simply record per-round participant scoring in a game_participant_round table.
That way, I avoid creating a bulky team_participant_round table that would explode in size by a factor of (number of teams created × number of participants per team × number of rounds per game).
Thanks @martinbean for pointing what I missed out:
So you’ll need to have some sort of entity for this game or whatever, that you attach players to, and also designate what “round” the game was played.
deebow wrote a reply+100 XP
5mos ago
Hello @martinbean
First of all, apologies for not sharing the full context.
In the previous post, I ended up with a polymorphic pivot game_participants, where participants could either be athlete or club. This pivot table acts as the catalogue from which players select participants to build their team.
A Team is also composed of participants chosen from that catalogue (game_participants), so I have another pivot table: team_participants.
My challenge now is how to assign a score to each team_participant for every round. I’m considering two approaches:
- A dedicated pivot table, e.g.
team_participant_round, referencing both team_participant and round.- My question: Is it acceptable or common to have a foreign key referencing the primary key of another pivot table (in this case,
team_participants.id)?
- My question: Is it acceptable or common to have a foreign key referencing the primary key of another pivot table (in this case,
- Use a JSON column (e.g.
round_scores) withinteam_participants, storing key–value pairs where the key is the round ID and the value is the score.
deebow wrote a reply+100 XP
5mos ago
Hello @glukinho , I incorrectly defined the relationship of Round. Please see updated version above.
deebow wrote a reply+100 XP
5mos ago
Scores are not entity, it's simply a score a player gets per round.
deebow started a new conversation+100 XP
5mos ago
Hello,
I have a Game, Room, Athlete, and Round entities.
Game -> Many Rooms
Room -> Many Athlete
Athlete -> Belongs to many Room
EDITED:
WRONG: (Room -> Many Rounds)
CORRECT: Game -> Many Rounds (That means, all rooms in the game all have the same rounds)
So the tables for that would be:
games
rooms
athletes
athlete_room
rounds
now, what If athletes in the room could gain scores for each round.
so then I would have athlete_room_rounds
So let's put in some numbers and do the math, for daily metrics:
- Average 15 games daily
- Average 100 rooms per game
- Average 15 athletes per room
- Average 10 rounds per game
So that would be:
15 games x 100 rooms x 15 athletes * 10 rounds = 225,000 rows daily
My question are:
- Is 225k rows daily considered heavy?
- Should I go with
athlete_room_roundtable? or should I simply add newround_scoresjson column inathlete_room? - What are my other options?
deebow wrote a reply+100 XP
5mos ago
I'm really sorry, I saw your comment in my notification but it's not anywhere in the replies section of my post, tried refreshing several times. Same with Snapey's comment.