juspay/hyperswitch

[FEATURE] A script to vacuum expired data

Open

#6,179 opened on Jul 12, 2024

View on GitHub
 (4 comments) (0 reactions) (0 assignees)Rust (42,690 stars) (4,676 forks)batch import
hacktoberfesthelp wanted

Description

📝 Feature Description We need to develop and implement a vacuuming script to automatically delete expired card data from the database, enhancing our data security measures. This script will run as a cron job at regular intervals (e.g., every 24 hours) to maintain database hygiene and reclaim disk space.

The script should perform the following tasks:

  1. Identify expired cards in the database using the ttl field.
  2. Delete expired entries directly from the database.
  3. Initiate a database vacuuming job after deletion to reclaim disk space.

🔨 Possible Implementation

  1. Create a new script file for the vacuuming process.
  2. Implement database connection and query functionality to identify expired cards.
  3. Develop a secure method to delete expired entries from the database.
  4. Integrate a mechanism to initiate database vacuuming after deletion.
  5. Set up error handling and logging throughout the script.
  6. Create a cron job configuration to run the script at specified intervals.
  7. Implement performance optimizations to handle large datasets efficiently.
  8. Add monitoring and alerting for script execution and any potential issues.

🔖 Note: Technical Considerations:

  • The script must operate securely without exposing any sensitive data during the process.
  • Optimize the script for performance to handle large datasets efficiently, without blocking or hindering the performance of the locker.
  • Implement proper error handling and logging mechanisms to track the script's operation and any issues that arise.
  • Consider implementing a dry-run mode for testing purposes.
  • Ensure the script is compatible with the existing database schema and any future planned changes.

Submission Process:

  • Ask the maintainers for assignment of the issue, you can request for assignment by commenting on the issue itself.
  • Once assigned, submit a pull request (PR).
  • Maintainers will review and provide feedback, if any.
  • Maintainers can unassign issues due to inactivity, read more here.

Refer here for Terms and conditions for the contest.

Contributor guide