Abstract: Apache Internet of Things Database (IoTDB) is a new open-source timeseries database management system. A distributed data management system not only needs to solve the problem of metadata synchronization between nodes caused by data partition and multiple replicas, but also needs to support efficient query request processing. To solve the problem of metadata synchronization among nodes, we propose a dual-layer granularity metadata management strategy. Based on the consistency hash partitioning method and Raft protocol, we designed a distributed framework that supports both strong consistency query and eventual consistency query. Based on the single-machine version of Apache IoTDB, we carried out the system implementation and experimental test. Compared with the single-level granularity management strategy, the test results showed that the two-level granularity metadata management strategy takes less memory resources and improves the write performance by $5\% \sim 10\%$. Also, the results showed that the read and write performance of the distributed Apache IoTDB increases linearly with the extension of cluster size.
Introduction
The Internet of Things (IoT) era has ushered in an explosion of time-series data. For instance, a single industrial asset like a wind turbine can generate hundreds of kilobytes of data every second. Managing this scale requires distributed database systems that can handle high-speed ingestion and complex queries. However, traditional distributed databases face significant challenges in IoT contexts: the overhead of synchronizing fine-grained metadata (like sensor types and permissions) across a cluster can exhaust memory, and rigid consistency models often fail to meet the diverse needs of different IoT applications.
This paper presents the design of a distributed framework for Apache IoTDB, specifically engineered to address these bottlenecks through optimized metadata management and a flexible consistency model.
Distributed Framework Design
The core of the distributed Apache IoTDB architecture is built upon the existing single-machine engine, enhanced with several key innovations to ensure scalability and performance.
Dual-Layer Granularity Metadata Management (DMM)
To prevent the "metadata explosion" common in large-scale sensor networks, the system employs a dual-layer strategy. Metadata is categorized into two tiers:
- Storage Group Metadata: This coarse-grained routing information is synchronized globally across all nodes using a dedicated Metadata Raft Group.
- Time Series Metadata: Fine-grained information (e.g., specific sensor data types) is stored only on the nodes responsible for that specific data partition, managed by Data Partition Raft Groups.
By decoupling high-level routing from low-level sensor details, the system significantly reduces the memory footprint on individual nodes and eliminates the need for cluster-wide consensus on every new time-series creation.
Consistency and Query Optimization
The framework utilizes the Raft consensus protocol but offers flexibility in how it is applied. For mission-critical data requiring strong consistency, queries are routed to the Raft Leader. For high-throughput scenarios like real-time monitoring, eventual consistency allows queries to be served by follower nodes, which verify their local "Apply" log index to ensure data freshness without a network round-trip to the leader.
Furthermore, the system implements Filter Tree Pruning. SQL WHERE clauses are pushed down to local nodes as binary trees, allowing nodes to filter data locally before transmission. This minimizes network traffic and accelerates distributed query processing.
Experimental Evaluation
The system was evaluated using the IoTDB-Benchmark, simulating a cluster environment with 20 storage groups and 100,000 total time series.
Key Performance Metrics
- Memory Efficiency: In a 10-node cluster, the DMM approach reduced metadata memory consumption from 1.91 GB (traditional single-layer approach) to just 0.57 GB.
- Write Throughput: By localizing time-series metadata operations, write performance improved by 5% to 10%.
- Query Performance: Eventual consistency queries demonstrated a nearly 30% speedup over strong consistency queries by bypassing leader-only bottlenecks.
- Scalability: The system demonstrated linear scalability in both read and write throughput as the cluster size increased from 4 to 10 nodes, outperforming competitors like KairosDB in write and query scalability tests.
Conclusion and Future Work
The distributed framework for Apache IoTDB successfully addresses the metadata and consistency challenges of IoT data management. The dual-layer metadata strategy and flexible Raft-based consistency model provide a robust foundation for massive-scale time-series storage. Future research will focus on enhancing elastic scaling capabilities, implementing more advanced load-balancing techniques, and exploring time-dimension partitioning to further optimize the handling of real-time versus historical data.
Summary updated