

# Component Stack

As a software stack, Flink is a layered system. The different layers of the stack build on top of each other and raise the abstraction level of the program representations they accept:

*   The **runtime** layer receives a program in the form of a _JobGraph_. A JobGraph is a generic parallel data flow with arbitrary tasks that consume and produce data streams.

*   Both the **DataStream API** and the **DataSet API** generate JobGraphs through separate compilation processes. The DataSet API uses an optimizer to determine the optimal plan for the program, while the DataStream API uses a stream builder.

*   The JobGraph is executed according to a variety of deployment options available in Flink (e.g., local, remote, YARN, etc)

*   Libraries and APIs that are bundled with Flink generate DataSet or DataStream API programs. These are Table for queries on logical tables, FlinkML for Machine Learning, and Gelly for graph processing.

You can click on the components in the figure to learn more.

<center>![Apache Flink: Stack](../img/stack.png)</center>

<map name="overview-stack"><area id="lib-datastream-cep" title="CEP: Complex Event Processing" href="//ci.apache.org/projects/flink/flink-docs-release-1.7/dev/libs/cep.html" shape="rect" coords="63,0,143,177"> <area id="lib-datastream-table" title="Table: Relational DataStreams" href="//ci.apache.org/projects/flink/flink-docs-release-1.7/dev/table_api.html" shape="rect" coords="143,0,223,177"> <area id="lib-dataset-ml" title="FlinkML: Machine Learning" href="//ci.apache.org/projects/flink/flink-docs-release-1.7/dev/libs/ml/index.html" shape="rect" coords="382,2,462,176"> <area id="lib-dataset-gelly" title="Gelly: Graph Processing" href="//ci.apache.org/projects/flink/flink-docs-release-1.7/dev/libs/gelly/index.html" shape="rect" coords="461,0,541,177"> <area id="lib-dataset-table" title="Table API and SQL" href="//ci.apache.org/projects/flink/flink-docs-release-1.7/dev/table_api.html" shape="rect" coords="544,0,624,177"> <area id="datastream" title="DataStream API" href="//ci.apache.org/projects/flink/flink-docs-release-1.7/dev/datastream_api.html" shape="rect" coords="64,177,379,255"> <area id="dataset" title="DataSet API" href="//ci.apache.org/projects/flink/flink-docs-release-1.7/dev/batch/index.html" shape="rect" coords="382,177,697,255"> <area id="runtime" title="Runtime" href="//ci.apache.org/projects/flink/flink-docs-release-1.7/concepts/runtime.html" shape="rect" coords="63,257,700,335"> <area id="local" title="Local" href="//ci.apache.org/projects/flink/flink-docs-release-1.7/tutorials/local_setup.html" shape="rect" coords="62,337,275,414"> <area id="cluster" title="Cluster" href="//ci.apache.org/projects/flink/flink-docs-release-1.7/ops/deployment/cluster_setup.html" shape="rect" coords="273,336,486,413"> <area id="cloud" title="Cloud" href="//ci.apache.org/projects/flink/flink-docs-release-1.7/ops/deployment/gce_setup.html" shape="rect" coords="485,336,700,414"></map> 