Apache Storm vs Spark Streaming – Feature wise Comparison
This tutorial will cover the comparison between Apache Storm vs Spark Streaming. Apache Storm is the stream processing engine for processing real-time streaming data. While Apache Spark is general purpose computing engine. It provides Spark Streaming to handle streaming data. It process data in near real-time. Let’s understand which is better in the battle of Spark vs storm.
So, let’s start the comparison of Apache Storm vs Spark Streaming.
2. Apache Storm vs Spark Streaming Comparison
The following description shows the detailed feature wise difference between Apache Storm vs Spark Streaming. These differences will help you know which is better to use between Apache Storm and Spark. Let’s have a look on each feature one by one-
i. Processing Model
- Storm: It supports true stream processing model through core storm layer.
- Spark Streaming: Apache Spark Streaming is a wrapper over Spark batch processing.
- Storm: It provides a very rich set of primitives to perform tuple level process at intervals of a stream (filters, functions). Aggregations over messages in a stream are possible through group by semantics. It supports left join, right join, inner join (default) across the stream.
- Spark Streaming: It provides 2 wide varieties of operators. First is Stream transformation operators that transform one DStream into another DStream. Second is output operators that write information to external systems. The previous includes stateless operators (filter, map, mapPartitions, union, distinct than on) still as stateful window operators (countByWindow, reduceByWindow then on).
iii. State Management
- Storm: Core Storm by default doesn’t offer any framework level support to store any intermediate bolt output (the result of user operation) as a state. Hence, any application has to create/update its own state as and once required.
- Spark Streaming: The underlying Spark by default treats the output of every RDD operation(Transformations and Actions) as an intermediate state. It stores it as RDD. Spark Streaming permits maintaining and changing state via updateStateByKey API. A pluggable method couldn’t be found to implement state within the external system.
iv. Message Delivery Guarantees (Handling message level failures)
- Storm: It supports 3 message processing guarantees: at least once, at-most-once and exactly once. Storm’s reliability mechanisms are distributed, scalable, and fault-tolerant.
- Spark Streaming: Apache Spark Streaming defines its fault tolerance semantics, the guarantees provided by the recipient and output operators. As per the Apache Spark architecture, the incoming data is read and replicated in different Spark executor’s nodes. This generates failure scenarios data received but may not be reflected. It handles fault tolerance differently in the case of worker failure and driver failure.
v. Fault Tolerance (Handling process/node level failures)
- Storm: Storm is intended with fault-tolerance at its core. Storm daemons (Nimbus and Supervisor) are made to be fail-fast (that means that method self-destructs whenever any sudden scenario is encountered) and stateless (all state is unbroken in Zookeeper or on disk).
- Spark Streaming: The Driver Node (an equivalent of JT) is SPOF. If driver node fails, then all executors will be lost with their received and replicated in-memory information. Hence, Spark Streaming uses data checkpointing to get over from driver failure.
vi. Debuggability and Monitoring
- Storm: Apache Storm UI support image of every topology; with the entire break-up of internal spouts and bolts. UI additionally contributes information having any errors coming in tasks and fine-grained stats on the throughput and latency of every part of the running topology. It helps in debugging problems at a high level. Metric based monitoring: Storm’s inbuilt metrics feature supports framework level for applications to emit any metrics, which can simply integrate with external metrics/monitoring systems.
- Spark Streaming: Spark web UI displays an extra Streaming tab that shows statistics of running receivers (whether receivers are active, the variety of records received, receiver error, and so on.) and completed batches (batch process times, queuing delays, and so on). It is useful to observe the execution of the application. The following 2 info in Spark web UI are significantly necessary for standardization of batch size:
- Processing Time – The time to process every batch of data.
- Scheduling Delay – The time a batch stays in a queue for the process previous batches to complete.
vii. Auto Scaling
- Storm: It provides configuring initial parallelism at various levels per topology – variety of worker processes, executors, tasks. Additionally, it supports dynamic rebalancing, that permits to increase or reduces the number of worker processes and executors w/o being needed to restart the cluster or the topology. But, many initial tasks designed stay constant throughout the life of topology.
Once all supervisor nodes are fully saturated with worker processes, and there’s a need to scale out, one merely has to begin a replacement supervisor node and inform it to cluster wide Zookeeper.
It is possible to transform the logic of monitor the present resource consumption on every node in a very Storm cluster, and dynamically add a lot of resources. STORM-594 describes such auto-scaling mechanism employing a feedback system.
- Spark Streaming: The community is currently developing on dynamic scaling to streaming applications. At the instant, elastic scaling of Spark streaming applications doesn’t support.
Essentially, dynamic allocation doesn’t mean to use in Spark streaming at the instant (1.4 or earlier). The reason is that presently the receiving topology is static. The number of receivers is fixed. One receiver allots with every DStream instantiated and it’ll use one core within the cluster. Once the StreamingContext starts, this topology cannot modify. Killing receivers leads to stopping the topology.
viii. Yarn Integration
- Storm: The Storm integration alongside YARN is recommended through Apache Slider. A slider is a YARN application that deploys non-YARN distributed applications over a YARN cluster. It interacts with YARN RM to spawn containers for distributed application then manages the lifecycle of these containers. Slider provides out-of-the-box application packages for Storm.
- Spark Streaming: Spark framework provides native integration along with YARN. Spark streaming as a layer above Spark merely leverages the integration. Every Spark streaming application reproduces as an individual Yarn application. The ApplicationMaster container runs the Spark driver and initializes the SparkContext. Every executor and receiver run in containers managed by ApplicationMaster. The ApplicationMaster then periodically submits one job per micro-batch on the YARN containers.
- Storm: Each employee process runs executors for a particular topology. That’s mixing of various topology tasks doesn’t allow at worker process level which supports topology level runtime isolation. Further, every executor thread runs one or more tasks of an identical element (spout or bolt), that’s no admixture of tasks across elements.
- Spark Streaming: Spark application is a different application run on YARN cluster, wherever every executor runs in a different YARN container. Thus, JVM level isolation is provided by Yarn since 2 totally different topologies can’t execute in same JVM. Besides, YARN provides resource level isolation so that container level resource constraints (CPU, memory limits) can be organized.
x. Open Source Apache Community
- Storm: Apache Storm powered-by page healthy list of corporations that are running Storm in production for many use-cases. Many of them are large-scale web deployments that are pushing the boundaries for performance and scale. For instance, Yahoo reading consists of two, 300 nodes running Storm for near-real-time event process, with the largest topology spanning across four hundred nodes.
- Spark Streaming: Apache Spark streaming remains rising and has restricted expertise in production clusters. But, the general umbrella Apache Spark community is well one in all the biggest and thus the most active open supply communities out there nowadays. The general charter is space evolving given the massive developer base. this could cause maturity of Spark Streaming within the close to future.
xi. Ease of development
- Storm: It provides extremely easy, rich and intuitive APIs that simply describe the DAG nature of process flow (topology). The Storm tuples, which give the abstraction of data flowing between nodes within the DAG, are dynamically written. The motivation there’s to change the APIs for simple use. Any new custom tuple can be plugged in once registering its Kryo serializer. Developers will begin with writing topologies and run them in native cluster mode. In local mode, threads are used to simulate worker nodes, permitting the developer to set breakpoints, halt the execution, examine variables, and profile before deploying it to a distributed cluster wherever all this is often way tougher.
- Spark Streaming: It offers Scala and Java APIs that have a lot of a practical programming (transformation of data). As a result, the topology code is way a lot of elliptic. There’s an upscale set of API documentation and illustrative samples on the market for the developer.
xii. Ease of Operability
- Storm: It is little tricky to deploy/install Storm through many tools (puppets, and then on ) and deploys the cluster. Apache Storm contains a dependency on Zookeeper cluster. So that it can meet coordination over clusters, store state and statistics. It implements CLI support to install actions like submit, activate, deactivate, list, kill topology. a powerful fault tolerance suggests that any daemon period of time doesn’t impact executing topology.
In standalone mode, Storm daemons are compel to run in supervised mode. In YARN cluster mode, Storm daemons emerged as containers and driven by Application Master (Slider).
- Spark Streaming: It uses Spark as the fundamental execution framework. It should be easy to feed up Spark cluster on YARN. There are many deployment requirements. Usually we enable checkpointing for fault tolerance of application driver. This could bring a dependency on fault-tolerant storage (HDFS).
xiv. Language Options
- Storm: We can create Storm applications in Java, Clojure, and Scala.
- Spark Streaming: We can create Spark applications in Java, Scala, Python, and R.
So, this was all in Apache Storm vs Spark Streaming. Hope you like the explanation
3. Conclusion – Apache Storm vs Spark Streaming
Hence, the difference between Apache Storm vs Spark Streaming shows that Apache Storm is a solution for real-time stream processing. But Storm is very complex for developers to develop applications. Very few resources available in the market for it.
Storm can solve only one type of problem i.e Stream processing. But the industry needs a generalized solution which can solve all the types of problems. For example Batch processing, stream processing interactive processing as well as iterative processing. Here Apache Spark comes into limelight which is a general purpose computation engine. It can handle any type of problem. Apart from this Apache Spark is much too easy for developers and can integrate very well with Hadoop.
If you feel like something is missing in above article of Apache Storm vs Spark Streaming. So, please drop a comment.
Apache Hadoop vs Spark vs Flink.