2 ms·
I was just yesterday wondering about the following scenario: I would have entries that have an expiration date and need to regularly purge all required rows (t
by 9dev 2y ago
I was just yesterday wondering about the following scenario:
I would have entries that have an expiration date and need to regularly purge all required rows (think access tokens, WebAuthn challenges, etc). The service creating those rows is deployed serverless, so only invoked on incoming requests. Now the only viable options I know are a) having a lottery and run the delete query as part of the normal request handling with p=0.01, b) have a secondary scheduler system that performs housekeeping tasks, or c) using pg_cron to do so in the database.
Are there any other solutions to this? Scheduling jobs on the database system works, but I’m always wondering how others solve this.