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.
The older data is deleted when you run a stream-data-delete task that acts on the stream; see
When setting up stream-data-delete task, it must have:
- either one or more stream added, 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 to manage 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.
Examples
Full Stream Sets
The table below assumes the stream to be archived currently contains 8 stream sets. Two from the current day and one from each of the previous 6 days.
In the table below the value null refers to the fact that no value has been entered into this field.
Note that archiving will always retain the maximum active stream sets in the data such that no conflicting stream sets will be archived.
Archive After X Days | Keeping Latest Y StreamSets | Resulting Streams Archived/Retained |
---|---|---|
null | null | No stream sets will be archived. |
0 | null | All stream sets will be archived |
1 | null | The last day of valid steam sets will be retained. All earlier stream sets will be archived. In our example the 2 latest stream sets will be retained with the earliest 6 stream sets archived. |
X | null | All stream sets which are older than X days before the latest valid stream set will be archived. |
null | 0 | All stream sets will be archived |
null | 1 | The last valid stream set will be retained, all other stream sets will be archived |
null | Y | The most recent Y valid stream sets will be retained, all others stream sets will be archived. |
0 | 0 | All stream sets will be archived |
0 | 1 | The last valid stream set will be retained, all other stream sets will be archived |
1 | 0 | The last day of valid steam sets will be retained. All earlier stream sets will be archived. |
1 | 1 | The last day of valid steam sets will be 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 will be retained instead. |
X | Y | Will retain the maximum active stream sets in the data such that no conflicting stream sets will be archived. |
Superseded Stream Sets
In the case where only the Keep Superseded for X Days and Keep Superseded for Y StreamSets fields are populated, the same logic in the table above will apply to the superseded records. Note that again archiving will always retain the maximum superseded stream sets in the data such that no conflicting stream sets will be archived.
In the cases where a mixture of the full archive fields Keep for X Days, Keep for Y StreamSets' and the superseded archive fields Keep Superseded for X Days, Keep Superseded for Y StreamSets are populated, then the full archive values will be first applied and the resultant stream item records will be archived and deleted. Only then will the remaining stream sets use the Keep Superseded ... values to apply a further condition to archive and delete any remaining non qualifying superseded records.