Event Object Discussion #181
Replies: 4 comments 7 replies
-
As long as every instance of a recurring event has to exist in a database, you'll always to limit the years in which events can occur, and it makes indefinitely repeating events impossible. Using a schema that does not generate each event instance but is still able to support recurring events will be much harder to implement, but in my opinion is well worth it for several reasons:
Given that, though, it may be worth enumerating all the features you want to support in this app; since each schema design will serve different purposes, and if we don't need X, Y, or Z, more complex designs may not be necessary. Some examples of features might include:
Knowing the desired feature first set may help guide us to the design that works best for us. Feel free to push back on this; I am by no means an expert in calendar schema design and am open to ideas 🙃 |
Beta Was this translation helpful? Give feedback.
-
These are some quick initial thoughts: There should definitely be a threshold set for recurring events so that it can't just make the events forever. Maybe limit it to 12 months out to start. At first glance it looks like all of the objects in the dates array store the same data as the parent(besides the I think there are a few options here:
|
Beta Was this translation helpful? Give feedback.
-
I have recently updated the Wiki with a graph of the current event model for visual reference. The current schema was adjusted "in place" as the code was developed. The @timmyichen I think, for 100Devs, the indefinitely recurring events are unnecessary but not including that feature moving forward might be a deal-breaker for other Discords/Slack communities. 🤔 @miguelbj option 2 is sort of what I had in mind while we were building MVP but I also like the idea of option 3 moving forward. We definitely need to have a stronger model in place before the next major release. 💯 |
Beta Was this translation helpful? Give feedback.
-
@intelagense understood! In which case, I agree that @miguelbj 's option 3 is the best, mostly for its ease of querying. If each recurring event is also an event and has the potential to be an independent event, then it makes sense for that to be reflected in the schema. Having nested events make querying difficult - e.g. instead of just being able to query by ID when making updates, you would have to indicate "is this a nested event", "what is the parents' ID", "which event within the nested list is this", or just query by an ID within both the top-level events as well as nested events - all of which are much more annoying than just treating each event as a first-class citizen. |
Beta Was this translation helpful? Give feedback.
-
Opening up a discussion to start to tackle the best path forward with the event model.
currently the model takes the form input and creates an array of event objects. The array is then passed back into the front end for viewing. This was done because it connects all the events to one.
What has been proposed is separating the events from an array and have them be their own object with a parent/child connecting the recurring events to the original event.
Would love your thoughts!
Beta Was this translation helpful? Give feedback.
All reactions