使用 Apache Storm 获取数据

Data ingestion with Apache Storm

我阅读了很多文章,其中解释了 Apache Storm 的实现以从 Apache Flume 或 Apache Kafka 摄取数据。阅读了几篇文章后,我的主要问题仍未得到解答。使用 Apache Kafka 或 Apache Flume 的主要好处是什么?为什么不直接从源收集数据到 Apache Storm 中?

为了理解这一点,我研究了这些框架。如果我错了请纠正我。

Apache Flume 是关于从源收集数据并将数据推送到接收器。本例中的接收器是 Apache Storm。

Apache Kafka 是关于从源收集数据并将它们存储在消息队列中,直到 Apache Storm 处理它。

我认为具有不同配置的原因可能与源数据的获取方式有关。 Storm spouts(Storm 拓扑中的第一个元素)旨在同步 轮询数据,而Flume 代理(agent=source+channel+sink)旨在异步在源头接收数据。因此,如果您有一个通知某些事件的系统,则需要 Flume 代理;然后该代理将负责接收数据并将其放入任何队列管理系统(ActiveMQ、RabbitMQ...)以便被 Storm 使用。这同样适用于卡夫卡。

我假设您正在处理连续计算算法或实时分析的用例。

如果您不使用 Kafka 或任何消息队列,下面给出的是您必须经历的过程:

(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.

以上都是消息队列(Kafka 等)的固有特性,您当然不会喜欢在这里重新发明轮子。