Multi-tier storage overview
Multi-tier storage places recent hot data on high-speed media and cold data on low-cost media.
Core benefits include lower storage costs, higher write performance, easier maintenance and management, and SQL transparency.
How it works
Data flows through three tiers: hot data resides on SSD or high-speed storage for frequent access, warm data moves to HDD for medium-frequency access, and cold data is archived to low-cost storage.
Configuration
Creating storage tiers
Enable multi-tier storage on the database:
ALTER DATABASE demo SET MULTI_TIER 1;
Configure mount points for each tier:
ALTER MOUNT 'tier0' PATH '/ssd/data';
ALTER MOUNT 'tier1' PATH '/hdd/data';
Configuration parameters
The following parameters control multi-tier storage behavior:
multiTierEnable yestier0Path /ssd/datatier1Path /hdd/data
Performance characteristics
Write performance
Tier 0 (SSD) achieves 300 million measurements per second with a parallel write speed of 2 GB/s.
Query transparency
Regardless of where data physically resides, a single SQL query retrieves all matching records. For example:
SELECT * FROM demo.meters WHERE ts > '2023-01-01' AND ts < '2024-01-01';
Cost reduction
Storage cost comparison
The following table compares storage options across cost and performance dimensions:
| Storage tier | Cost (per TB/month) | Write performance | Access frequency | Use case |
|---|---|---|---|---|
| SSD | 100 yuan | Highest | High | Recent hot data (0 to 7 days) |
| HDD | 20 yuan | Medium | Medium | Warm data (7 to 30 days) |
| Low-cost storage | 5 yuan | Lower | Low | Cold archived data (30+ days) |
Tiering strategies
A recommended tiering policy:
- Last 7 days: SSD
- 7 to 30 days: HDD
- 30+ days: low-cost storage
Maintenance
Automatic data migration
Data migration between tiers runs automatically in the background. No manual intervention is required, and the process is transparent to applications.
Flexible expansion
Adding storage nodes is straightforward. The system supports online expansion without disrupting running workloads.
Best practices
Configuration
CREATE DATABASE demo (KEEP 365, CACHE 256);
ALTER DATABASE demo DATA_RETENTION_POLICY 'tiered';
Monitoring
SELECT * FROM INFORMATION_SCHEMA.INS_MOUNTS;
Summary
Multi-tier storage reduces storage costs, automates data distribution across tiers, provides transparent queries, and supports online expansion.


