juntossomosmais / django-outbox-pattern

A django application to make it easier to use the transactional outbox pattern
MIT License
50 stars 7 forks source link

Implement automatic deletion of old messages to reduce resource usage. #23

Closed ricardochaves closed 1 year ago

ricardochaves commented 1 year ago

Hello everyone,

I have identified an issue with our library that is causing it to unnecessarily consume resources by allowing the message tables to grow indefinitely. The problem is that the library is not currently set up to automatically delete old messages, which is resulting in a large and ever-growing database.

To address this issue, I propose that we implement a solution that will automatically delete messages after a certain period of time. I suggest setting a default retention period of 7 days, but also providing an option in the Django settings for users to configure the number of days to retain messages.

By implementing this solution, we can significantly reduce the amount of storage and processing power required to maintain our message tables, leading to improved performance and efficiency for our users. I am happy to take on the task of implementing this feature and would appreciate any feedback or suggestions you may have.