Back

Data structuration

  • 0
  • Databases
  • Teams
D5
4 Apr, 2023, 11:43

When having a page, like a Facebook page, should such page be a team or a database document? Same example with discord. Channels should be teams or documents?

TL;DR
The user is discussing different options for organizing data and permissions in a server-like system. One suggestion is to use Teams to manage memberships and permissions within servers. Another suggestion is to have a separate collection to track which servers the user is a part of. It is also recommended to use Teams for permissions management, with different levels of access based on roles. The user is advised to create a 'servers' collection to store information about each server, and to use Teams to control access to server content. The solution to saving pages/channels is not mentioned in the thread.
D5
4 Apr, 2023, 11:51

If I'm not wrong, you can't see or join yourself the team, so it's going to be impossible to save the team (so then you are not able to save the pages/channels)

Meldiron
4 Apr, 2023, 12:04

Hey πŸ‘‹ Ill take example of Discord server as I am familiar with that. First, I would make a servers collections, and a document for each server. This allow features such as Server Discovery, and allows you to store info about server such as Name, Invite URL, description, Image ID, default channel, rules, ... Notice how we used Database purely to store and display data.

Next I would start using Teams and introduce a team for each server. When user joins a server (and accepts rules), only then I would add him to the server's team. Then, for every message in this server, I would give read permissions to server's team. That way, you cannot see those messages until you join server and accept rules. Notice how I used Teams for permissions (security) reasons.

D5
4 Apr, 2023, 12:08

Ok, I understand. I suppose it could be even more efficient enabling read permission by default and teams for other permission, being needed to join the team to manage the server

Meldiron
4 Apr, 2023, 12:10

Could be πŸ˜‡ You can also use rules of a team for this. for example: member - can read trusted - can also write mods - can also manage server owner - can also invite mods

D5
4 Apr, 2023, 12:12

Ok, thanks. And to retrieve the saved servers, that's made through teams? Or another separate collection

Meldiron
4 Apr, 2023, 12:14

I think using Teams would be a smart way to do it. An user can list all teams they are part of. If you keep Team ID and Server Document ID exactly the same, you can list your memberships (teams you are part of) and know server IDs

Meldiron
4 Apr, 2023, 12:14

Tho if you need IDs to be different, there is nothing wrong having a separate collection to know which server you are part of. This would also allow you to change and save order of servers in the left panel

D5
4 Apr, 2023, 12:31

Ok, I think I will choose the second option, since you can't join yourself a team, and then reserve teams for admin chanel/mod/owner

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more