DataAging CDS Annotation in genomic data that characterize a gene’s coding sequences (CDS) are referred to as CDS annotations. The portion of a gene that is actually translated into a protein is called a coding sequence (CDS). The location, composition, and boundaries of these coding sections inside a gene are described by CDS annotations in the context of genome annotation.
If you have not read CDS Annotations Previous blog then you can read from here CDS Annotations in SAP – 3
DataAging-Annotations CDS Annotations
Businesses can more effectively manage the storage, preservation, and access of data by using the idea of data aging, which classifies data according to its age or usefulness. DataAging CDS annotations aid in the classification of data into various “age” categories within the framework of ABAP CDS. The classification enables businesses to implement distinct storage rules or performance enhancements according to the “ancient” status of the data.
Older, less-used data might be relocated to slower, less expensive storage, while recently accessed data might be kept in high-performance, costly storage. In large-scale systems, where effectively handling massive amounts of data can greatly enhance performance and lower operating expenses, this idea is essential.
DataAging Annotation Syntax
DataAging CDS annotations are defined directly in the ABAP CDS view definition. The annotation typically specifies the field that determines the “age” of the data. The field can be any date, time, or timestamp-based column that represents when the data was created, last modified, or archived.
The basic syntax for applying a DataAging CDS annotation in ABAP CDS is as follows:
@DataAging.strategy: #Categorization
@DataAging.timeField: 'FIELD_NAME'
define view ZMyDataView as select from ZTable
{
key field1,
field2,
field3,
...
}
Here:
@DataAging.strategy: #Categorization
: This defines the DataAging strategy. The strategy can be Categorization, where data is assigned to specific age categories, or Archiving, where the data is archived.@DataAging.timeField: 'FIELD_NAME'
: This annotation refers to the field that holds the timestamp or date information to calculate the age of the data. It could be fields likecreated_at
orlast_modified
.
DataAging Field
The @DataAging.timeField
annotation points to the field in the database that contains the date or timestamp value used for aging. This field is critical as it is the basis for classifying the data into age categories.
For example:
- Creation Date (
created_on
) - Last Modified Date (
last_updated_on
)
Here’s an example of how this might be set up in ABAP CDS:
@DataAging.strategy: #Categorization
@DataAging.timeField: 'created_on'
define view ZMyDataView as select from ZTable
{
key field1,
field2,
field3,
created_on
}
DataAging.noAgingRestriction CDS Annotations
The DataAging.noAgingRestriction annotation is a very recent addition to ABAP Core Data Services (CDS). Within a CDS view, this annotation enables developers to fine-tune how data aging policies are applied to particular fields or tables. Specifically, noAgingRestriction aids in allowing for freedom in the definition of aging rules, guaranteeing that data can be suitably categorized without certain restrictions that conventional data aging techniques might impose.
prior to beginning DataAging.Before implementing noAgingRestriction, it’s critical to comprehend the idea of data aging in relation to ABAP CDS views.
In order to maximize storage, access, and performance, data aging is the process of classifying data according to its “age” (or time-based relevance). For instance:
Hot data: Information that must be kept on high-performance systems and is regularly accessed.
Warm data: Information that can be kept on medium-tier storage and is occasionally accessed.
Cold data: Information that can be stored in slower, less expensive storage that is rarely accessed.
Syntax of DataAging.noAgingRestriction
The DataAging.noAgingRestriction
annotation is typically applied to specific fields or entities in a CDS view where you want to exclude them from the data aging process.
Here is an example of how you might use noAgingRestriction
in a CDS view:
@AbapCatalog.sqlViewName: 'ZSALESORDER'
@DataAging.strategy: #Categorization
@DataAging.timeField: 'created_on'
define view ZSalesOrders as select from sales_order
{
key order_id,
customer_id,
order_amount,
created_on,
@DataAging.noAgingRestriction: true
order_status // Field marked as exempt from data aging rules
}
In the example above:
- The
created_on
field determines how the data is categorized (e.g., hot, warm, cold) based on the age of the record. - The
order_status
field is marked with the@DataAging.noAgingRestriction
annotation, meaning it will not be subjected to the data aging process. Even if thesales_order
data is classified as cold or warm based on thecreated_on
field, theorder_status
field will remain unaffected by aging policies.