A lifecycle allows you to model the movement of data from expensive, rapid storage, through various forms of cheaper slower storage as the data ages and access requirements diminish. The period during which data remain in each kind of storage are modeled as phases, which are associated with tablespaces.
Note: Data lifecycle modeling is supported for Sybase IQ v15.0 and higher.
You can attach any number of tables to a lifecycle, and create multiple lifecycles to provide different speeds and/or methods for data aging. Each table can only be associated with one lifecycle. A lifecycle can be:
-
Age-based - Data moves through the lifecycle in named partitions, remaining in each phase only for the specified retention period. The partitions move through the lifecycle in a predictable fashion and will become candidates for purging at the end of the lifecycle's total retention period.
-
Access-based - Tables (and any associated indexes) move through the lifecycle based on the permitted idle time for each phase, which specifies how long a table can remain in the phase without being accessed. Tables must remain in the lifecycle for (as a minimum) the total retention period, and their movement to the end of the lifecycle can be delayed indefinitely if the data they contain continue to be accessed.
The following diagram illustrates an age-based lifecycle covering a period of five years, which is divided into three phases:
- Phase 1 (3 months) - high performance (tier-1) storage for new data that is frequently accessed.
- Phase 2 (9 months) - nearline (tier-2) storage for data from the last year.
- Phase 3 (48 months) - historical (tier-3) storage for data that is infrequently accessed but which must be retained.
The data is packaged in partitions (P1, P2, and P3), which each contain one month of data:
PowerDesigner can generate all the necessary scripts to automate all this data movement. In the example above, scripts will be generated for every month of the lifecycle. At the point illustrated in the picture, the scripts will:
- Move partition P1 from the tablespace associated with Phase 1 to the tablespace associated with Phase 2.
- Create a new partition, P4, to begin collecting new table rows in the tablespace associated with Phase 1.
As the data ages, scripts will additionally treat the movement of data aged more than one year from the tablespace associated with Phase 2 to the tablespace associated with Phase 3.
Once a lifecycle is put in place, you can generate scripts to perform data movement indefinitely. Additional scripts are generated to regularly purge data that arrive at the end of their lifecycle.