Add TTL expiration rule#184
Conversation
Document best practices for using TTL in Azure Cosmos DB to manage data expiration automatically. Signed-off-by: era <avinashkamat48@gmail.com>
Signed-off-by: era <avinashkamat48@gmail.com>
Signed-off-by: era <avinashkamat48@gmail.com>
Signed-off-by: era <avinashkamat48@gmail.com>
TheovanKraay
left a comment
There was a problem hiding this comment.
The rule content is solid, especially the TTL mode breakdown and the RU behavior notes. One thing to fix:
Duplicate heading. The rule body has ## Use TTL for Automatic Data Expiration which creates a duplicate when compile.js generates the ### 1.11 heading above it. Please remove the ## heading from the source rule file and run npm run build again.
Also: we recently merged a skill split (#204) that added topic-specific skills alongside the monolith. We're in a transitional phase where both coexist while we evaluate whether agent routing can handle the split on its own. Until that's resolved, new rules need to live in both places. Since this is a model- prefixed rule, please copy skills/cosmosdb-best-practices/rules/model-ttl-expiration.md to skills/cosmosdb-data-modeling/rules/model-ttl-expiration.md and then run npm run build to regenerate AGENTS.md for both skills.
|
@avinashkamat48 there are some ongoing changes being evaluated to the structure that could require this to be modified. you'll definetely get notice when it's time to make any changes to avoid merge conflicts. |
Description
Adds a new Data Modeling rule recommending Azure Cosmos DB TTL for short-lived data with natural retention windows, such as session tokens, event logs, and temporary cache entries.
Type of Change
Checklist
npm run validateand it passednpm run buildto regenerate AGENTS.md{prefix}-{description}.mdtitle,impact,tags)Tests (Required)
evals/cosmosdb-best-practices/tasks/waza run evals/cosmosdb-best-practices/eval.yamland all tasks passid,name,description,inputs.prompt, andexpected.outcomesEval task file:
evals/cosmosdb-best-practices/tasks/model-ttl-expiration.yamlFor New Rules
Rule file:
skills/cosmosdb-best-practices/rules/model-ttl-expiration.mdCategory: Data Modeling
Impact level: Medium
Why is this rule important?
TTL avoids custom scheduled cleanup jobs for short-lived records and keeps retention behavior close to the data model. The rule covers container-level TTL, per-item overrides, common use cases, and important RU/background deletion behavior.
Agent Testing
Related Issues
Closes #166
Additional Notes
Validation notes:
npm run buildpasses and compiles 108 rules.npm run validatereports existing unrelated rule-format failures in files such asthroughput-container-vs-database.md, severalsdk-*rules,pattern-efficient-ranking.md,index-range-vs-hash.md,index-lazy-consistent.md, andglobal-consistency.md.wazais not installed in this environment, so the eval suite was not run locally.