Hacker News new | ask | show | jobs
by deepsun 25 days ago
And Redis has auto-delete rows (aka TTL). In Postgres you need a cron job to clear stale rows.
2 comments

You can create an index on an expires_at column and opportunistically DELETE on each write to the cache table.
This is one way to handle the problem, but not the only...