160 points · by wener · 10y ago · 42 comments
https://www.youtube.com/watch?v=gVBLF0ohcrE
The rough summary is, if you need to do distributed multi-node computation with very low latency -- that is, end-to-end data processing time measured in millis or seconds -- then Storm will help you out. The "competitive" product in open source right now is pyspark + Spark Streaming.
The benefit of Storm is that it is an older (more mature) project with many production deployments. My team at Parse.ly wrote the open source Python + Storm integration libraries, pystorm and streamparse, which help Python programmers make use of Storm for large-scale stream processing: https://github.com/Parsely/streamparse. We also wrote pykafka, which is a Kafka client for Python: https://github.com/Parsely/pykafka -- these projects are related since Kafka is often the streaming data source used as the input to a Storm topology.
I still don't really know what kind of computation that is. Any specific, real-world examples? I'm genuinely curious.
Other examples of "common" steaming data with real-time use cases:
- Twitter firehose
- Network packet analysis
- Financial market data
- Device and sensor data
Think about getting a terabyte of data a day, or more.
Or you can take a different approach, and look at a system that does not use Storm, and then imagine at what scale that system would break. Do consider the system that Matthias Nehlsen wrote about here:
http://matthiasnehlsen.com/blog/2014/11/07/Building-Systems-...
Using Redis as a universal bus is a fine architecture for small amounts of data, where "small amounts of data" means a gigabyte a day, or maybe a little bit more.
But what about 10 gigabytes of data per day?
What about about 100 gigabytes of data per day?
Universal bus architectures break down when each node sees too many messages that are not meant for that node. There is a limit on how far you can go with an architecture where every node gets every message. Assuming that each message is suppose to be read by certain nodes, there is an inefficiency to sending messages to nodes that don't want the message.
But there is a wonderful flexibility to this system. And I've created similar systems. Nevertheless, at a certain scale, you need to give up that flexibility for the sake of scale.
Again, Matthias Nehlsen says this well:
http://matthiasnehlsen.com/blog/2014/10/30/Building-Systems-...
"What comes to mind immediately when regurgitating the requirements above is Storm and the Lambda Architecture. First I thought, great, such a search could be realized as a bolt in Storm. But then I realized, and please correct me if I’m wrong, that topologies are fixed once they are running. This limits the flexibility to add and tear down additional live searches. I am afraid that keeping a few stand-by bolts to assign to queries dynamically would not be flexible enough."
I would (and have) done exactly what Matthias Nehlsen suggests: use something like Redis for as long as you can. But I would also do what Montalenti eventually did, and adopt Storm to deal with a certain level of scale -- when you reach a scale where a universal bus architecture no longer works, sacrifice flexibility for performance, and switch to Apache Storm.
If I recall correctly, Montalenti and Parse.ly experimented with MongoDB and Cassandra and a bunch of other technologies before they found that Kafka/Storm is what they needed. Maybe he's written about the whole journey somewhere. Certainly, it would be interesting to read why all the other systems failed, and why moving to Kafka/Storm was the right choice for Parse.ly.
1: http://aadrake.com/command-line-tools-can-be-235x-faster-tha...
In our case, we had pushed the limits of the largest EC2 box we could find. We have to keep up with tens of thousands of events per second, and do non-trivial amounts of CPU processing on each of them. Whether Python, Java, C++, or assembler, it wasn't going to happen on a single box. We proved this to ourself by getting the biggest box we could and rewriting the hotspots of our code in Cython. It still wasn't enough.
- https://github.com/dask/distributed
- http://matthewrocklin.com/blog/work/2016/02/17/dask-distribu...
Probably never.
Spark, flink and a few proprietary tools can operate in both batch and streaming modes which means you can share your codebase between both tasks if you do them. Before these tools it used to be hadoop for batch and storm for streaming, but I suspect those days are dying now (which goes some way to explaining spark's success) except if you require exceptional throughput in which case do some research & benchmarks.
https://yahooeng.tumblr.com/post/135321837876/benchmarking-s...
If you really need low latencies, it is quite likely that none of these will work for you anyway and you would have to build a specialized CEP-style system.
In theory, Storm can be set up to run with much lower latency than the others, but it is rare that an app will need that kind of response time.
For example, Twitter used to use Storm to process analytics on tweet data. They now use Heron. [1] Storm is valuable when your data is constantly being generated as a stream, on which you would like to perform processing immediately. I've previously also used Storm's distributed RPC cluster, where I fire off a task that I would like processed in the background and wait for the response to arrive.
[1] https://blog.twitter.com/2015/flying-faster-with-twitter-her...
Anyone privy to what changes they made to yield the performance improvements?
"Profiling a simple speed of light topology, shows that a good chunk of time of the SpoutOutputCollector.emit() is spent in the clojure reduce() function.. which is part of the ACK-ing logic. Re-implementing this reduce() logic in java gives a big performance boost in both in the Spout.nextTuple() and Bolt.execute()"
Your take, guys?