A webhook listens for events and registers leads in a postgres database. After creating the lead in the database, you need to send an email or SMS after 3 and 5 days if you don’t make a deposit (webhook event). What is the best strategy in terms of performance:
as soon as you create a lead, put one on wait to be triggered after the set time
Use a cron to check (go through the database) and check by date if there is an email to be sent. In this case, would it be better to bring the leads in batches and send emails or to bring them all at once and send emails through a loop?
If it was me I would take the second option that way you know what time your messages are going out but really the best option would be to try both and see what works for you and the environment.