Privacy rules in many-to-many database

Hi, Bubblers.

I’m creating SaaS webapp through Bubble that manages a hobby soccer clubs.

Let me explain a little bit about my app before I ask.

User can create or join many teams. User can see their teammates information. (Only the same team user’s informations)

The Administrator of the team(aka captain) can invite new users to his team, or deport existing teammates.

When the team’s game schedule is set in real world, the captain can create game schedule in his team’s dashboard. Captain also can change or cancel game schedules. All team members can choose to attend the game schedule.

I met some problems while making the database structure and privacy rule of this application.

The database table (type in bubble) and columns (fields in bubble) that I thought of are as follows.

1. User

  • Email: Email
  • Name: text
  • Mobile phone number: text (only available typing number)
  • Gender: text
  • Team: list of teams

→ One user can belong to several Teams

2. Team

  • Name: text
  • Member: list of Users
  • Game : list of Games
  • Captain: User

3. Game

  • Datetime: date
  • Stadium: text
  • Stadium address: address
  • Tags: list of tags (tag is option set about the game’s characteristics)
  • Notice: text
  • Participants: list of Users
  • Absentee: list of Users
  • Undecided: list of Users
  • Status : gameStatus(gameStatus is Option set : scheduled, finished, canceled)

I want every user can see their teammate’s information(name, mobile number etc…). And each team’s captain information could be visible to all users.

But I’m not sure how to set up the Privacy Rule for Bubbles. And I’m not even sure if I made the database structure right.

In the structure I described, one user can have multiple teams, and a team can have multiple users.

I’ve heard from the back-end software engineers around me that it’s good to create a join table like “User-Team” to resolve the many-to-many relationship. They said join table can improve performance.

These are my core questions.

#1. How could user view other user’s information when they are in the same team?
#2. Creating a join table in Bubble could be the answer to #1 ?
#3. Does the join table can improve or degrade Bubble’s performance ?

I ask for your help. Thank you very much.

What i suggest at this point, rather then having a list of user inside team.

As one team have many user and that user can be in many team, if i got it correct.

Its better to add team inside user , this way the tean database entity wont be bulky.

And for privacy rule i dont know you app structure. For the sack of arguments.

You can uave rule like this ’ current user team contains this user team’ then you can allow the field you want to share.

Because each user have a list of team.

Another case: you have a page content type as team and a RG with list of user who have this team in there team list.

this user list of team contains current page team.

I hope this help, but if you walk me through your app i be in better position to help. Always happy to help.


1 Like