Kai-T wrote a reply+100 XP
5mos ago
The database setup (concerning this problem) is very small. There is one table with the events a user can join that has an integer column with the maximum slots (and many other columns which aren't used here). The table where the user is entered has an uuid for the entry, a foreign uuid for the event and a string field if a slot is manually blocked and not by a user directly.
Joining is done after some checks (and I think I can optimize here):
- is the user already joined to the event
- is joining for this event generally allowed
- is the current time inside the set timeframe for joining
- is the user in any other event at the same time
- are there any free slots
All these checks are done using the models, but I would creating custom database querys that return true or false be faster than loading the data and performing the checks in php? (Database is a MySQL or to be more precise MariaDB 11 (.8 I think) on the same host as the laravel application)
Kai-T wrote a reply+100 XP
5mos ago
Thanks for your feedback. I'm back from vacation and will have a look into both your suggestions on the weekend