I have database structure as:
=> collection (ChatRoom) : stores chat room name, chat participants, unique chat room id
=> documents (unique ids) : documents created with unique ids based upon users
=> sub-collection (chats) : all chats going on between 2 specified persons (chat participants)
Now, i want to listen to multiple chats collection based upon user. For example :
If a user is connected with 500 people then how can i listen to those 500 chats(sub-collections) in order to get notified when a new message is being sent by any one of them.
Also, isn't that cause much of a performance overhead for the device.
Also, taking in account the db reads for such scenario, are they going to be too much.
What should be the best method for such situation ?