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 Apache Druid and Graphite so you can quickly see how they compare against each other.
The primary purpose of this article is to compare how Apache Druid and Graphite 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.
Apache Druid vs Graphite Breakdown
Time series database
Druid can be deployed on-premises, in the cloud, or using a managed service
Graphite can be deployed on-premises or in the cloud, and it supports horizontal scaling by partitioning data across multiple backend nodes.
Real-time analytics, OLAP, time series data, event-driven data, log analytics, ad tech, user behavior analytics
Monitoring, observability, IoT, real-time analytics, DevOps, application performance monitoring
Horizontally scalable, supports distributed architectures for high availability and performance
Horizontally scalable, supports clustering and replication for high availability and performance
Apache Druid Overview
Apache Druid is an open-source, real-time analytics database designed for high-performance querying and data ingestion. Originally developed by Metamarkets in 2011 and later donated to the Apache Software Foundation in 2018, Druid has gained popularity for its ability to handle large volumes of data with low latency. With a unique architecture that combines elements of time series databases, search systems, and columnar storage, Druid is particularly well-suited for use cases involving event-driven data and interactive analytics.
Graphite is an open-source monitoring and graphing tool created in 2006 by Orbitz and open sourced in 2008. Graphite is designed for storing time series data and is widely used for collecting, storing, and visualizing metrics from various sources, such as application performance, system monitoring, and business analytics.
Apache Druid for Time Series Data
Apache Druid is designed for real time analytics and can be a good fit for working with time series data that needs to be analyzed quickly after being written. Druid also offers integrations for storing historical data in cheaper object storage so historical time series data can also be analyzed using Druid.
Graphite for Time Series Data
Graphite is specifically designed and optimized for time series data. It uses the Whisper database format, which efficiently stores and manages time series data by automatically aggregating and expiring data based on user-defined retention policies. Graphite supports a wide range of functions for querying, transforming, and aggregating time series data, enabling users to create custom graphs and dashboards. However, as Graphite focuses exclusively on time series data, it may not be suitable for other types of data or use cases that require more advanced data modeling or querying capabilities.
Apache Druid Key Concepts
- Data Ingestion: The process of importing data into Druid from various sources, such as streaming or batch data sources.
- Segments: The smallest unit of data storage in Druid, segments are immutable, partitioned, and compressed.
- Data Rollup: The process of aggregating raw data during ingestion to reduce storage requirements and improve query performance.
- Nodes: Druid’s architecture consists of different types of nodes, including Historical, Broker, Coordinator, and MiddleManager/Overlord, each with specific responsibilities.
- Indexing Service: Druid’s indexing service manages the process of ingesting data, creating segments, and publishing them to deep storage.
Graphite Key Concepts
- Metric: A metric in Graphite represents a time series data point, consisting of a path (name), timestamp, and value.
- Series: A series is a collection of metrics that are all related to the same thing. For example, you might have a series for CPU usage, a series for memory usage, and a series for disk usage.
- Whisper: Whisper is a fixed-size, file-based time series database format used by Graphite. It automatically manages data retention and aggregation.
- Carbon: Carbon is the daemon responsible for receiving, caching, and storing metrics in Graphite. It listens for incoming metrics and writes them to Whisper files.
- Graphite-web: Graphite-web is the web application that provides a user interface for visualizing and querying the stored time series data.
Apache Druid Architecture
Apache Druid is a powerful distributed data store designed for real-time analytics on large datasets. Within its architecture, several core components play pivotal roles in ensuring its efficiency and scalability. Here is an overview of the core components that power Apache Druid.
- Historical Nodes are fundamental to Druid’s data-serving capabilities. Their primary responsibility is to serve stored data to queries. To achieve this, they load segments from deep storage, retain them in memory, and then cater to the queries on these segments. When considering deployment and management, these nodes are typically stationed on machines endowed with significant memory and CPU resources. Their scalability is evident as they can be expanded horizontally simply by incorporating more nodes.
- Broker Nodes act as the gatekeepers for incoming queries. Their main function is to channel these queries to the appropriate historical nodes or real-time nodes. Intriguingly, they are stateless, which means they can be scaled out to accommodate an increase in query concurrency.
- Coordinator Nodes have a managerial role, overseeing the data distribution across historical nodes. Their decisions on which segments to load or drop are based on specific configurable rules. In terms of deployment, a Druid setup usually requires just one active coordinator node, with a backup node on standby for failover scenarios.
- Overlord Nodes dictate the assignment of ingestion tasks, directing them to either middle manager or indexer nodes. Their deployment mirrors that of the coordinator nodes, with typically one active overlord and a backup for redundancy.
- MiddleManager and Indexer Nodes are the workhorses of data ingestion in Druid. While MiddleManagers initiate short-lived tasks for data ingestion, indexers are designed for long-lived tasks. Given their intensive operations, these nodes demand high CPU and memory resources. Their scalability is flexible, allowing horizontal expansion based on the volume of data ingestion.
- Deep Storage is a component that serves as Druid’s persistent storage unit. Druid integrates with various blob storage solutions like HDFS, S3, and Google Cloud Storage.
- Metadata Storage is the repository for crucial metadata about segments, tasks, and configurations. Druid is compatible with popular databases for this purpose, including MySQL, PostgreSQL, and Derby.
Graphite’s architecture consists of several components, including Carbon, Whisper, and Graphite-web. Carbon is responsible for receiving metrics from various sources, caching them in memory, and storing them in Whisper files. Whisper is a file-based time series database format that efficiently manages data retention and aggregation. Graphite-web is the web application that provides a user interface for querying and visualizing the stored time series data. Graphite can be deployed on a single server or distributed across multiple servers for improved performance and scalability.
Free Time-Series Database Guide
Get a comprehensive review of alternatives and critical requirements for selecting yours.
Apache Druid Features
Apache Druid supports both real-time and batch data ingestion, allowing it to process data from various sources like Kafka, Hadoop, or local files. With built-in support for data partitioning, replication, and roll-up, Druid ensures high availability and efficient storage.
Scalability and Performance
Druid is designed to scale horizontally, providing support for large-scale deployments with minimal performance degradation. Its unique architecture allows for fast and efficient querying, making it suitable for use cases requiring low-latency analytics.
Druid stores data in a columnar format, enabling better compression and faster query performance compared to row-based storage systems. Columnar storage also allows Druid to optimize queries by only accessing relevant columns.
Druid’s indexing service creates segments with time-based partitioning, optimizing data storage and retrieval for time-series data. This feature significantly improves query performance for time-based queries. Data Rollups
Druid’s data rollup feature aggregates raw data during ingestion, reducing storage requirements and improving query performance. This feature is particularly beneficial for use cases involving high-cardinality data or large volumes of similar data points.
Real-time monitoring and visualization
Graphite provides real-time monitoring and visualization capabilities, allowing users to track and analyze their time series data as it is collected.
Flexible querying and aggregation functions
Graphite supports a wide range of functions for querying, transforming, and aggregating time series data, enabling users to create custom graphs and dashboards tailored to their specific needs.
Data retention and aggregation
Graphite’s Whisper database format automatically manages data retention and aggregation, reducing storage requirements and improving query performance.
Apache Druid Use Cases
Apache Druid provides support for geospatial data and queries, making it suitable for use cases that involve location-based data, such as tracking the movement of assets, analyzing user locations, or monitoring the distribution of events. Its ability to efficiently process large volumes of geospatial data enables users to gain insights and make data-driven decisions based on location information.
Machine Learning and AI
Druid’s high-performance data processing capabilities can be leveraged for preprocessing and feature extraction in machine learning and AI workflows. Its support for real-time data ingestion and low-latency querying make it suitable for use cases that require real-time predictions or insights, such as recommendation systems or predictive maintenance.
Apache Druid’s low-latency querying and real-time data ingestion capabilities make it an ideal solution for real-time analytics use cases, such as monitoring application performance, user behavior, or business metrics.
Graphite Use Cases
Application performance monitoring
Graphite is widely used for monitoring the performance of applications and services, helping developers and operations teams track key metrics, such as response times, error rates, and resource utilization. By visualizing these metrics in real-time, users can identify performance bottlenecks, detect issues, and optimize their applications for better performance and reliability.
Infrastructure and system monitoring
Graphite is also popular for monitoring the health and performance of servers, networks, and other infrastructure components. By collecting and analyzing metrics such as CPU usage, memory consumption, network latency, and disk I/O, IT administrators can ensure their infrastructure is running smoothly and proactively address potential issues before they impact system performance or availability.
Business analytics and metrics
In addition to technical monitoring, Graphite can be used for tracking and visualizing business-related metrics, such as user engagement, sales data, or marketing campaign performance. By visualizing and analyzing these metrics over time, business stakeholders can gain insights into trends, identify opportunities for growth, and make data-driven decisions to improve their operations.
Apache Druid Pricing Model
Apache Druid is an open source project, and as such, it can be self-hosted at no licensing cost. However, organizations that choose to self-host Druid will incur expenses related to infrastructure, management, and support when deploying and operating Druid in their environment. These costs will depend on the organization’s specific requirements and the chosen infrastructure, whether it’s on-premises or cloud-based.
For those who prefer a managed solution, there are cloud services available that offer Apache Druid as a managed service, such as Imply Cloud. With managed services, the provider handles infrastructure, management, and support, simplifying the deployment and operation of Druid. Pricing for these managed services will vary depending on the provider and the selected service tier, which may include factors such as data storage, query capacity, and data ingestion rates.
Graphite Pricing Model
Graphite is an open-source project, and as such, it is freely available for users to download, install, and use without any licensing fees. However, users are responsible for setting up and maintaining their own Graphite infrastructure, which may involve costs related to server hardware, storage, and operational expenses. There are also several commercial products and services that build on top of or integrate with Graphite, offering additional features, support, or managed hosting options at varying price points.
Get started with InfluxDB for free
InfluxDB Cloud is the fastest way to start storing and analyzing your time series data.