Daily Cleanup Job to Delete Old Uploads and Logs — Cron Selection
TL;DR: Use one daily cron trigger to delete expired uploads, logs, and webhook-delivery records. Keep the deletion endpoint idempotent, calculate calendar cutoffs in application code, and log compact counts rather than every deleted row. Add a queue only when individual deletion units need independent retries or tracking. For long work, let cron enqueue bounded units and let workers consume them; do not stretch one scheduled request into a batch processor. The observability bill is mostly multiplication: events per day times bytes per event times retained days, plus index and label overhead.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in