v8-archive icon indicating copy to clipboard operation
v8-archive copied to clipboard

Add revision storing limit

Open ventouris opened this issue 5 years ago • 9 comments

Hi everyone,

I encountered a serious issue lately and I was adviced in Slack to open a feature request here. The table directus_revisions ended up 17GB in size. So, it would be nice if we have a setting where we can choose the number of days or the last X changes on an item that we want to keep on the database. Otherwise, we risk that this table will become enormous.

Thank you

ventouris avatar Jan 03 '20 16:01 ventouris

Definitely! I've seen this quite a bit on client servers, and would love to have a "prune" option.

benhaynes avatar Jan 03 '20 18:01 benhaynes

We can achieve this in 2 ways.

  1. In every request, API will delete the revisions which was created before the number of days mentioned in the setting.
  2. Create a standalone API for this.

I'll prefer to go with the first one.

@directus/api - Let me know your thoughts.

binal-7span avatar Jan 10 '20 13:01 binal-7span

I don't know what you mean by option 2, but I think we should definitely have a auto-delete feature that is based on a given setting.

Should it be number of revisions instead of number of days? You can have a million updates in a day, but also have 5 revisions over 6 years.

I think we should have a setting that controls how many revisions to save, instead of how long to save them 🙂

rijkvanzanten avatar Jan 10 '20 15:01 rijkvanzanten

I agree — but think we should have both for exactly that reason. You should be able to set a total number of revisions before pruning, or a time to prune (defined in days?). Also, are we including activity in this... or just revisions? Lastly, should there be a way to manually/individually "lock" or "save" an important revision so it doesn't get deleted?

benhaynes avatar Jan 10 '20 16:01 benhaynes

DELETE /directus_activities/ID DELETE /directus_revisions/ID

As well as global option KEEP_MAXIMUM_ACTIVITIES/REVISIONS

Would both be great!

phoenixtechnam avatar Mar 15 '20 20:03 phoenixtechnam

Any news on this? I already have 6 GB of revisions in 10 days. Is possible to disable revisions for certain users?

Fabrimat avatar Apr 15 '20 16:04 Fabrimat

No news. You can write a custom script to prune this, upvote this issue in hopes that it gets done sooner, or find someone to sponsor its development.

benhaynes avatar Apr 15 '20 17:04 benhaynes

The v9 directus_activity and directus_revisions tables are growing in size without any means of limiting their growth. I'd also love to see some sort of configuration setting that controls how long entries are kept around either by age or by count so that the tables don't end up bloating the entire db.

megamorf avatar Feb 24 '22 18:02 megamorf

I upvote this it's getting rediculous, i noticed performance issues recently:

  • directus_revisions was nearly 6 million records & 8 GB in size
  • In tandem, directus_activity is also nearly 6 million records (much smaller in size around 600mb)

We need a way to manage this efficiently TBH...

wasims1 avatar Sep 29 '22 13:09 wasims1