I’m working on creating a workshop app that allows moderators to start a “session” of a premade workshop. Each session can have many participants and the moderator should be able to see which participants have joined and what their status is (ready, finished). I thought I’d use Presence for this but I’m unsure how to proceed because sessions and their participants need to be isolated from each other with no data leaking through. Should I:
- Create a single Presence topic with the session id as a key? I’d have to filter for the correct session per invocation, making the app slightly more error-prone and potentially slow if I ever have hundreds of concurrent sessions.
- Create a custom Presence topic whenever a workshop session is started and use that to track its participants? The presence topic would then be persisted to the DB as part of the session object.
- Something else?
Any help would be much appreciated as I’m still learning phoenix and am trying to figure out what the best practices are