2015-03-03 78 views
4

我一直在閱讀很多文章,其中Apache Storm的實現被解釋爲從Apache Flume或Apache Kafka攝取數據。閱讀了幾篇文章後,我的主要問題仍未得到解答。使用Apache Kafka或Apache Flume的主要好處是什麼?爲什麼不直接從數據源中收集數據到Apache Storm?Apache Storm的數據攝入

爲了理解這一點,我研究了這些框架。糾正我,如果我錯了。

Apache Flume是關於從源收集數據並將數據推送到接收器的。在這種情況下,水槽就是Apache Storm。

Apache Kafka是關於從源收集數據並將它們存儲在消息隊列中,直到Apache Storm處理它。

回答

4

我假設您正在處理連續計算算法或實時分析的用例。

下面給出的是你將不得不經歷,如果你不使用卡夫卡或者任何消息隊列什麼:

(1) You will have to implement functionality like consistency of data. 

(2) You are ready to implement replication on your own 

(3) You are ready to tackle a variety of failures and ready to build a fault tolerant system. 

(4) You will need to create a good design so that your producer and consumer are completely decoupled. 

(5) You will have to implement persistence. What happens if your consumer fails? 

(6) What happens to fault resilience? Do you want to take the entire system down when your consumer fails? 

(7) You will have to implement delivery guarantees as well as ordering guarantees. 

以上所有的都是一個消息隊列的固有特性(卡夫卡等)和你當然不會喜歡在這裏重新發明輪子。

1

我認爲有不同配置的原因可能是源數據是如何獲得的。風暴噴口(Storm風格拓撲中的第一個元素)意味着同步輪詢數據,而Flume代理(代理=源+通道+接收器)意圖以異步在源處接收數據。因此,如果你有一個通知某些事件的系統,那麼需要一個Flume代理;那麼這個代理將負責接收數據並將其放入任何隊列管理系統(ActiveMQ,RabbitMQ ...)中以便被Storm收購。這同樣適用於Kafka。

+1

Flume源有兩種類型:PollableSource和EventDrivenSources。所以它不僅僅意味着要異步接收數據。風暴噴口也可以作爲事件驅動實施,只需稍作調整即可。 Twitter的噴口實施可以是一個例子。 – Lan 2015-03-11 16:20:02