cancel
Showing results for 
Search instead for 
Did you mean: 

Purge data from Activiti history tables

ganeshr
Champ in-the-making
Champ in-the-making
Hi,

   I have implemented workflow using Activiti, now the issue is the data in history table is growing larger as we have set the history level to full. We cannot set the history level to low, as we need the history data for generating reports. Is there a best way to purge the data from Activiti history table's other than setting history level to low. Please suggest.
3 REPLIES 3

felipe1
Champ in-the-making
Champ in-the-making
you could create a scheduled task that would backup the entire table and then delete data that was older than a certain treshold.

Example: every month the script would delete data older than 1 month.

abhinandan
Champ in-the-making
Champ in-the-making
Hi, the history documentation ( http://www.activiti.org/userguide/#historyConfig), says the following:
////
Since the DB contains historic entities for past as well as ongoing instances, you might want to consider querying these tables in order to minimize access to the runtime process instance data and that way keeping the runtime execution performant.
///

Should care be taken to make sure the scheduled job executes in the low/no traffic time to ensure there is no impact on the runtime execution performance.  Is there a recommended partitioning strategy / purge frequency strategy that could be followed?

jbarrez
Star Contributor
Star Contributor
Yes, in the sense that any traffic on the database will impact performance of the other queries.

It's typically best practice to have data cleanups scheduled for the night or weekend I would guess.