2018-12-13 14:47:20 -05:00
---
2019-08-21 00:48:59 -04:00
id: druid-vs-spark
title: "Apache Druid vs Spark"
2018-12-13 14:47:20 -05:00
---
2018-11-13 12:38:37 -05:00
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
2015-05-05 17:07:32 -04:00
2015-11-09 19:56:43 -05:00
Druid and Spark are complementary solutions as Druid can be used to accelerate OLAP queries in Spark.
2019-08-21 00:48:59 -04:00
Spark is a general cluster computing framework initially designed around the concept of Resilient Distributed Datasets (RDDs).
RDDs enable data reuse by persisting intermediate results
2015-05-05 17:07:32 -04:00
in memory and enable Spark to provide fast computations for iterative algorithms.
This is especially beneficial for certain work flows such as machine
learning, where the same operation may be applied over and over
2019-08-21 00:48:59 -04:00
again until some result is converged upon. The generality of Spark makes it very suitable as an engine to process (clean or transform) data.
2016-06-15 13:30:19 -04:00
Although Spark provides the ability to query data through Spark SQL, much like Hadoop, the query latencies are not specifically targeted to be interactive (sub-second).
2015-05-05 17:07:32 -04:00
2019-08-21 00:48:59 -04:00
Druid's focus is on extremely low latency queries, and is ideal for powering applications used by thousands of users, and where each query must
return fast enough such that users can interactively explore through data. Druid fully indexes all data, and can act as a middle layer between Spark and your application.
2016-06-15 13:30:19 -04:00
One typical setup seen in production is to process data in Spark, and load the processed data into Druid for faster access.
For more information about using Druid and Spark together, including benchmarks of the two systems, please see:
< https: / / www . linkedin . com / pulse / combining-druid-spark-interactive-flexible-analytics-scale-butani >