Hi all,
Within my apps, users can create events that other users can register for.
Specifically, users will see a list of upcoming events and simply slide a toggle to register/unregister.
See red circle for mock of what I’m talking about:
My thinking is that the “Events” data type has an attendees field that contains a list of users. Every time the user clicks the toggle it would add or remove them from the list.
From a performance perspective, with 100s of users toggling at any one time, would this cause issues adding/removing them from the list? Similarly, with 100s of users using the app, they’d be querying to see if they user if appeared in the attendee list for all events in the app.
The alternative solution I was thinking of was creating a specific event_attendance data type, with each record being an individuals attendance. for Any single event I’d expect around 100 new records could be created. The records would obviously add up, but i’m thinking this would be less impact on performance as the user would only be updating their individual record rather than 100s updating the list in the single event record.
In this second scenario, a record would only be created in the event_attendees table the first time a user indicated they were attending. If this was a mistake, and they turned the toggle off, I’d have a yes/no field on table that I’d set to no (rather than delete the record). i.e. if there was no record for the user, or if the record was there but had a “no” value I’d know they weren’t attending, if there was a record with a yes then I’d know they were attending
Appreciate any advice on what might be the best way to implement this functionality from a performance and scalability perspective.
Thanks!