First i'd like to add that while this is a Firestore question, im open to hear suggestions about integrating an additional Google service.
The System
I have a chat feature in my application. Since there could be a very decent scale, I decided to have a limit to a chat group. Chat groups are not created by users and should be created automatically by using some sort of an incrementing index (e.g: room_1, room_2, ...., room_n).
The limit on each chat group is 100 users at most. So if I have 100k users online, I'd expect to have 1k groups (aka n=1000).
The Issues
- How can I distribute users, upon signing in, to chat groups? (Lets say the strategy is to fill current rooms first, hence the 'bucketing' in the title)
- Since users can close the app without pressing "quit" or something, I need the system to know to adjust