Configuring Data Pools for Automatic Data Deletion
The Data Hub Clean-up extension eliminates much of the processed data you are no longer using. However, there is potential for personal data to still exist, and you must delete the data periodically as well. Deleting personal data is where the Datahub-Retention-Cleanup extension applies.
Data Hub
Data Hub provides a clean-up extension designed to maintain Data Hub performance by reducing the processed data in the database. Even so, there is still a significant amount of data, potentially personal data, in the data pools. To address this issue, Data Hub has created the datahub-retention-cleanup extension, which actually builds on the clean-up extension by creating a structure for pool data management. The feature implements as part of the migration to a new version. The datahub-retention-cleanup extension is active by default..
DataHubPool's Deletable Attribute
DataHubPool has a deletable attribute. It indicates that the data stored in the given pool is eligible for automatic deletion. By default, the deletable attribute is set to true. If you create a new pool, you control whether the deletable attribute is true or false. If you don't specify, the attribute is set to true.
Backoffice
When listing and creating pools in Backoffice Data Hub Cockpit, the deletable attribute appears. Graphic and explanation of how it works.

Updating from a Previous Version
Datahub-Retention-Cleanup
- RawItem
- CanonicalItem, CanonicalItem_RawItem, CanItemPubStatus, PublicationError, PublicationRetry
- TargetItem
# In seconds. Default=30 days = 60 * 60 * 24 * 30 = 2592000 datahub.retention.cleanup.ttl.seconds=2592000 # The default value is 2592000 (30 days, in seconds)
Data Retention Considerations for High Volume Scenarios
In many scenarios, the standard Data Hub Cleanup extension has already removed most of the data before execution of the Data Retention Cleanup process. However, there are cases where items are not deleted by the standard Data Hub Cleanup extension. For example, Canonical items that are never published or archived are not eligible for deletion by the standard Data Hub Cleanup process. In some cases, you purposely create non-publishable, Canonical items and use them to perform SpEL lookups during Target item creation. In high volume scenarios, these items can accumulate in the database. The accumulation of huge amounts of data can impact Data Hub operational performance and should generally be avoided. Data Retention Cleanup execution time can also be impacted by this scenario. These items are eventually eligible for deletion when they exceed the configured TTL (default of 30 days) and are in a pool eligible for Data Retention Cleanup. The more items eligible for Data Retention Cleanup, the longer the process takes to complete. Compositions and Publications in a pool cannot proceed while Data Retention Cleanup is In Progress for the pool.
There are two strategies for handling the case where many items are eligible for Data Retention Cleanup causing prolonged cleanup execution times. The best option is to reduce the amount of data sent to Data Hub, which is not eligible for publication. In the case of IDOCs, steps can be taken to limit the data sent to Data Hub to reduce extraneous Idocs and Idoc segments. Docs here. Another option is to run the Data Hub Retention Cleanup process more frequently, so that there are fewer items to delete per execution. The datahub.retention.cleanup.execution.schedule property is a CRON expression that dictates the frequency the Data Retention Cleanup is run. The default value is "0 0 0 * * ?", which runs once per day at midnight.
Scheduling the Frequency of the Cleanup Activity
The Data Retention Cleanup Scheduler triggers a PerformDataRetentionCleanupEvent at a configurable interval specified by the datahub.retention.cleanup.execution.schedule property, which is set in your local.properties file. The property has a default value of "0 0 0 * * ?". The PerformDataRetentionCleanupEvent indicates that it's time to find all the expired items for a particular deletable pool, and delete them.
You use the cron expression to fine tune the exact time the cleanup event should occur. The datahub.retention.cleanup.ttl.seconds=2592000 setting specifies the frequency (30 days), but the cron expression specifies the exact time.
The cron expression is composed of six parts: second, minute, hour, day of month, month, day(s) of week where:

There can be special characters:
* - match any
*/X - every X
? - no specific value
Some examples:
0 0 0 * * ? = at midnight
*/10 * * * * * = every ten seconds
0 0 8-10 * * * = 8, 9 and 10 o'clock of every day
0 0/30 8-10 * * * = 8:00, 8:30, 9:00, 9:30 and 10 o'clock every day
DataRetentionCleanupActionHandler
The Datahub-Retention-Cleanup extension includes a DataRetentionCleanupActionHandler. The handler receives a PerformDataRetentionCleanupEvent and forwards it to the services that do the cleanup. When one of these services executes, it only selects and removes items based on poolId and timestamp. These two criteria represent the boundaries created by the deletable attribute and the datahub.retention.cleanup.ttl.seconds and the datahub.retention.cleanup.execution.schedule properties you calibrated.
- If a data retention cleanup is not in progress, the PerformDataRetentionCleanupEvent event enqueues in the Pool Queue for that pool
- If a data retention cleanup is already in progress, the DataRetentionCleanupActionHandler ignores the PerformDataRetentionCleanupEvent. Ignoring the PerformDataRetentionCleanupEvent provides time for other events (composition, publication) to execute without data retention cleanup taking all the processing time.
- If there's a PerformDataRetentionCleanupEvent enqueued and Data Hub is currently composing or publishing, the data retention cleanup happens immediately after the other event finishes.
- If a composition or publication event is in the queue and the queue is not active, the PerformDataRetentionCleanupEvent takes precedence over other events in the queue
During a data retention cleanup, no composition or publication can occur. However, data loading activities proceed normally even if a data retention cleanup is active. Also, you can still enqueue composition and publication events for a particular pool while data retention cleanup is happening. Data retention cleanup for a certain pool doesn't affect the composition or publication of a different pool.
Opting Out
- RawItem
- CanonicalItem, CanonicalItem_RawItem, CanItemPubStatus, PublicationError, PublicationRetry
- TargetItem