I have a question about the size and performance of a collection in MongoDB. We are building a slack application with workspaces and channels. Each workspace has multiple channels and multiple users.
What would be the best layout design to store messages? I know that a MongoDB collection can handle large amounts of documents (16 MB by default) but I want to take advantage of the structure of the workspace / channels to keep all messages in a collection or workspace. Separate and do not put all the messages of all workspaces in a collection.
It has been suggested to me that I have a collection per workspace and that the messages are documents in the collection, but I find it a bit strange to keep a record of the collections and I can not have more than around 24k collections per database.
I tried to draft the design of the collection by work area.
Here is a link here
I hope someone can give me some tips to improve this design or maybe a completely better implementation.