Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Cold and Hot Data Separation

Updated on 2023-11-21 GMT+08:00

GeminiDB Influx allows you to separate cold and hot data based on the retention policy (RP). You can configure data retention duration and number of backups, and then the system automatically archives hot data that meets the conditions to cold storage.

Background

In big data scenarios, cold data and hot data is distinguished. Historical time-series data is less likely to be queried and analyzed as time goes by. In addition, the historical data will take up space that may increase storage costs. Therefore, it is necessary for enterprises to reduce cold data storage costs. GeminiDB Influx provides cold and hot data separation and uses low-cost media to store cold data. It can help you greatly reduce storage costs in just a few clicks.

Cold and hot data separation is based on the RP. You need to set a time boundary between cold and hot data in the RP, and the system will automatically archives cold data to cold storage. When you query data, the system will automatically retrieve it from hot or cold data storage based on the time range you specify.

Principles

You can configure the retention period of hot data. When data is written, it is stored in the hot storage first. GeminiDB Influx determines whether the data is hot or cold based on the data timestamp. If the data timestamp is within the hot data storage duration, the data is still hot. Otherwise, the hot data will be automatically archived in cold storage.

Figure 1 Diagram

Basic Usage

  1. Set the cold and hot time boundary.

    Specify WARM DURATION in the RP. Data generated before the value of WARM DURATION is cold data.

    To set WARM DURATION, perform the following steps:

    //Create an RP named myrp for database named mydb. The value of WARM DURATION is 6d, indicating that data generated six days ago is cold data.
    create retention policy myrp on mydb duration 30d replication 1 warm duration 6d shard duration 3d
    //Create an RP named myrp for database mydb. If WARM DURATION is not specified, no cold data exists.
    create retention policy myrp on mydb duration 30d replication 1 shard duration 3d
    //Create a database named mydb with an RP named myrp. The value of WARM DURATION is 3d, indicating that data generated three days ago is cold data.
    create database mydb with duration 6d warm duration 3d name myrp
    //Change the value of WARM DURATION to 7d, indicating that data generated seven days ago is cold data.
    alter retention policy myrp on mydb warm duration 7d
  2. Write data to the storage.

    Hot and cold data is written in the same way. Data is first stored in the hot storage when being written. As time goes by, if the timestamp of the data in the hot storage exceeds the value of WARM DURATION, the system automatically archives the data to the cold storage. This process is completely transparent to the user.

  3. Query data.

    The methods for querying hot and cold data are the same. During data query, the system automatically queries hot or cold storage based on the TimeRange condition in the query statement. This process is completely transparent to the user. The response to a cold data query is longer than that to a hot data query.

  4. Check the status of hot and cold data.
    > show shards
    name: _internal
    id database  retention_policy shard_group start_time           end_time             expiry_time          owners tier
    -- --------  ---------------- ----------- ----------           --------             -----------          ------ ----
    1  _internal monitor          1           2021-06-29T00:00:00Z 2021-06-30T00:00:00Z 2021-07-07T00:00:00Z 4      warm
    2  _internal monitor          1           2021-06-29T00:00:00Z 2021-06-30T00:00:00Z 2021-07-07T00:00:00Z 5      warm
    3  _internal monitor          1           2021-06-29T00:00:00Z 2021-06-30T00:00:00Z 2021-07-07T00:00:00Z 7      warm
    4  _internal monitor          1           2021-06-29T00:00:00Z 2021-06-30T00:00:00Z 2021-07-07T00:00:00Z 6      warm
    
    name: hsdb
    id database retention_policy shard_group start_time           end_time             expiry_time          owners tier
    -- -------- ---------------- ----------- ----------           --------             -----------          ------ ----
    5  hsdb     myrp             2           2019-08-12T00:00:00Z 2019-08-19T00:00:00Z 2019-08-19T00:00:00Z 4      cold
    6  hsdb     myrp             2           2019-08-12T00:00:00Z 2019-08-19T00:00:00Z 2019-08-19T00:00:00Z 5      moving
    7  hsdb     myrp             2           2019-08-12T00:00:00Z 2019-08-19T00:00:00Z 2019-08-19T00:00:00Z 6      warm
    8  hsdb     myrp             2           2019-08-12T00:00:00Z 2019-08-19T00:00:00Z 2019-08-19T00:00:00Z 7      cold
    • If the tier value is cold, the current shard stores cold data.
    • If the tier value is warm, the current shard store hot data.
    • If the tier value is moving, the current shard is being changed from hot data to cold data.
    • The process of changing hot data to cold data involves only the transfer of TSM files from hot storage to cold storage. Other files of the shard are still stored in hot storage and do not need to be moved.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback