TDengine TSDB Connectors: Java, Python, and Go Getting Started Guide

Juno Qiu

July 7, 2026 /

Connector ecosystem overview

The official TDengine connectors cover seven programming languages: C/C++, Java, Python, Go, Node.js, C#, and Rust. Each connector supports three connection modes: WebSocket connections, native connections, and the REST API. Connecting to cloud service instances requires WebSocket. Native connections depend on the taosc client version matching the server version. All connectors follow a unified design: they connect to taosd through the taosAdapter component’s WebSocket API or REST API, or connect directly to taosd via taosc.

Java connector development

The Java connector provides a standard JDBC interface and integrates with frameworks like Spring Boot. It is the core component of the TDengine Java ecosystem. Connection configuration is specified through the JDBC URL. WebSocket connections require the protocol endpoint in the URL.

For database and table creation in JDBC, create a database (power) and a supertable (meters) with columns for timestamp, current, voltage, and phase, along with relevant tags. Use the dbName.tableName format when constructing SQL statements rather than USE DBName. This avoids connection pool switching issues.

JDBC provides efficient batching for writes. The connector automatically creates write threads and queues, buffers data by subtable, and sends batches when a row threshold is reached or a timeout fires. Key configuration parameters include: write thread count (default 10), batch size in rows (default 1000), cache rows (default 10000), and auto reconnect (default false). Set auto reconnect to true in production. Write throughput scales linearly with the thread count. The executeUpdate interface also returns the number of rows written, which is useful for monitoring.

Python connector development

The Python connector supports both WebSocket and native connections. Data writing supports standard SQL and automatic table creation syntax. INSERT statements can reference the NOW function and tag values. NOW returns the current client time. Supported time offset units are a (milliseconds), smhdwn, and y.

For schemaless writing, the Python connector supports InfluxDB Line Protocol, as well as OpenTSDB TELNET and JSON protocols. The Line Protocol format is measurement,tag_set field_set timestamp. The connector automatically creates the storage structure based on incoming data, so you can start writing without defining a schema first.

Go connector development

The Go connector supports full SQL operations and schemaless writing. It is a strong fit for high-concurrency TSDB workloads. It supports aggregation queries, downsampling, and interpolation queries.

Parameter binding (STMT) writes avoid the overhead of SQL parsing on every write, which significantly improves throughput. Three SQL forms are available: a direct INSERT when you know the subtable already exists, an INSERT that specifies columns and triggers automatic table creation, and the USING syntax for building templates. The performance gain comes from reduced parsing time, precompiled statements, and fewer network round trips. For high-frequency IoT write workloads, parameter binding is a critical optimization.

Connector selection and best practices

  • Connection mode: Prefer WebSocket in production. It provides cross-version compatibility. Cloud service instances require WebSocket.
  • SQL convention: Use the dbName.tableName format. Avoid USE DBName.
  • Write optimization: Use parameter binding for high-throughput scenarios. Tune batch parameters to match your data rate.
  • Error handling: Enable auto reconnect. Set reasonable retry counts and intervals to absorb transient network issues.

Conclusion

The Java connector works well for building enterprise-grade data collection platforms. Python is strong in data analysis workflows. Go performs well in high-concurrency scenarios. WebSocket is the recommended connection mode across all languages. TDengine lowers the adoption barrier through official connectors covering seven languages.