Hi,
I asked the same question on StackOverflow but received no response so
far, so I thought I could also post it here. The original question can
be found at:
https://stackoverflow.com/q/58922246/477168 Feel free to
(also) reply there.
For convenience find the original text below.
---
So the code is the same in both approaches and it's roughly the following:
```java
StreamExecutionEnvironment env =
StreamExecutionEnvironment.getExecutionEnvironment();
// prepare the topology...
env.execute();
```
The scenario is Flink running *locally* on a single machine.
## Standalone JAR
`pom.xml` (relevant bits):
```xml
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-core</artifactId>
<version>1.9.0</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_2.12</artifactId>
<version>1.9.0</version>
</dependency>
```
Run with:
```console
java -cp target/My-0.0.0.jar MainClass
```
## `start-cluster.sh`
`pom.xml` (relevant bits):
```xml
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-core</artifactId>
<version>1.9.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_2.12</artifactId>
<version>1.9.0</version>
<scope>provided</scope>
</dependency>
```
Run with:
```console
/path/to/flink-1.9.1/bin/flink run -c MainClass target/My-0.0.0.jar
```
---
[This][1] documentation page states:
> The LocalExecutionEnvironment is starting the full Flink runtime, including a JobManager and a TaskManager. These include memory management and all the internal algorithms that are executed in the cluster mode.
And makes me think that there is no practical differences between the
two, but I can't be sure...
Is there anything else I need to consider? Would there be any
differences in terms of performance?
[1]:
https://ci.apache.org/projects/flink/flink-docs-stable/dev/local_execution.htmlBest,
Andrea