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?
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)
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.
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
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
Ok, thanks. And to retrieve the saved servers, that's made through teams? Or another separate collection
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
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
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
Recommended threads
- Weird permission failure
when creating an account I use following methods: ``` Future<void> register(String email, String password, String username) async { final user = await accoun...
- Relation Question
How do I create a relation from table y to an others x.$id. in my example I have a users table where I use Appwrites unique User IDs and I want other tables fo...
- Unknown attribute type: varchar / text
Since the `string` type is deprecated I tried using `varchar` and `text` in some newer tables, but when running `appwrite pull tables && appwrite types ./src/li...