{"id":125,"date":"2021-07-10T08:34:00","date_gmt":"2021-07-10T15:34:00","guid":{"rendered":"http:\/\/www.taosdata.com.cn:88\/blog\/?p=125"},"modified":"2025-11-03T08:07:02","modified_gmt":"2025-11-03T16:07:02","slug":"using-tdengine-to-build-the-backend-of-a-connected-vehicle-platform","status":"publish","type":"post","link":"https:\/\/tdengine.com\/using-tdengine-to-build-the-backend-of-a-connected-vehicle-platform\/","title":{"rendered":"Building a Platform for Connected Vehicle Data"},"content":{"rendered":"\n<p>In the era of the Internet of Things (IoT), vehicles are not only just individual self-contained transportation objects, but also Internet-connected endpoints which can be capable of two-way communication. The real-time data generated by connected vehicles enhance user experiences in car rental and fleet management business, drive innovative business model like <a href=\"https:\/\/cloud.google.com\/solutions\/designing-connected-vehicle-platform\" rel=\"noopener\">usage-based insurance<\/a>, and build the foundation of autonomous driving and <a href=\"https:\/\/www.ntirawen.com\/2019\/05\/connected-vehicles-in-iot.html\" rel=\"noopener\">vehicle-to-everything (V2X) paradigm<\/a>. Normally, sensors in vehicles collect real-time vehicle information such as vehicle speed, GPS location, etc., and send the data to cloud data processing platforms. The cloud platform provides fast persistence of the vehicle data and provides both real-time and historical data analysis for front end applications. <\/p>\n\n\n\n<p>For 100,000 connected vehicles with a data acquisition rate at around every 1-30 seconds, about 0.29 to 8.64 billion records will be generated every day. At this scale of data generation, the performance of the data persistence layer is often the bottleneck of the performance of the platform and a monster in the platform budget. A typical HBase solution usually needs at least 6 high-performance servers equipped with 8-core CPUs and 32GB RAM, while using a <a href=\"https:\/\/tdengine.com\/what-is-a-time-series-database\/\">time series database<\/a> (TSDB) like TDengine only needs one server with a 2-core CPU and 8GB RAM.<\/p>\n\n\n\n<h2 class=\"gb-headline gb-headline-7021e6ec gb-headline-text\">Architecture<\/h2>\n\n\n\n<p>The traditional HBase solution is extremely heavy for a connected vehicle data processing platform.<\/p>\n\n\n\n<figure class=\"gb-block-image gb-block-image-a081997f\"><img decoding=\"async\" width=\"1281\" height=\"466\" class=\"gb-image gb-image-a081997f\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-01-hbase.png?strip=all&sharp=1\" alt=\"\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-01-hbase.png?strip=all&amp;sharp=1 1281w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-01-hbase-300x109.png?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-01-hbase-1024x373.png?strip=all&amp;sharp=1 1024w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-01-hbase-768x279.png?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-01-hbase.png?strip=all&amp;sharp=1&amp;w=512 512w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-01-hbase.png?strip=all&amp;sharp=1&amp;w=450 450w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/>\n<figcaption class=\"gb-headline gb-headline-5c0f4881 gb-headline-text\">Architecture of an HBase solution<\/figcaption>\n<\/figure>\n\n\n\n<figure class=\"gb-block-image gb-block-image-5480f093\"><img decoding=\"async\" width=\"964\" height=\"447\" class=\"gb-image gb-image-5480f093\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-02-tdengine.png?strip=all&sharp=1\" alt=\"\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-02-tdengine.png?strip=all&amp;sharp=1 964w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-02-tdengine-300x139.png?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-02-tdengine-768x356.png?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-02-tdengine.png?strip=all&amp;sharp=1&amp;w=192 192w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-02-tdengine.png?strip=all&amp;sharp=1&amp;w=385 385w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-02-tdengine.png?strip=all&amp;sharp=1&amp;w=578 578w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-02-tdengine.png?strip=all&amp;sharp=1&amp;w=450 450w\" sizes=\"(max-width: 964px) 100vw, 964px\" \/>\n<figcaption class=\"gb-headline gb-headline-8ccf2e1d gb-headline-text\">Architecture of a TDengine solution<\/figcaption>\n<\/figure>\n\n\n\n<p>In both solutions, real-time vehicle data is collected by sensors, sent through network gateways, authorized and parsed, and then sent to the core processing modules. HBase itself only provides the data persistence functionalities, and the solution often needs a Kafka module for message queuing and subscription, a Redis cluster for caching the latest real-time data, and possibly a Spark module for the data aggregation and computing work. Fortunately for TDengine, the architecture is a lot lighter. All the functionalities mentioned above have already been integrated into TDengine. TDengine is a purposely built for time series data processing engine integrated with the fastest time series data storage\/query engine, message queuing, caching, data subscription and stream computing functionalities. In the following part of this article, we will show readers how to build the backend of a demo connected vehicle platform using TDengine.<\/p>\n\n\n\n<h2 class=\"gb-headline gb-headline-24cc8815 gb-headline-text\">Data Model<\/h2>\n\n\n\n<p>Connected vehicle data is composed of a variety of sensor and usage data. Many companies use data models specified by the <a href=\"https:\/\/www.iso.org\/standard\/41207.html\" rel=\"noopener\">ISO 22901<\/a> industry-standard diagnostic format along with some customized modifications. Usually, the collected data types contain information about the vehicle location, drivetrain metrics, and some other third-party tracking indicators. Here we use a simple data model assuming our sensor only collects the most important data listed below:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Timestamp<\/li>\n\n\n\n<li>Longitude<\/li>\n\n\n\n<li>Latitude<\/li>\n\n\n\n<li>Altitude<\/li>\n\n\n\n<li>Direction<\/li>\n\n\n\n<li>Speed<\/li>\n<\/ul>\n\n\n\n<p>Static information about vehicles:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>License Plate Number<\/li>\n\n\n\n<li>Vehicle Model<\/li>\n\n\n\n<li>VIN<\/li>\n<\/ul>\n\n\n\n<p>According to TDengine&#8217;s user manual, the best practice to use TDengine in IoT scenarios is to create a <a href=\"https:\/\/tdengine.com\/supertable\/\">supertable<\/a> for sensors with the same type and then create a table for every single sensor. The supertable defines the table columns and data types and provides a convenient interface for joint queries on multiple devices. Tables are tagged with static information such as license plate number, the vehicle model, VIN, driver&#8217;s information, etc. Tags can still be modified after tables are created.<\/p>\n\n\n\n<p>We first create a database for this demo.<\/p>\n\n\n\n<pre class=\"wp-block-code language-sql\"><code class=\"\" data-line=\"\">create database demodb cache 8192 ablocks 2 tblocks 1000 tables 10000<\/code><\/pre>\n\n\n\n<p>Create the supertable for the car sensor. Define the data columns as collecting time <code class=\"\" data-line=\"\">ts<\/code> , vehicle location information including <code class=\"\" data-line=\"\">longitude<\/code> , <code class=\"\" data-line=\"\">latitude<\/code> ,  <code class=\"\" data-line=\"\">altitude<\/code> , and vehicle driving status including <code class=\"\" data-line=\"\">direction<\/code> , <code class=\"\" data-line=\"\">velocity<\/code> . Each vehicle occupies its own table that is tagged by the license plate number <code class=\"\" data-line=\"\">card<\/code> and vehicle model <code class=\"\" data-line=\"\">model<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code language-sql\"><code class=\"\" data-line=\"\">create table vehicle(ts timestamp, longitude bigint, latitude bigint, altitude int, direction int, velocity int)\n tags(card int, model binary(10));<\/code><\/pre>\n\n\n\n<p>Create a table for a BMW whose license plate number is <code class=\"\" data-line=\"\">28436<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code language-sql\"><code class=\"\" data-line=\"\">create table v1 using vehicle tags(28436, \u2018MyModel\u2019);<\/code><\/pre>\n\n\n\n<h3 class=\"gb-headline gb-headline-d70ca9d5 gb-headline-text\">Data Insertion<\/h3>\n\n\n\n<p>Now let&#8217;s insert a new data record into TDengine.<\/p>\n\n\n\n<pre class=\"wp-block-code language-sql\"><code class=\"\" data-line=\"\">insert into v1 values(\u20182019-07-03 18:48:59.000\u2019, 1, 2, 3, 4, 5);<\/code><\/pre>\n\n\n\n<p>For testing purposes, we can insert records in batches to improve efficiency. Refer to the TDengine for more detailed usage of batch insertions.<\/p>\n\n\n\n<p>Here we provide a vehicle data simulator written in C. This simulator first creates 100,000 tables and then writes about one month&#8217;s data into each table (with a time interval of 1 minute and 44,000 in total). Please note the data is fake.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code class=\"\" data-line=\"\">#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n#include &lt;string.h&gt;\n#include &lt;unistd.h&gt;\n#include &quot;time.h&quot;\n#include &quot;taos.h&quot;\nint main(int argc, char *argv&#091;]) {\n  taos_init();\n\n  TAOS *taos = taos_connect(&quot;127.0.0.1&quot;, &quot;root&quot;, &quot;taosdata&quot;, NULL, 0);\n  if (taos == NULL) {\n    printf(&quot;failed to connect to server, reason:%s\\n&quot;, taos_errstr(taos));\n    exit(1);\n  }\n\n  if (taos_query(taos, &quot;create database db cache 8192 ablocks 2 tblocks 1000 tables 10000&quot;) != 0) {\n    printf(&quot;failed to create database, reason:%s\\n&quot;, taos_errstr(taos));\n    exit(1);\n  }\n\n  taos_query(taos, &quot;use db&quot;);\n\n  char sql&#091;65000] = &quot;create table vehicles(ts timestamp, longitude bigint, latitude bigint, altitude int, direction int, velocity int) tags(card int, model binary(10))&quot;;\n  if (taos_query(taos, sql) != 0) {\n    printf(&quot;failed to create stable, reason:%s\\n&quot;, taos_errstr(taos));\n    exit(1);\n  }\n\n  int begin = time(NULL);\n  for (int table = 0; table &lt; 100000; ++table) {\n    sprintf(sql, &quot;create table v%d using vehicles tags(%d, &#039;t%d&#039;)&quot;, table, table, table);\n    if (taos_query(taos, sql) != 0) {\n      printf(&quot;failed to create table t%d, reason:%s\\n&quot;, table, taos_errstr(taos));\n      exit(1);\n    }\n\n    for (int loop = 0; loop &lt; 44; loop++) {\n      int len = sprintf(sql, &quot;insert into v%d values&quot;, table);\n      for (int row = 0; row &lt; 1000; row++) {\n        len += sprintf(sql + len, &quot;(%ld,%d,%d,%d,%d,%d)&quot;, 1561910400000L + 60000L * (row + loop * 1000L), row, row, row, row, row);\n      }\n      if (taos_query(taos, sql) != 0) {\n        printf(&quot;failed to insert table t%d, reason:%s\\n&quot;, table, taos_errstr(taos));\n      }\n    }\n  }\n\n  int end = time(NULL);\n  printf(&quot;insert finished, time spend %d seconds&quot;, end - begin);\n}<\/code><\/pre>\n\n\n\n<p>To compile the simulator code given above, name the source code file to <code class=\"\" data-line=\"\">test.c<\/code> and then create the following <code class=\"\" data-line=\"\">makefile<\/code> file in the directory with <code class=\"\" data-line=\"\">test.c<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code language-makefile\"><code class=\"\" data-line=\"\">ROOT = .\/\nTARGET = exe\nLFLAGS = -Wl,-rpath,\/usr\/local\/lib\/taos\/ -ltaos -lpthread -lm -lrt \nCFLAGS = -O3 -g -Wall -Wno-deprecated -fPIC -Wno-unused-result -Wconversion -Wno-char-subscripts -D_REENTRANT -Wno-format -D_REENTRANT -DLINUX -msse4.2 -Wno-unused-function -D_M_X64 -std=gnu99 -I\/usr\/local\/include\/taos\/\n\nall: $(TARGET)\n\nexe:\n  gcc $(CFLAGS) .\/test.c -o $(ROOT)\/test $(LFLAGS)\n\nclean:\n  rm $(ROOT)test <\/code><\/pre>\n\n\n\n<p>After compilation, you will get an executable file <code class=\"\" data-line=\"\">test<\/code> in the same directory. To run it, simply execute:<\/p>\n\n\n\n<pre class=\"wp-block-code language-shell\"><code class=\"\" data-line=\"\">.\/test<\/code><\/pre>\n\n\n\n<p>In this test, the TDengine service and the simulator program were running on the same machine with a 2-core CPU and 8GB RAM. The total time spent on inserting was 3946 seconds, giving a insertion speed of 4,400,000,000 \/ 3946 = 1,115,000 records per second, which is about 5,770,000 data points per second. Considering the result is from a single-threaded client, the multiple-threaded writing may very likely give a few more times of performance boost. But the current writing performance is adequate for connected vehicle scenarios with a scale of 100,000 vehicles.<\/p>\n\n\n\n<h3 class=\"gb-headline gb-headline-ffde8f95 gb-headline-text\">Query the Vehicle Data<\/h3>\n\n\n\n<p>TDengine has done a lot of optimizations on time series data queries. Based on the dataset generator above, we used TDengine&#8217;s CLI <code class=\"\" data-line=\"\">taos<\/code> to test some of the common queries which eventually gave out some sensational performance stats.<\/p>\n\n\n\n<h4 class=\"gb-headline gb-headline-048aafb5 gb-headline-text\">Query on Full Volume<\/h4>\n\n\n\n<p>Query the total number of data points, the average and the summation of velocity for all 100,000 vehicles in a month.<\/p>\n\n\n\n<pre class=\"wp-block-code language-sql\"><code class=\"\" data-line=\"\">select count(velocity), avg(velocity), sum(velocity) from vehicles;<\/code><\/pre>\n\n\n\n<figure class=\"gb-block-image gb-block-image-6b9f02ab\"><img decoding=\"async\" width=\"1692\" height=\"240\" class=\"gb-image gb-image-6b9f02ab\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-03-query-1.jpg?strip=all&sharp=1\" alt=\"\" title=\"22.04-03-query-1\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-03-query-1.jpg?strip=all&amp;sharp=1 1692w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-03-query-1-300x43.jpg?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-03-query-1-1024x145.jpg?strip=all&amp;sharp=1 1024w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-03-query-1-768x109.jpg?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-03-query-1-1536x218.jpg?strip=all&amp;sharp=1 1536w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-03-query-1.jpg?strip=all&amp;sharp=1&amp;w=676 676w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-03-query-1.jpg?strip=all&amp;sharp=1&amp;w=1353 1353w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-03-query-1.jpg?strip=all&amp;sharp=1&amp;w=450 450w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/>\n<figcaption class=\"gb-headline gb-headline-cb297ea7 gb-headline-text\">Figure 3. Query on full volume<\/figcaption>\n<\/figure>\n\n\n\n<h4 class=\"gb-headline gb-headline-2c64e990 gb-headline-text\">Details of a Single Vehicle<\/h4>\n\n\n\n<p>Querying data of a single vehicle for different time intervals.<\/p>\n\n\n\n<pre class=\"wp-block-code language-sql\"><code class=\"\" data-line=\"\">select last(*) from v1;\nselect * from v1 where ts &amp;gt;= &#039;2019-07-01 00:00:00&#039; and ts &amp;lt; &#039;2019-07-01 00:00:00&#039; &amp;gt;&amp;gt; 1h.txt\nselect * from v1 where ts &amp;gt;= &#039;2019-07-01 00:00:00&#039; and ts &amp;lt; &#039;2019-07-02 00:00:00&#039; &amp;gt;&amp;gt; 1d.txt\nselect * from v1 where ts &amp;gt;= &#039;2019-07-01 00:00:00&#039; and ts &amp;lt; &#039;2019-07-11 00:00:00&#039; &amp;gt;&amp;gt; 10d.txt\nselect * from v1 where ts &amp;gt;= &#039;2019-07-01 00:00:00&#039; and ts &amp;lt; &#039;2019-08-01 00:00:00&#039; &amp;gt;&amp;gt; 31d.txt<\/code><\/pre>\n\n\n\n<table id=\"tablepress-41\" class=\"tablepress tablepress-id-41\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">Query Content<\/th><th class=\"column-2\">Latency (ms)<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">Last record<\/td><td class=\"column-2\">2.3<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">Last hour<\/td><td class=\"column-2\">2.1<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">Last day<\/td><td class=\"column-2\">6.3<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">Last 10 days<\/td><td class=\"column-2\">15.4<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">Last 31 days<\/td><td class=\"column-2\">31.6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-41 from cache -->\n\n\n<figure class=\"gb-block-image gb-block-image-eb0ceefe\"><img decoding=\"async\" width=\"1920\" height=\"582\" class=\"gb-image gb-image-eb0ceefe\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-04-query-2.jpg?strip=all&sharp=1\" alt=\"\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-04-query-2.jpg?strip=all&amp;sharp=1 1920w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-04-query-2-300x91.jpg?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-04-query-2-1024x310.jpg?strip=all&amp;sharp=1 1024w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-04-query-2-768x233.jpg?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-04-query-2-1536x466.jpg?strip=all&amp;sharp=1 1536w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-04-query-2.jpg?strip=all&amp;sharp=1&amp;w=384 384w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-04-query-2.jpg?strip=all&amp;sharp=1&amp;w=1152 1152w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-04-query-2.jpg?strip=all&amp;sharp=1&amp;w=450 450w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/>\n<figcaption class=\"gb-headline gb-headline-48731c05 gb-headline-text\">Figure 4. Single Vehicle Data Queries<\/figcaption>\n<\/figure>\n\n\n\n<h4 class=\"gb-headline gb-headline-f1ba66fd gb-headline-text\">Multi-vehicle Aggregation over 1 Day<\/h4>\n\n\n\n<p>Aggregating data of multiple vehicles for a day&#8217;s timespan.<\/p>\n\n\n\n<table id=\"tablepress-42\" class=\"tablepress tablepress-id-42\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">Query Content<\/th><th class=\"column-2\">Latency (ms)<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">1-Vehicle Aggregation Over 1 Day<\/td><td class=\"column-2\">3.2<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">10-Vehicle Aggregation Over 1 Day<\/td><td class=\"column-2\">5.1<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">100-Vehicle Aggregation Over 1 Day<\/td><td class=\"column-2\">10.4<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">1000-Vehicle Aggregation Over 1 Day<\/td><td class=\"column-2\">51.4<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">10,000-Vehicle Aggregation Over 1 Day<\/td><td class=\"column-2\">455.9<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">100,000-Vehicle Aggregation Over 1 Day<\/td><td class=\"column-2\">2074.8<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-42 from cache -->\n\n\n<figure class=\"gb-block-image gb-block-image-532d3c6b\"><img decoding=\"async\" width=\"1920\" height=\"871\" class=\"gb-image gb-image-532d3c6b\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-05-query-3.jpg?strip=all&sharp=1\" alt=\"\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-05-query-3.jpg?strip=all&amp;sharp=1 1920w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-05-query-3-300x136.jpg?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-05-query-3-1024x465.jpg?strip=all&amp;sharp=1 1024w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-05-query-3-768x348.jpg?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-05-query-3-1536x697.jpg?strip=all&amp;sharp=1 1536w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-05-query-3.jpg?strip=all&amp;sharp=1&amp;w=384 384w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-05-query-3.jpg?strip=all&amp;sharp=1&amp;w=1152 1152w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-05-query-3.jpg?strip=all&amp;sharp=1&amp;w=450 450w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/>\n<figcaption class=\"gb-headline gb-headline-20e93b19 gb-headline-text\">Figure 5. Multi-vehicle aggregation over 1 day<\/figcaption>\n<\/figure>\n\n\n\n<h4 class=\"gb-headline gb-headline-7721c5a9 gb-headline-text\">Multi-vehicle aggregation over 1 month<\/h4>\n\n\n\n<p>Aggregation data of multiple vehicles for a month.<\/p>\n\n\n\n<table id=\"tablepress-43\" class=\"tablepress tablepress-id-43\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">Query Content<\/th><th class=\"column-2\">Latency (ms)<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">1-Vehicle Aggregation Over 1 Month<\/td><td class=\"column-2\">3.1<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">10-Vehicle Aggregation Over 1 Month<\/td><td class=\"column-2\">4.1<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">100-Vehicle Aggregation Over 1 Month<\/td><td class=\"column-2\">7.7<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">1000-Vehicle Aggregation Over 1 Month<\/td><td class=\"column-2\">33.7<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">10,000-Vehicle Aggregation Over 1 Month<\/td><td class=\"column-2\">289.5<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">100,000-Vehicle Aggregation Over 1 Month<\/td><td class=\"column-2\">1197.4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-43 from cache -->\n\n\n<figure class=\"gb-block-image gb-block-image-eb0802af\"><img decoding=\"async\" width=\"1920\" height=\"892\" class=\"gb-image gb-image-eb0802af\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-06-query-4.jpg?strip=all&sharp=1\" alt=\"\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-06-query-4.jpg?strip=all&amp;sharp=1 1920w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-06-query-4-300x139.jpg?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-06-query-4-1024x476.jpg?strip=all&amp;sharp=1 1024w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-06-query-4-768x357.jpg?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-06-query-4-1536x714.jpg?strip=all&amp;sharp=1 1536w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-06-query-4.jpg?strip=all&amp;sharp=1&amp;w=384 384w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-06-query-4.jpg?strip=all&amp;sharp=1&amp;w=1152 1152w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-06-query-4.jpg?strip=all&amp;sharp=1&amp;w=450 450w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/>\n<figcaption class=\"gb-headline gb-headline-9e53cd78 gb-headline-text\">Figure 6. Multi-vehicle data aggregation over 1 month<\/figcaption>\n<\/figure>\n\n\n\n<h4 class=\"gb-headline gb-headline-fe31bf47 gb-headline-text\">Multi-vehicle Data Downsampling over 1 Month<\/h4>\n\n\n\n<p>Aggregation queries on multiple vehicles with downsampling for a period of one month.<\/p>\n\n\n\n<table id=\"tablepress-44\" class=\"tablepress tablepress-id-44\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">Query Content<\/th><th class=\"column-2\">Latency (ms)<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">1-Vehicle Downsampling Over 1 Month<\/td><td class=\"column-2\">6.9<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">10-Vehicle Downsampling Over 1 Month<\/td><td class=\"column-2\">13.2<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">100-Vehicle Downsampling Over 1 Month<\/td><td class=\"column-2\">75.6<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">1000-Vehicle Downsampling Over 1 Month<\/td><td class=\"column-2\">710.9<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">10,000-Vehicle Downsampling Over 1 Month<\/td><td class=\"column-2\">7137.6<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">100,000-Vehicle Downsampling Over 1 Month<\/td><td class=\"column-2\">32130.8<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-44 from cache -->\n\n\n<figure class=\"gb-block-image gb-block-image-cbdbbcdb\"><img decoding=\"async\" width=\"1920\" height=\"1499\" class=\"gb-image gb-image-cbdbbcdb\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-07-query-5.jpg?strip=all&sharp=1\" alt=\"\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-07-query-5.jpg?strip=all&amp;sharp=1 1920w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-07-query-5-300x234.jpg?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-07-query-5-1024x799.jpg?strip=all&amp;sharp=1 1024w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-07-query-5-768x600.jpg?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-07-query-5-1536x1199.jpg?strip=all&amp;sharp=1 1536w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-07-query-5.jpg?strip=all&amp;sharp=1&amp;w=384 384w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-07-query-5.jpg?strip=all&amp;sharp=1&amp;w=1152 1152w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-07-query-5.jpg?strip=all&amp;sharp=1&amp;w=450 450w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/>\n<figcaption class=\"gb-headline gb-headline-40816a00 gb-headline-text\">Figure 7. Multi-vehicle data downsampling over 1 month<\/figcaption>\n<\/figure>\n\n\n\n<h4 class=\"gb-headline gb-headline-2f69940a gb-headline-text\">Usage of Hardware Resources<\/h4>\n\n\n\n<p>While running, the <code class=\"\" data-line=\"\">taosd<\/code> service used about 2.7GB of RAM and had a very low CPU usage.<\/p>\n\n\n\n<figure class=\"gb-block-image gb-block-image-c3abdf47\"><img decoding=\"async\" width=\"1568\" height=\"864\" class=\"gb-image gb-image-c3abdf47\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-08-resources-1.jpg?strip=all&sharp=1\" alt=\"\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-08-resources-1.jpg?strip=all&amp;sharp=1 1568w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-08-resources-1-300x165.jpg?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-08-resources-1-1024x564.jpg?strip=all&amp;sharp=1 1024w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-08-resources-1-768x423.jpg?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-08-resources-1-1536x846.jpg?strip=all&amp;sharp=1 1536w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-08-resources-1.jpg?strip=all&amp;sharp=1&amp;w=627 627w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-08-resources-1.jpg?strip=all&amp;sharp=1&amp;w=940 940w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-08-resources-1.jpg?strip=all&amp;sharp=1&amp;w=1254 1254w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-08-resources-1.jpg?strip=all&amp;sharp=1&amp;w=450 450w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<figure class=\"gb-block-image gb-block-image-bb9c1155\"><img decoding=\"async\" width=\"1568\" height=\"918\" class=\"gb-image gb-image-bb9c1155\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-09-resources-2.jpg?strip=all&sharp=1\" alt=\"\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-09-resources-2.jpg?strip=all&amp;sharp=1 1568w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-09-resources-2-300x176.jpg?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-09-resources-2-1024x600.jpg?strip=all&amp;sharp=1 1024w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-09-resources-2-768x450.jpg?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-09-resources-2-1536x899.jpg?strip=all&amp;sharp=1 1536w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-09-resources-2.jpg?strip=all&amp;sharp=1&amp;w=627 627w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-09-resources-2.jpg?strip=all&amp;sharp=1&amp;w=940 940w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-09-resources-2.jpg?strip=all&amp;sharp=1&amp;w=1254 1254w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.04-09-resources-2.jpg?strip=all&amp;sharp=1&amp;w=450 450w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<h2 class=\"gb-headline gb-headline-25661180 gb-headline-text\">Conclusion<\/h2>\n\n\n\n<p>TDengine is a high-performance, easy-to-deploy and economical time series data processing engine that can be used in many IoT scenarios including connected vehicle data processing. On a single node with a 2-core CPU and 8GB RAM, TDengine gives an incredible writing throughput at a level of million records per second. IoT data like connected vehicles data are mostly sensor-collected timer series data, and time series purpose-built data processing engines like TDengine are much better choices than the traditional heavy Hadoop-Spark solutions in those scenarios.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Compare a Hadoop\/Spark-based solution for connected cars with an optimized architecture featuring TDengine.<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[21],"tags":[],"ppma_author":[107],"class_list":["post-125","post","type-post","status-publish","format-standard","hentry","category-engineering"],"authors":[{"term_id":107,"user_id":4,"is_guest":0,"slug":"slguan","display_name":"Shengliang Guan","avatar_url":{"url":"https:\/\/tdengine.com\/wp-content\/uploads\/29.04-30-slguan.jpg","url2x":"https:\/\/tdengine.com\/wp-content\/uploads\/29.04-30-slguan.jpg"},"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts\/125","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\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/comments?post=125"}],"version-history":[{"count":10,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts\/125\/revisions"}],"predecessor-version":[{"id":29450,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts\/125\/revisions\/29450"}],"wp:attachment":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/media?parent=125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/categories?post=125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/tags?post=125"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/ppma_author?post=125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}