Configure Time-Series Data Retention
ThingsBoard Cloud stores time-series data in Cassandra and automatically deletes records older than their configured Time-to-Live (TTL).
Default retention
Section titled “Default retention”Your subscription plan determines the default retention for time-series data. Each plan has its own Default storage TTL. See Subscription Plans, Storage retention for the values that apply to your tier.
Every persisted record lives up to that default, unless you configure a shorter TTL at the entity level.
Entity-level TTL
Section titled “Entity-level TTL”Cassandra supports a specific TTL per entity. Two options let you configure it:
- Rule Chain: The Save Time Series rule node in your rule chain writes raw telemetry to the database. Its Default TTL field determines how long each record lives, and the
TTLmessage-metadata property can override it on a per-message basis. Set a shorter TTL here when raw readings are only useful for a short operational window. See Save Time Series, Advanced settings for the full option set. - Calculated Fields: Any calculated field can carry its own TTL for the values it produces. The TTL property is exposed on the field when Output type is set to Time series and Output strategy is set to Process right away. See Calculated Fields, Output strategy for details.
Together these enable multi-level retention. Raw telemetry can expire quickly, while derived values produced by calculated fields live on independently, each with the TTL that matches its own analytical purpose. Read more in the Efficient Aggregation and Data Retention in ThingsBoard blog post.