Eight-Five Information new energy power Internet of things platform uses TDengine to store, query and analyze real-time data of Internet of things devices, as well as telemetry data of photovoltaic equipment sensors. It needs to support real-time data access, processing and storage of at least 50,000 devices with a total of 4 million measurement points, with an estimated increase of more than 4 billion pieces per day. The previous use of TimeScaleDB encountered bottlenecks in both read and write performance and hardware resources, with no clustering capability. Then I switched to TDengine, which improved the read-write performance by 10 times and reduced the storage cost by about 1/5.

Introduction to usage scenarios

Current business scenario

We first used TDengine on the new energy power Internet of Things platform, which is mainly used for the storage, query and analysis of real-time telemetry data of photovoltaic equipment.

The production and operation platform of the new energy Internet of Things integrates the data of the existing power station through the Internet of Things and big data technology, so as to realize the unified operation and monitoring of the equipment in the park and the centralized management of data. Provide comprehensive, convenient and differentiated data and services to different personnel.

Provide the operation and maintenance personnel with equipment status information, alarm information, remote fault diagnosis information, real-time data and other data application services; To provide management and operation personnel with all kinds of testing data summary, change trend and other application services. The overall architecture of the platform system is as follows:

The overall architecture of the system is based on the design concept of layered implementation, and the function separation of each software system is realized in the bottom design to ensure the efficient operation of each part.

Data size, query pressure and other requirements

The planned and designed data storage scale is about 16T. At present, the daily increment of data is more than 100 million. After all measurement points are connected, the daily increment is expected to be more than 4 billion pieces. The system is required to support real-time data access, processing and storage of at least 50,000 devices with a total of 4 million measurement points (semaphore and analogue).

The regular query of the application system is around 50Qps, and the high concurrency is around 100Qps. The maximum span of a historical data query analysis is one year, and it supports multi-point and multi-mode analysis. The interface of time series data analysis is as follows:

Real-time display interface of working conditions:

Current total data volume and daily increment:



Number of supertables and child tables created:

Introduction to the data model

At present, different super tables have been established according to different measuring point types. Different child tables are created with different test point IDs and test point numbers as TAG. In this way, we can directly analyze the single table for the measuring point, and the processing performance is high and the speed is fast. It can also analyze multiple measurement points and directly operate the super table, which is easy to implement and gives consideration to the query performance.

The query demand

· Simple query

Historical data query analysis and time interval aggregation analysis for single measurement point. It is mainly to check the abnormal data of single measuring point and check and confirm the alarm data. TDEngine classifies the data of similar devices into a super table, but each device will establish its own sub-table according to the structure of the super table. In fact, querying the data of a single measuring point only queries one sub-table, and the amount of traversed data is greatly reduced, and the query analyzes the response at the level of basic milliseconds. SQL legend for simple query:

· Aggregate queries

Comparative analysis of time migration of different aggregation types in the same time dimension for multiple measurement points. Focusing on comparison, it is convenient for users to more effectively confirm the abnormality and difference under different measurement points.

· Group and aggregate queries of large quantities of measurement points

Grouped query of hundreds of test points in different time segments; In a certain period of time, the query of a large number of measurement points can still respond quickly.

Query pressure

The peak concurrency is 100Qps, and the average concurrency is 20Qps. In the actual scenario, the pressure of concurrency query is small, and it fails to reach the query bottleneck of TDEngine.

The benefits of adopting TDEngine

System function

The read-write performance is about 10 times higher than the original TimeScaleDB database, and there is no need to worry about the database write performance bottleneck in the data access layer. The application layer of data analysis query also has a great improvement compared with the original system, especially in the analysis of almost instantaneous response of aggregation class with a large time span.

The out-of-order insertion function solves the out-of-order writing problem caused by the delay of data transmission due to network problems at the edge side, and ensures the integrity of data.

Clustering is an advantage over TimeScaleEDB, which does not have clustering but supports both primary and standby libraries for stream replication. TDEngine cluster is easy to set up and has no distinction between master and slave nodes. It is friendly to application transformation and support, and the read-write performance of the cluster version is improved greatly.

Data storage increases the function of cluster multiple copies, which improves the security and reliability of the system through data redundancy and reduces the cost of operation and maintenance of the system.

Hardware and software resources

The system saves a lot of computing resources and storage resources, and reduces the storage cost by about 4 times.

Compared with the use of TDengine before the use of TimescaleDB sequence library compression on 7 billion data occupied 165G disk, and can not query a month of historical data within a minute; With Tdengine, the disk footprint is around 40GB, and the millisecond level returns an aggregated query for a month of historical data. Related enquiries are as follows:

Problems and solutions in application of TDEngine

The original timing library imported large amount of data into TDEngine in batches, but it was very troublesome to import in batches in 1.6 version, with only about 200 pieces inserted in batches at a time. After upgrading to 2.0 version or above, 1M data could be inserted at a time, which greatly improved the performance of batch import between different databases and different table structures.

Considerations for future use of TDEngine

After a period of online operation, Tdengine has shown excellent performance and we have decided to gradually update all of our IoT projects to Tdengine in the future.

Expected and suggested analysis function enhancement in the function of TDengine, hoping to increase the practical common analysis function in the timing library;

Enhance the query function of continuous aggregation, which is not practical at present;

Product ecology, integration with open source analytics tools such as Spark and Flink.

Author: Li Liangzheng, 85 Information Development Engineer