Skip to main content

Tiered Storage

...About 3 min

Tiered Storage

Overview

The Tiered storage functionality allows users to define multiple layers of storage, spanning across multiple types of storage media (Memory mapped directory, SSD, rotational hard discs or cloud storage). While memory and cloud storage is usually singular, the local file system storages can consist of multiple directories joined together into one tier. Meanwhile, users can classify data based on its hot or cold nature and store data of different categories in specified "tier". Currently, IoTDB supports the classification of hot and cold data through TTL (Time to live / age) of data. When the data in one tier does not meet the TTL rules defined in the current tier, the data will be automatically migrated to the next tier.

Parameter Definition

To enable tiered storage in IoTDB, you need to configure the following aspects:

  1. configure the data catalogue and divide the data catalogue into different tiers
  2. configure the TTL of the data managed in each tier to distinguish between hot and cold data categories managed in different tiers.
  3. configure the minimum remaining storage space ratio for each tier so that when the storage space of the tier triggers the threshold, the data of the tier will be automatically migrated to the next tier (optional).

The specific parameter definitions and their descriptions are as follows.

ConfigurationDefaultDescriptionConstraint
dn_data_dirsNonespecify different storage directories and divide the storage directories into tiersEach level of storage uses a semicolon to separate, and commas to separate within a single level; cloud (OBJECT_STORAGE) configuration can only be used as the last level of storage and the first level can't be used as cloud storage; a cloud object at most; the remote storage directory is denoted by OBJECT_STORAGE
default_ttl_in_msNoneDefine the maximum age of data for which each tier is responsibleEach level of storage is separated by a semicolon; the number of levels should match the number of levels defined by dn_data_dirs;"-1" means "unlimited".
dn_default_space_move_thresholds0.15Define the minimum remaining space ratio for each tier data catalogue; when the remaining space is less than this ratio, the data will be automatically migrated to the next tier; when the remaining storage space of the last tier falls below this threshold, the system will be set to READ_ONLYEach level of storage is separated by a semicolon; the number of levels should match the number of levels defined by dn_data_dirs
object_storage_typeAWS_S3Cloud Storage TypeIoTDB currently only supports AWS S3 as a remote storage type, and this parameter can't be modified
object_storage_bucketNoneName of cloud storage bucketBucket definition in AWS S3; no need to configure if remote storage is not used
object_storage_endpoiontendpoint of cloud storageendpoint of AWS S3;If remote storage is not used, no configuration required
object_storage_access_keyAuthentication information stored in the cloud: keyAWS S3 credential key;If remote storage is not used, no configuration required
object_storage_access_secretAuthentication information stored in the cloud: secretAWS S3 credential secret;If remote storage is not used, no configuration required
remote_tsfile_cache_dirsdata/datanode/data/cacheCache directory stored locally in the cloudIf remote storage is not used, no configuration required
remote_tsfile_cache_page_size_in_kb20480Block size of locally cached files stored in the cloudIf remote storage is not used, no configuration required
remote_tsfile_cache_max_disk_usage_in_mb51200Maximum Disk Occupancy Size for Cloud Storage Local CacheIf remote storage is not used, no configuration required

local tiered storag configuration example

The following is an example of a local two-level storage configuration.

//Required configuration items
dn_data_dirs=/data1/data;/data2/data,/data3/data;
default_ttl_in_ms=86400000;-1
dn_default_space_move_thresholds=0.2;0.1

In this example, two levels of storage are configured, specifically:

tierdata pathdata rangethreshold for minimum remaining disk space
tier 1path 1:/data1/datadata for last 1 day20%
tier 2path 2:/data2/data path 2:/data3/datadata from 1 day ago10%

remote tiered storag configuration example

The following takes three-level storage as an example:

//Required configuration items
dn_data_dirs=/data1/data;/data2/data,/data3/data;OBJECT_STORAGE
default_ttl_in_ms=86400000;864000000;-1
dn_default_space_move_thresholds=0.2;0.15;0.1
object_storage_name=AWS_S3
object_storage_bucket=iotdb
object_storage_endpoiont=<your_endpoint>
object_storage_access_key=<your_access_key>
object_storage_access_secret=<your_access_secret>

// Optional configuration items
remote_tsfile_cache_dirs=data/datanode/data/cache
remote_tsfile_cache_page_size_in_kb=20971520
remote_tsfile_cache_max_disk_usage_in_mb=53687091200

In this example, a total of three levels of storage are configured, specifically:

tierdata pathdata rangethreshold for minimum remaining disk space
tier1path 1:/data1/datadata for last 1 day20%
tier2path 1:/data2/data path 2:/data3/datadata from past 1 day to past 10 days15%
tier3Remote AWS S3 Storagedata from 1 day ago10%
Last update:

Copyright © 2024 Timecho Limited All rights reserved.