Need advice about which tool to choose?Ask the StackShare community!
Druid vs TimescaleDB: What are the differences?
Introduction
In this article, we will compare and contrast Druid and TimescaleDB, which are both powerful time-series databases.
Storage and Querying Approach: Druid is an OLAP (online analytical processing) style database that focuses on fast aggregations and slicing/dicing of data. It uses a column-oriented storage model and indexes pre-aggregated data for speed. On the other hand, TimescaleDB is an OLTP (online transaction processing) style database that is built as an extension on top of PostgreSQL. It uses a row-oriented storage model and provides full SQL support with highly efficient time-series optimizations.
Data Ingestion and Integration: Druid is designed to efficiently ingest and analyze high volumes of streaming data in real-time. It has native support for Apache Kafka and can easily integrate with other streaming technologies. TimescaleDB, on the other hand, provides seamless integration with PostgreSQL and can leverage its ecosystem of tools and connectors for data ingestion.
Scalability: Druid is built to scale horizontally across a cluster of machines. It utilizes a distributed architecture with automatic data sharding and parallel processing capabilities. This makes it suitable for handling large-scale deployments and high concurrent workloads. TimescaleDB, on the other hand, leverages PostgreSQL's scalability features and can scale vertically by adding more resources to the server. While it may not scale as well as Druid in massive deployments, it can still handle substantial workloads.
Data Model and Flexibility: Druid uses a denormalized schema design and requires upfront schema definition before data ingestion. It is optimized for handling time-series data with fixed dimensions. TimescaleDB, on the other hand, uses a relational table model and supports dynamic schemas. It allows for traditional relational queries, joins, and the ability to combine time-series data with other types of data.
Real-time Data Availability: Druid excels at real-time data ingestion and provides near-instantaneous data availability for queries. It achieves this through its distributed streaming architecture and pre-aggregation capabilities. TimescaleDB, while capable of handling near-real-time data, may have a slight delay due to its disk-based storage approach and potential data replication delays.
Community and Ecosystem: Druid has a vibrant open-source community and a wide range of connectors and integrations available. It is often used in big data and analytics ecosystems and has extensive support for data visualization tools like Apache Superset and Grafana. While TimescaleDB also has an active community, it benefits from being built on top of PostgreSQL, which has a massive ecosystem and strong support for various data manipulation and analysis techniques.
In Summary, Druid is optimized for fast aggregations and real-time data analysis with a distributed, columnar storage approach. TimescaleDB, on the other hand, is built as an extension on top of PostgreSQL, providing full SQL support, dynamic schemas, and seamless integration with the PostgreSQL ecosystem for time-series data management.
We are building an IOT service with heavy write throughput and fewer reads (we need downsampling records). We prefer to have good reliability when comes to data and prefer to have data retention based on policies.
So, we are looking for what is the best underlying DB for ingesting a lot of data and do queries easily
We had a similar challenge. We started with DynamoDB, Timescale, and even InfluxDB and Mongo - to eventually settle with PostgreSQL. Assuming the inbound data pipeline in queued (for example, Kinesis/Kafka -> S3 -> and some Lambda functions), PostgreSQL gave us a We had a similar challenge. We started with DynamoDB, Timescale and even InfluxDB and Mongo - to eventually settle with PostgreSQL. Assuming the inbound data pipeline in queued (for example, Kinesis/Kafka -> S3 -> and some Lambda functions), PostgreSQL gave us better performance by far.
Druid is amazing for this use case and is a cloud-native solution that can be deployed on any cloud infrastructure or on Kubernetes. - Easy to scale horizontally - Column Oriented Database - SQL to query data - Streaming and Batch Ingestion - Native search indexes It has feature to work as TimeSeriesDB, Datawarehouse, and has Time-optimized partitioning.
if you want to find a serverless solution with capability of a lot of storage and SQL kind of capability then google bigquery is the best solution for that.
I chose TimescaleDB because to be the backend system of our production monitoring system. We needed to be able to keep track of multiple high cardinality dimensions.
The drawbacks of this decision are our monitoring system is a bit more ad hoc than it used to (New Relic Insights)
We are combining this with Grafana for display and Telegraf for data collection
Pros of Druid
- Real Time Aggregations15
- Batch and Real-Time Ingestion6
- OLAP5
- OLAP + OLTP3
- Combining stream and historical analytics2
- OLTP1
Pros of TimescaleDB
- Open source9
- Easy Query Language8
- Time-series data analysis7
- Established postgresql API and support5
- Reliable4
- Paid support for automatic Retention Policy2
- Chunk-based compression2
- Postgres integration2
- High-performance2
- Fast and scalable2
- Case studies1
Sign up to add or upvote prosMake informed product decisions
Cons of Druid
- Limited sql support3
- Joins are not supported well2
- Complexity1
Cons of TimescaleDB
- Licensing issues when running on managed databases5