• Oct 23, 2024

Getting Started with Apache Flink

  • DevTechie

A stream processing engine such that it is designed to process continuous streams of data at a very fast pace. An example of such a system would be fraud detection system, with the help of flink, in case of a fraud, say, stolen credit card, data can be processed instantaneously and subsequent alerts can be generated.

What is Flink?

A stream processing engine such that it is designed to process continuous streams of data at a very fast pace. An example of such a system would be fraud detection system, with the help of flink, in case of a fraud, say, stolen credit card, data can be processed instantaneously and subsequent alerts can be generated.

Why Flink?

Question you would ask is Spark is capable of doing the same so why Flink. Flink is much faster than Spark. In terms of speed, Flink > Spark > Hadoop and it gives us high throughput and low latency in running jobs i.e. it can process millions and millions of rows in a few seconds. It is highly robust and fault tolerant and in case of failures can start exactly at the point of failure.

Installation

Now that we know what and why, let’s answer How, so we start with installation. In order to install flink :

  • Go to flink.apache.org and navigate to Downloads

  • Install the latest one, while writing this article this is 1.15.2

  • After it is downloaded, open Terminal and navigate to the downloads folder or to the location where you have downloaded, and run the command below

  • This is it, flink is installed in the system. Now we need to start the cluster. In order to do that, we would need to run start-cluster.sh script, this script is available in the ./bin directory under flink.

  • Screenshot below:

Text form of above script:

tar xzf flink-1.15.2-bin-scala_2.12.tgzcd flink-1.15.2./bin/start-cluster.sh

Installation Validation

To validate if flink is installed, go to http://localhost:8081/ in your web browser. If you see screen below, then congratulations you have completed first step towards learning flink

And done!