#community-help

Advice on Best Method to Store Event Records

TLDR Matthew requests advice on how to store event records with multiple attendees. Jason suggests storing these records at the event level.

Powered by Struct AI

1

1

8
2mo
Solved
Join the chat
Jul 26, 2023 (2 months ago)
Matthew
Photo of md5-ac3436827bebcd62308d83f3823df584
Matthew
05:29 PM
Question about a large number smaller records vs a small number of larger records.
We have a case where we search events but filter by attendees. We have traditionally stored these as attendee records with some event data on each record since the services we used limited the record size. However there is not many events, the collection would be less than 10,000 event records. Most events have a few hundred attendees, but can get up to a few thousand. Would it be better to store events and then attach a list of attendees to each event or continue storing them as attendees with event data on each? We'd prefer to store larger event records with attendees since it's much easier for use to manage and sync the data that way.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:39 PM
The answer to this would depend on how you’ll be searching through the data.

I’m guessing you’ll be searching for attendee names, given an event ID?
05:40
Jason
05:40 PM
Do you also search on event details across all events?
Matthew
Photo of md5-ac3436827bebcd62308d83f3823df584
Matthew
05:41 PM
Generally we are searching by event names and details(description, speakers, location, etc) and filter out events that the user isn't invited to(no attendee record)
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:43 PM
Would this be a good simplified version of a potential record:

{
  "event_name": "xyz",
  "event_location": "abc",
  "event_starts_at": 123,
  "event_ends_at": 234,
  "attendee_user_ids": [6, 7, 8, 9]
}
Matthew
Photo of md5-ac3436827bebcd62308d83f3823df584
Matthew
05:43 PM
Yes
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:44 PM
Great, so yeah, you should be good to store events as top level records… especially if the only attendee-level query you’re doing is whether an attendee is part of an event or not

1

Matthew
Photo of md5-ac3436827bebcd62308d83f3823df584
Matthew
05:45 PM
Awesome, thanks for the help

1