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 Redis and TDengine so you can quickly see how they compare against each other.
The primary purpose of this article is to compare how Redis 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.
Redis vs TDengine Breakdown
Time series database
Redis can be deployed on-premises, in the cloud, or as a managed service
TDengine can be deployed on-premises, in the cloud, or as a hybrid solution, allowing flexibility in deployment and management.
Caching, message brokering, real-time analytics, session storage, geospatial data processing
IoT data storage, industrial monitoring, smart energy, smart home, monitoring and observability
Horizontally scalable via partitioning and clustering, supports data replication
Linearly scalable with clustering and built-in load balancing
Redis, which stands for Remote Dictionary Server, is an open-source, in-memory data structure store that can be used as a database, cache, and message broker. It was created by Salvatore Sanfilippo in 2009 and has since gained significant popularity due to its high performance and flexibility. Redis supports various data structures, such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, and geospatial indexes with radius queries.
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.
Redis for Time Series Data
Redis has a dedicated module for working with time series data called RedisTimeSeries. RedisTimeSeries offers functionality like downsampling, data retention policies, and specialized queries for time series data in Redis. Being an in-memory database, Redis will be very fast for reading and writing time series data, but due to the cost of RAM compared to disk using Redis could become expensive depending on the size of your dataset. If your use case doesn’t require extremely fast response times, you could save money by going with a more traditional time series database.
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.
Redis Key Concepts
- In-memory store: Redis stores data in memory, which allows for faster data access and manipulation compared to disk-based databases .
- Data structures: Redis supports a wide range of data structures, including strings, hashes, lists, sets, and more, which provide flexibility in how data is modeled and stored.
- Persistence: Redis offers optional data persistence, allowing data to be periodically saved to disk or written to a log for durability.
- Pub/Sub: Redis provides a publish/subscribe messaging system, enabling real-time communication between clients without the need for a centralized message broker.
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.
Redis is a NoSQL database that uses a key-value data model, where each key is associated with a value stored as one of Redis’ supported data structures. The database is single-threaded, which simplifies its internal architecture and reduces contention. Redis can be deployed as a standalone server, a cluster, or a master-replica setup for scalability and high availability. The Redis Cluster mode automatically shards data across multiple nodes, providing data partitioning and fault tolerance.
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.
Redis supports atomic operations on complex data types, allowing developers to perform powerful operations without worrying about race conditions or other concurrent processing issues.
Broad data structure support
Redis supports a range of data structures such as lists, sets, sorted sets, hashes, bitmaps, hyperloglog, and geospatial indexes. This flexibility allows developers to use Redis for a wide variety of tasks by using data structures that are optimized for their data in terms of performance characteristics.
Redis provides a publish/subscribe messaging system for real-time communication between clients.
Developers can run Lua scripts in the Redis server, enabling complex operations to be executed atomically in the server itself, reducing network round trips.
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.
Redis Use Cases
Redis is often used as a cache to store frequently accessed data and reduce the load on other databases or services, improving application performance and reducing latency.
Redis can be used to implement task queues, which are useful for managing tasks that take longer to process and should be executed asynchronously. This is particularly common in web applications, where background tasks can be processed independently of the request/response cycle
Real-time analysis and machine learning
Redis’ high performance and low-latency data access make it suitable for real-time analysis and machine learning applications, such as processing streaming data, media streaming, and handling time-series data. This can be achieved using Redis’ data structures and capabilities like sorted sets, timestamps, and pub/sub messaging.
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.
Redis Pricing Model
Redis is open-source software, which means it can be deployed and used freely on your own infrastructure. However, there are also managed Redis services available, such as Redis Enterprise which offer additional features, support, and ease of deployment. Pricing for these services typically depends on factors like the size of the instance, data storage, and data transfer.
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.