lab_code: demo_019
title_en: Working with Time to Live (TTL) - Basic(v7.1+)
title_zh: 使用 Time to Live (TTL) - 基础 (v7.1+)
title_ja: Time to Live (TTL)を活用する - 基本 (v7.1+)
title_ko: Time to Live (TTL) 엔진 활용 - 기본 사항(v7.1+)
description_en: "In this practice, participants will learn how to use Time to Live (TTL). This feature allows you to manage TiDB data lifetime at the row level. For a table with the TTL attribute, TiDB automatically checks data lifetime and deletes expired data at the row level. This feature can effectively save storage space and enhance performance in some scenarios."
description_zh: "在本实验中，参与者将学习如何使用 Time to Live (TTL)。Time to Live (TTL) 提供了行级别的生命周期控制策略。通过为表设置 TTL 属性，TiDB 可以周期性地自动检查并清理表中的过期数据。此功能在一些场景可以有效节省存储空间、提升性能。"
description_ja: "本演習では、受講者は Time to Live (TTL) を使用する方法を学びます。この機能は、行レベルで TiDB データの有効期間を管理できる機能です。TTL 属性を持つテーブルの場合、TiDB は自動的にデータの有効期間をチェックし、行レベルで期限切れのデータを削除します。この機能により、一部のシナリオではstorageスペースを効果的に節約し、パフォーマンスを向上させることができます。"
description_ko: "In this practice, participants will learn how to use Time to Live (TTL). This feature allows you to manage TiDB data lifetime at the row level. For a table with the TTL attribute, TiDB automatically checks data lifetime and deletes expired data at the row level. This feature can effectively save storage space and enhance performance in some scenarios."
splash_image_en: https://lab-static.pingcap.com/images/2025/9/16/be7bb6a202cdcb65ce041579406bb59238414633.png
splash_image_zh: https://lab-static.pingcap.com/images/2025/9/16/be7bb6a202cdcb65ce041579406bb59238414633.png
splash_image_ja: https://lab-static.pingcap.com/images/2025/9/16/be7bb6a202cdcb65ce041579406bb59238414633.png
splash_image_ko: https://lab-static.pingcap.com/images/2025/9/16/be7bb6a202cdcb65ce041579406bb59238414633.png
lab_level: Advanced
category_en:
  - Foundational Capability
category_zh:
  - 基础能力
category_ja:
  - 基礎能力
category_ko:
  - 기초 능력
authors:
  - Dong Fei (CEG)
delivery_type: Self-Paced
tidb_environments:
  - TiDB Self-Managed
tidb_versions:
  - 8.5.1
target_audience:
  - Architect
  - DBA
  - DevOps
regions:
  aws:
    - oregon
    - tokyo
    - singapore
    - frankfurt
credits: 5
credit_redeemable: true
employee_only: false
estimated_duration_minutes: 45

topology:
  - role: monitor
    node_count: 1
    web_ssh: true
    web_ssh_name: "TiUP Control Machine"
    ssh_user: ec2-user
  - role: pd
    node_count: 1
  - role: kv
    node_count: 3
  - role: db
    node_count: 2
  - role: tiflash
    node_count: 1
  - role: tiproxy
    node_count: 1

requirements:
  - type: "CloudStack"

bootstrap:
  - name: "prepare monitor"
    type: "ShellScript"
    target:
      - monitor1
    script: ./scripts/prepare-monitor.sh

features:
  enable_content_explain: false
