TDengine — High-Performance Time-Series Database for IoT
TDengine is a purpose-built time-series database optimized for IoT and industrial data. It delivers 10x compression and 10x query speed over general-purpose databases.
Agent 可直接安装
这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。
npx -y tokrepo@latest install 2b6840a2-399f-11f1-9bc6-00163e2b0d79 --target codex先 dry-run 确认安装计划,再运行此命令。
What it is
TDengine is a purpose-built time-series database optimized for IoT, industrial telemetry, and monitoring data. It combines a storage engine designed for time-series patterns with built-in caching, stream processing, and data subscription in a single platform. The SQL-compatible interface means teams can adopt it without learning a new query language.
TDengine targets IoT platform teams, DevOps engineers collecting metrics, and any organization dealing with high-volume time-stamped data that outgrows general-purpose databases.
How it saves time or tokens
General-purpose databases like PostgreSQL or MySQL waste storage on time-series data because they lack column-oriented compression tuned for sequential timestamps. TDengine's columnar storage with domain-specific compression achieves up to 10x better compression ratios. Queries on time ranges are also faster because the engine skips irrelevant blocks at the storage level. Built-in stream processing eliminates the need for separate Kafka or Flink pipelines for basic aggregations.
How to use
- Start TDengine with Docker:
docker run -d -p 6030:6030 -p 6041:6041 tdengine/tdengine
- Connect via the CLI client:
taos
- Create a database and insert data:
CREATE DATABASE demo;
USE demo;
CREATE STABLE meters (ts TIMESTAMP, voltage FLOAT, current FLOAT) TAGS (location VARCHAR(64), group_id INT);
CREATE TABLE meter_01 USING meters TAGS ('factory_a', 1);
INSERT INTO meter_01 VALUES (NOW, 220.5, 1.2);
SELECT AVG(voltage) FROM meters WHERE ts > NOW - 1h GROUP BY location;
Example
Using TDengine's super-table pattern for IoT devices:
-- Create a super-table (schema template)
CREATE STABLE sensors (
ts TIMESTAMP,
temperature FLOAT,
humidity FLOAT
) TAGS (device_id VARCHAR(32), floor INT);
-- Auto-create sub-tables per device
INSERT INTO d_abc USING sensors TAGS ('abc', 3)
VALUES (NOW, 23.5, 45.2);
-- Query across all devices
SELECT device_id, AVG(temperature)
FROM sensors
WHERE ts > NOW - 24h
GROUP BY device_id;
Related on TokRepo
- AI Tools for Database — database tools and management utilities
- AI Tools for Monitoring — monitoring and observability platforms
Common pitfalls
- TDengine's super-table model requires planning your tag structure upfront; poorly chosen tags lead to inefficient queries
- The REST API (port 6041) and native protocol (port 6030) serve different use cases; use the native protocol for high-throughput ingestion
- Cluster mode requires at least 3 nodes for data replication; single-node deployments cannot be non-disruptively expanded to clusters
常见问题
Both are time-series databases. TDengine uses a SQL interface while InfluxDB uses Flux or InfluxQL. TDengine's super-table model is unique for IoT scenarios where thousands of similar devices share a schema. InfluxDB has a larger ecosystem of integrations.
A super-table is a schema template in TDengine. You define the columns and tags once, then TDengine automatically creates a sub-table for each unique combination of tag values. This is designed for IoT where thousands of devices share the same data structure.
Yes. TDengine supports a SQL-compatible query language with extensions for time-series operations like downsampling, interpolation, and window functions. Most standard SQL knowledge transfers directly.
For simple aggregations and windowed computations on time-series data, TDengine's built-in stream processing can replace Kafka + a stream processor. For complex event processing or cross-system data pipelines, you will still need a dedicated streaming platform.
TDengine provides official client libraries for Java, Python, Go, Rust, Node.js, and C/C++. JDBC, ODBC, and REST API interfaces are also available for broader tool compatibility.
引用来源 (3)
- TDengine GitHub— TDengine time-series database
- TDengine Docs— TDengine documentation and SQL reference
- TDengine Blog— Time-series database benchmarks
讨论
相关资产
StarRocks — High-Performance Analytical Database with MySQL Protocol
StarRocks is a next-generation MPP database that delivers extreme analytical query performance on large datasets. Benchmarks frequently show it as the fastest open-source OLAP engine — with full MySQL compatibility and support for data lake queries.
Memcached — High-Performance Distributed Memory Caching System
Memcached is a free, open-source, high-performance distributed memory object caching system used to speed up dynamic web applications by reducing database load.
NATS — Cloud Native High-Performance Messaging System
NATS is a simple, secure, and high-performance messaging system for cloud-native applications, IoT, and microservices. Pub/sub, request/reply, and streaming with JetStream.
Julia — High-Performance Language for Scientific Computing
Julia is a high-level, high-performance dynamic language designed for numerical analysis, computational science, and general-purpose programming with C-like speed.