Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement cleaner of expired buckets for RDBMS integrations(postgresql, oracle, mysql, mssql, mariadb). #465

Closed
vladimir-bukhtoyarov opened this issue Mar 22, 2024 · 2 comments
Labels
Milestone

Comments

@vladimir-bukhtoyarov
Copy link
Collaborator

Thoughts:

  • Should be optional feature, if it configured that yet another column "expires_at" should be added to table.
  • By default, "expires_at" column should not be required in order to avoid of breaking backward-compatibility.
  • Expiration policy should be configured in same way as for Redis and Hazelcast https://bucket4j.com/8.10.1/toc.html#configuring-flexible-per-entry-expiration
  • It should not be implemented as "DELETE WHERE expires_at < now()", because it can leads to massive transactions, as well as unpredictable conflicts with parallel updates, instead, it needs to carefully delete each particular bucket(deletes should be composed to batches in order to increase perfomance).
  • It needs to prevent of working multiple cleaners in parallel, through additional lock-table, or through user provided lock implementation.
@vladimir-bukhtoyarov
Copy link
Collaborator Author

For PostgreSQL clean up can be optimized as well as predictable with technique described there https://www.crunchydata.com/blog/simulating-update-or-delete-with-limit-in-postgres-ctes-to-the-rescue

@vladimir-bukhtoyarov
Copy link
Collaborator Author

Will be released in scope of 8.12.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant