juspay / hyperswitch

An open source payments switch written in Rust to make payments fast, reliable and affordable
https://hyperswitch.io/
Apache License 2.0
12.61k stars 1.35k forks source link

[FEATURE] A script to vacuum expired data #6179

Open Chethan-rao opened 4 months ago

Chethan-rao commented 4 months ago

📝 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:

Submission Process:

Refer here for Terms and conditions for the contest.

Vikas350 commented 1 month ago

Hi @Chethan-rao I want to work on it, can you please assign it to me.

gorakhnathy7 commented 4 weeks ago

Sure @Vikas350 Assigning this to you, Happy coding!

gorakhnathy7 commented 3 weeks ago

Hey @Vikas350 Un-assigning the issue, as we haven't heard back from you, and these is another issue assigned to you as well.