Choosing the right database is a critical choice when building any software application. All databases have different strengths and weaknesses when it comes to performance, so deciding which database has the most benefits and the most minor downsides for your specific use case and data model is an important decision. Below you will find an overview of the key concepts, architecture, features, use cases, and pricing models of Prometheus and TDengine so you can quickly see how they compare against each other.
The primary purpose of this article is to compare how Prometheus and TDengine perform for workloads involving time series data, not for all possible use cases. Time series data typically presents a unique challenge in terms of database performance. This is due to the high volume of data being written and the query patterns to access that data. This article doesn’t intend to make the case for which database is better; it simply provides an overview of each database so you can make an informed decision.
Prometheus vs TDengine Breakdown
Time series database
Time series database
Prometheus uses a pull-based model where it scrapes metrics from configured targets at given intervals. It stores time series data in a custom, efficient, local storage format, and supports multi-dimensional data collection, querying, and alerting. It can be deployed as a single binary on a server or on a container platform like Kubernetes.
TDengine can be deployed on-premises, in the cloud, or as a hybrid solution, allowing flexibility in deployment and management.
Monitoring, alerting, observability, system metrics, application metrics
IoT data storage, industrial monitoring, smart energy, smart home, monitoring and observability
Prometheus is designed for reliability and can scale vertically (single node with increased resources) or through federation (hierarchical setup where Prometheus servers scrape metrics from other Prometheus servers)
Linearly scalable with clustering and built-in load balancing
Prometheus is an open-source monitoring and alerting toolkit initially developed at SoundCloud in 2012. It has since become a widely adopted monitoring solution and a part of the Cloud Native Computing Foundation (CNCF) project. Prometheus focuses on providing real-time insights and alerts for containerized and microservices-based environments. Its primary use case is monitoring infrastructure and applications, with an emphasis on reliability and scalability.
TDengine is a high-performance, open source time series database designed to handle massive amounts of time series data efficiently. It was created by TAOS Data in 2017 and is specifically designed for Internet of Things (IoT), Industrial IoT, and IT infrastructure monitoring use cases. TDengine has a unique hybrid architecture that combines the advantages of both relational and NoSQL databases, providing high performance, easy-to-use SQL-like querying, and flexible data modeling capabilities.
Prometheus for Time Series Data
Prometheus is specifically designed for time series data, as its primary focus is on monitoring and alerting based on the state of infrastructure and applications. It uses a pull-based model, where the Prometheus server scrapes metrics from the target systems at regular intervals. This model is suitable for monitoring dynamic environments, as it allows for automatic discovery and monitoring of new instances. However, Prometheus is not intended as a general-purpose time series database and might not be the best choice for high cardinality or long-term data storage.
TDengine for Time Series Data
TDengine is designed from the ground up as a time series database, so it will be a good fit for most use cases that heavily involve storing and analyzing time series data.
Prometheus Key Concepts
- Metric: A numeric representation of a particular aspect of a system, such as CPU usage or memory consumption.
- Time Series: A collection of data points for a metric, indexed by timestamp.
- Label: A key-value pair that provides metadata and context for a metric, enabling more granular querying and aggregation.
- PromQL: Prometheus uses its own query language called PromQL (Prometheus Query Language) for querying time series data and generating alerts.
TDengine Key Concepts
- Super Table: A template for creating multiple tables with the same schema. It’s similar to the concept of table inheritance in some other databases.
- Sub Table: A table created based on a Super Table, inheriting its schema. Sub Tables can have additional tags for categorization and querying purposes.
- Tag: A metadata attribute used to categorize and filter Sub Tables in a Super Table. Tags are indexed and optimized for efficient querying.
- Stable: A synonym for Super Table.
- TSQL: TDengine’s SQL-like query language, designed specifically for time series data manipulation and retrieval.
Prometheus is a single-server, standalone monitoring system that uses a pull-based approach to collect metrics from target systems. It stores time series data in a custom, highly compressed, on-disk format, optimized for fast querying and low resource usage. The architecture of Prometheus is modular and extensible, with components like exporters, service discovery mechanisms, and integrations with other monitoring systems. As a non-distributed system, it lacks built-in clustering or horizontal scalability, but it supports federation, allowing multiple Prometheus servers to share and aggregate data.
TDengine uses a hybrid architecture that combines the advantages of relational databases (support for SQL-like querying) and NoSQL databases (scalability and flexibility). It is based on a distributed, columnar storage model and uses a time series data model. TDengine uses data nodes to store data and handle queries. Management nodes coordinate the data nodes and store metadata like schema and cluster information.
Free Time-Series Database Guide
Get a comprehensive review of alternatives and critical requirements for selecting yours.
Prometheus collects metrics by actively scraping targets, enabling automatic discovery and monitoring of dynamic environments.
The powerful Prometheus Query Language allows for expressive and flexible querying of time series data.
Prometheus supports alerting based on user-defined rules and integrates with various alert management and notification systems.
TDengine supports high-speed data ingestion, with the ability to handle millions of data points per second. It supports batch and individual data insertion using TSQL.
TDengine provides a SQL-like query language (TSQL) that allows users to easily query time series data using familiar SQL syntax. It supports various aggregation functions, filtering, and joins.
Data retention and compression
TDengine automatically compresses data to save storage space and provides data retention policies to automatically delete old data.
Prometheus Use Cases
Prometheus is widely used for monitoring the health and performance of containerized and microservices-based infrastructure, including Kubernetes and Docker environments.
Application Performance Monitoring (APM)
Prometheus can collect custom application metrics using client libraries and monitor application performance in real-time.
Alerting and Anomaly Detection
Prometheus enables organizations to set up alerts based on specific thresholds or conditions, helping them identify and respond to potential issues or anomalies quickly.
TDengine Use Cases
IoT data storage and analysis
TDengine is designed to handle massive amounts of time series data generated by IoT devices. Its high-performance ingestion, querying, and storage capabilities make it a suitable choice for IoT data storage and analysis.
Industrial IoT monitoring
TDengine can be used to store and analyze data from industrial IoT sensors and devices, helping organizations monitor equipment performance, detect anomalies, and optimize operations.
TDengine can be used to collect and analyze time series data from IT infrastructure components, such as servers, networks, and applications, facilitating real-time monitoring, alerting, and performance optimization.
Prometheus Pricing Model
Prometheus is an open-source project, and there are no licensing fees associated with its use. However, costs can arise from hardware, hosting, and operational expenses when deploying a self-managed Prometheus server. Additionally, several cloud-based managed Prometheus services, such as Grafana Cloud and Weave Cloud, offer different pricing models based on factors like data retention, query rate, and support.
TDengine Pricing Model
TDengine is open source and free to use under the AGPLv3 license. TAOS Data also offers commercial licenses and enterprise support options for organizations that require additional features, support, or compliance with specific licensing requirements.
Get started with InfluxDB for free
InfluxDB Cloud is the fastest way to start storing and analyzing your time series data.