Menu

How to Pick Cron or Message Queue Delivery for Scheduled Cleanup
📰

How to Pick Cron or Message Queue Delivery for Scheduled Cleanup

DEV Community: go·FairchildBlake8483·about 19 hours ago
#A1GnNQ9u
#devtogo#devto#dev#rows#database
Reading 0:00
15s threshold

Short answer: for scheduled data cleanup, use cron to run a recurring database scan until one batch can no longer finish comfortably inside its interval; add a message queue when you need bounded worker concurrency, independent retries, or isolation from slow downstream work. In either design, make the Postgres cleanup transition conditional and safe to repeat. The delivery mechanism can wake the work up, but the database must decide whether a held reservation is still eligible to expire.

For a customer-support system, the job is narrow: release reservations whose fixed hold window has ended. Don't begin with permanent deletion. Mark a row expired first, preserve enough information to audit the transition, and run physical retention as a separate policy.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.