[英]Can we use Kstream with Spark Streaming in 2021?
Can we use Kstream with Spark in 2021?我们可以在 2021 年将 Kstream 与 Spark 一起使用吗?
Is it a recommended approach or using the Spark Streaming is a better solution.这是推荐的方法还是使用 Spark Streaming 是更好的解决方案。
You cannot.你不能。 Kafka Streams and Spark (Streaming) are not compatible to be used together.
Kafka Streams 和 Spark (Streaming) 不兼容,不能一起使用。
You can, alternatively, use Kubernetes, for example as a Spark Scheduler together with containerized Kafka Streams deployments that use the same input and output topics.或者,您可以使用 Kubernetes,例如作为 Spark 调度程序与使用相同输入和输出主题的容器化 Kafka Streams 部署一起使用。
Can we use Kstream with Spark in 2021?
我们可以在 2021 年将 Kstream 与 Spark 一起使用吗?
Sure.当然。
Is it a recommended approach
这是推荐的方法吗
Not really (if at all).不是真的(如果有的话)。
using the Spark Streaming is a better solution.
使用 Spark Streaming 是一个更好的解决方案。
"Better" begs for another question "In what scenarios?" “更好”引出了另一个问题“在什么情况下?”
Kafka Streams is a library and as such can be used anywhere a library could be used in an application, incl. Kafka Streams 是一个库,因此可以在任何可以在应用程序中使用库的地方使用,包括。 Spark applications.
火花应用。 In that sense, it is possible, but not really of much help IMHO.
从这个意义上说,这是可能的,但恕我直言,帮助不大。
Kafka Streams is simply a bunch of threads that use Consumer and Producer APIs to transform records. Kafka Streams 只是一堆使用消费者和生产者 API 来转换记录的线程。 That's the Kafka data source in Spark Structured Streaming exactly.
这正是 Spark Structured Streaming 中的 Kafka 数据源。
Kafka Streams applications are deployed as standalone Java applications (eg Docker containers in k8s). Kafka Streams 应用程序部署为独立的 Java 应用程序(例如 k8s 中的 Docker 容器)。 The same is also possible with Spark Structured Streaming (with Spark on Kubernetes).
Spark Structured Streaming(在 Kubernetes 上使用 Spark)也可以做到这一点。
See no real benefit using both in a single application but would love proven wrong.在单个应用程序中使用两者看不到真正的好处,但会喜欢被证明是错误的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.