I have a question about the size and performance of a collection in MongoDB. We build a slack-like application with workspaces and channels. Each workspace has multiple channels and multiple users.
What would be the best schema design for storing messages? I know that a MongoDB collection can handle huge amounts of documents (default 16 MB), but I want to take advantage of the workspace / channels framework to keep all messages in a collection or workspace. Separate and do not put all messages from all workspaces into a single collection.
It was suggested to have a collection by workspace and to make sure that the messages are documents of the collection, but it seems to me a bit hacky to keep track of the collections and I do not can not have more than 24,000 collections per base.
I have tried to create a draft of the design of the collection by workspace.
Here is a link to that here
I hope someone can give me some guidance to improve this design or perhaps a completely better implementation.