{"id":22671,"date":"2025-01-31T16:21:13","date_gmt":"2025-02-01T00:21:13","guid":{"rendered":"https:\/\/tdengine.com\/?p=22671"},"modified":"2025-03-30T23:27:11","modified_gmt":"2025-03-31T06:27:11","slug":"influxdb-vs-tdengine-query-language","status":"publish","type":"post","link":"https:\/\/tdengine.com\/influxdb-vs-tdengine-query-language\/","title":{"rendered":"InfluxDB&#8217;s Three-Language Problem"},"content":{"rendered":"\n<p>Imagine how a WordPress developer might feel if the next major version of WP dropped all PHP support in favor of Ruby, forcing all themes and plugins to be rewritten in the new language or be stuck on an outdated version forever. What do you think Windows administrators would say if Microsoft suddenly moved from PowerShell to Bash, and they had to update all their scripts to work on the next update?<\/p>\n\n\n\n<p>If you\u2019ve been using InfluxDB for a while, you don\u2019t need to imagine. It\u2019s already happened to InfluxDB customers &#8212; not once, but twice.<\/p>\n\n\n\n<h2 class=\"gb-headline gb-headline-3adc16ff gb-headline-text\">A State of Flux<\/h2>\n\n\n\n<p>When InfluxDB was first launched back in 2013, it used InfluxQL as its query language. InfluxQL is a SQL-like language built for time-series use cases, and though its syntax is similar to SQL, it is much less flexible with fewer possibilities for data aggregation and transformation.<\/p>\n\n\n\n<p>With the release of InfluxDB 2.0 in 2020, the Flux language was introduced. Flux is more powerful than InfluxQL, but it is also more complex: users say that they needed to take courses in the \u201cInfluxDB University\u201d to get an understanding of the language, and that they were involved in three or more Flux projects before feeling comfortable with the language. Nevertheless, InfluxDB was confident that Flux would be the way forward, and many of its faithful users went through the process of translating their queries and rewriting their applications to make use of Flux.<\/p>\n\n\n\n<p>Little did they know that only 4 years later, with InfluxDB 3.0, Flux would be deprecated in favor of SQL. Users who spent time learning Flux and updating their projects to use it were rewarded with the inability to upgrade those projects past InfluxDB 2.x and the knowledge that the time spent on Flux was wasted.<\/p>\n\n\n\n<p>While we at TDengine agree with InfluxData that SQL is indeed the best choice for time-series databases, we wish that they had come to that conclusion before wasting their community&#8217;s time on other languages.<\/p>\n\n\n<div class=\"gb-container gb-container-30fb909d\">\n<div class=\"gb-grid-wrapper gb-grid-wrapper-12d15ca9\">\n<div class=\"gb-grid-column gb-grid-column-ae80df82\"><div class=\"gb-container gb-container-ae80df82\">\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">from(bucket:&quot;power&quot;)\n|&gt; range(start:-1h)\n|&gt; filter(fn:(r) =&gt;\nr.measurement == &quot;smeter&quot; and\nr.field = &quot;voltage&quot; and\nr.location = &quot;chicago&quot;\n)\n|&gt; aggregateWindow(every: 1m, fn: mean)<\/code><\/pre>\n\n<\/div><\/div>\n\n<div class=\"gb-grid-column gb-grid-column-b8f9b718\"><div class=\"gb-container gb-container-b8f9b718\">\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">SELECT AVG(voltage) FROM power.smeter WHERE ts &gt; now -1h AND location = &quot;chicago&quot; INTERVAL(1m);<\/code><\/pre>\n\n<\/div><\/div>\n<\/div>\n\n\n<p class=\"has-text-align-center\">Comparing the same query in InfluxDB\u2019s Flux (left) and TDengine&#8217;s SQL (right) demonstrates the simplicity and readability of SQL.<\/p>\n\n<\/div>\n\n\n<h2 class=\"gb-headline gb-headline-47f407e7 gb-headline-text\">TDengine\u2019s Commitment to SQL<\/h2>\n\n\n\n<p>SQL has stood the test of time; since its conception 50 years ago, it quickly became the query language of choice for the top database management systems and a powerful tool for database administrators and users. At present it\u2019s not an overstatement to say that almost everyone involved with data \u2013 from data science graduates looking for their first job to industry veterans who have been in the field for decades \u2013 has some working knowledge of SQL.<\/p>\n\n\n\n<p>TDengine has supported standard SQL from day one and is fully committed to the language: its SQL implementation will only be expanded going forward and never replaced by any other query language.<\/p>\n\n\n\n<figure class=\"gb-block-image gb-block-image-4d2a15c6\"><img decoding=\"async\" width=\"707\" height=\"315\" class=\"gb-image gb-image-4d2a15c6\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/influx1280X1280.png?strip=all&sharp=1\" alt=\"\" title=\"influx1280X1280\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/influx1280X1280.png?strip=all&amp;sharp=1 707w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/influx1280X1280-300x134.png?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/influx1280X1280.png?strip=all&amp;sharp=1&amp;w=141 141w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/influx1280X1280.png?strip=all&amp;sharp=1&amp;w=424 424w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/influx1280X1280.png?strip=all&amp;sharp=1&amp;w=565 565w\" sizes=\"(max-width: 707px) 100vw, 707px\" \/><\/figure>\n\n\n\n<p>While supporting standard SQL, TDengine also includes time-series-specific extensions to the language, like rollups, interpolation, and time-weighted averages, meaning that you benefit from the flexibility of SQL plus specialized functions like InfluxQL. In fact, almost everything in TDengine \u2013 features like stream processing and data subscription, permissions management, cluster management, and more \u2013 is performed with SQL statements.<\/p>\n\n\n\n<p>This support greatly reduces the learning curve for people new to TDengine, as anyone who has used other SQL databases in the past will feel at home with TDengine\u2019s syntax. We believe that SQL is the best path forward for time-series data, and we respect developers\u2019 time too much to require them to learn a specialized toy language just to work with our product.<\/p>\n\n\n\n<p>Furthermore, at TDengine, we understand that stable, long-term solutions are essential for any industrial data infrastructure, and customers want a consistent product experience instead of big pivots every few years. Many users have determined that the workload of upgrading legacy InfluxDB projects to 3.0 is similar to that of simply migrating to another time-series database product altogether, and we invite them to try out TDengine OSS or TDengine Cloud and experience for themselves how easy it is to get up and running.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>InfluxDB wastes developers&#8217; time by pivoting on its query language<\/p>\n","protected":false},"author":81,"featured_media":22689,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[265],"tags":[],"ppma_author":[167],"class_list":["post-22671","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-influxdb"],"authors":[{"term_id":167,"user_id":81,"is_guest":0,"slug":"chait","display_name":"Chait Diwadkar","avatar_url":{"url":"https:\/\/tdengine.com\/wp-content\/uploads\/29.03-05-cdiwadkar.jpg","url2x":"https:\/\/tdengine.com\/wp-content\/uploads\/29.03-05-cdiwadkar.jpg"},"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts\/22671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/users\/81"}],"replies":[{"embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/comments?post=22671"}],"version-history":[{"count":9,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts\/22671\/revisions"}],"predecessor-version":[{"id":23024,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts\/22671\/revisions\/23024"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/media\/22689"}],"wp:attachment":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/media?parent=22671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/categories?post=22671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/tags?post=22671"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/ppma_author?post=22671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}