Hi,
We create a sample for chat service, and for all dialogue we store messages and activity in the database. Until now we put all in the same collections, but if we get lot of users, it can be consume lot of CPU / Network.
So is it better to create many collections and all users watch one of them for modification, or create an huge collection and all users watch it for modification (and filter only after) ? We read collection and watch modification on it (via realtime API) Any best practice for this case ?
Hi
You can keep using 1 collection. With proper indexes, all queries will be quick. We have seen collections with millions of documents with no performance implication. Regarding realtime, if you subscribe, you only get notifications about documents you have read permission to. So if you enable document security, and make sure to only give read permissions to those who need it, all should be fine.
Thanks for the complete answer 👍
[Solved] One huge collection or lot of small ?
Recommended threads
- GB Hours IS NOT resetting
Hi, I was checking my usage and noticed that all of my usage quotas were reset on August 20, 2026, when my billing cycle renewed. Everything else appears to ha...
- Cannot migrate from Supabase
Hi, I was trying to migrate from Supabase to the Appwrite database. My database had around 190K columns. I tried it twice. Both times, after 2 days, the proce...
- Images/Videos in storage appearing broke...
I am running into a storage issue after upgrading my self-hosted Appwrite instance , all of my previously uploaded images and videos are now showing as broken i...