TDengine supports flexible and diverse data writing methods: standard SQL writing (small data volumes, debugging scenarios), batch writing (large-scale data import, scheduled tasks), multi-table writing (simultaneous reporting from multiple devices), automatic table creation writing (dynamic device onboarding), and schemaless writing (cross-platform migration, multi-protocol access).
Schemaless Writing
Schemaless writing supports two protocols: InfluxDB Line Protocol (format: measurement,tags fields timestamp, supporting ms/us/ns/s precision) and OpenTSDB JSON/telnet format. The core advantage lies in the automatic table creation mechanism: when the Subtable corresponding to incoming data does not exist, TDengine automatically creates the Supertable and Subtable.
Core Technologies for Write Optimization
WAL (Write-Ahead Log). The write path is: Client to WAL write-ahead log to memory buffer to acknowledgment to asynchronous disk flush. WAL_LEVEL can be set to 0, 1, or 2.
Batch Write Parameter Tuning. maxInsertBatchRows defaults to 1,000,000. The recommended batch size per write is 1,000 to 100,000 rows.
Buffer Configuration and vgroup Planning. The total number of vgroups should not exceed the number of CPU cores. Each vgroup should have at least 256 MB of Buffer.
taosAdapter Data Access
taosAdapter supports multiple protocols including Telegraf, StatsD, collectd, and Prometheus. Enable these through the configuration file.
Multi-Language Writing Examples
Python: Use the taos connector library to create databases and Supertables, then batch-write 1,000 rows of data.
JDBC: Use Java JDBC for batch writing 1,000 rows of data.
RESTful API: Use curl commands for data writing.
Performance Tuning Checklist
- BUFFER: 256 to 1024 MB
- VGROUPS: no more than the number of CPU cores
- WAL_LEVEL: 1 (recommended)
maxInsertBatchRows: default value is fine- Batch size: 1,000 to 100,000 rows
Conclusion
With proper configuration of Buffer, vgroups, and WAL parameters, combined with the multi-protocol access capabilities of taosAdapter, TDengine can handle write demands at the level of tens of millions of data points per second. It is an ideal choice for time-series databases in IoT and industrial internet scenarios.


