#Data structuration

1 messages · Page 1 of 1 (latest)

high ginkgo
#

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)

tidal drum
#

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.

high ginkgo
#

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

tidal drum
high ginkgo
#

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

tidal drum
#

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

high ginkgo
#

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