I have some difficulties with structuring the data for Firebase. I have uses and rooms. Each user can join multiple rooms and each room can have multiple users.
This is my setup right now:
I save all the room id's at the linked device (room_info). All linked devices are under the key -> device_info at the room child. I save the device name there for fast lookup.
I have used this webbpage to validate my idea: https://www.firebase.com/docs/web/guide/structuring-data.html
Is there something that can be done better?
And I want to save the device state (if devices are online). I want to create a device_state child under the room key. And I want to save all device id's there that are online. And remove them when offline. Is that a good approach?
