This page is for data modellers or administrators who need to manage stream data retention and deletion.
How to Configure Stream Data Retention and Deletion
When a data modeller creates a stream they should set up the Data Retention Settings to specify the:
- number of days to keep stream sets and superseded records
- number of stream sets or stream sets with superseded records to keep.
...
- either one or more specific streams. You may choose to do this, for example:
- to manage the data in several related streams
- to run frequently on a stream that contains a large amount of data.
- to run occasionally on streams with low volumes of data that change rarely.
- or have the All Streams option ticked. The task will run on all streams:
- that are not in another stream-data-delete task
- and have Data Retention Settings configured.
Managing Stream Sets
Anchor | ||||
---|---|---|---|---|
|
The following table shows the different combinations of settings in stream properties → Data Retention Settings. It assumes that a stream currently contains 8 stream sets:
...
Delete After X Days | Keeping Latest Y StreamSets | Action taken when stream-data-delete task runs |
---|---|---|
null | null | All streams sets are retained. |
0 | null | All stream sets are deleted. |
1 | null | The last day of valid steam sets are retained. All earlier stream sets are deleted. In our example the 2 most recent stream sets will be retained with the 6 older stream sets deleted. |
N | null | All stream sets older than N days before the latest valid stream set are deleted. |
null | 0 | All stream sets are deleted. |
null | 1 | The most recent valid stream set is retained, all other stream sets are deleted. |
null | X | The most recent X valid stream sets are retained, all others stream sets are deleted. |
0 | 0 | All stream sets are deleted. |
0 | 1 | The most recent valid stream set is retained, all other stream sets are deleted. |
1 | 0 | The last day of valid steam sets are retained. All older stream sets are deleted. |
1 | 1 | The last day of valid steam sets are retained regardless of if there are more than 1. If there are no stream sets in the last day, then the first previous stream set is retained instead. |
N | X | Retains the maximum number of active stream sets in the data, such that no conflicting stream sets are deleted. |
Superseded Stream Sets
Anchor | ||||
---|---|---|---|---|
|
If only Keep Superseded for N Days and Keep Superseded for X StreamSets fields are populated, the same logic in the table above applies to the superseded records.
...