Integration with Flink
Apache Flink is the distributed processing engine that runs every Cloudera SQL Stream Builder (SSB) job in Cloudera Streaming Analytics.
Flink is a distributed processing engine and a scalable data analytics framework. You can use Flink to process data streams at a large scale and to deliver real-time analytical insights about your processed data. Flink is designed to run in all common cluster environments, and to perform computations at in-memory speed and at any scale. It provides communication, fault tolerance, and data distribution for distributed computations over data streams.
Every SQL query that you run in SSB is a Flink job. Because SSB builds and runs the Flink job in the background, you can author, launch, and monitor stream processing jobs without writing Java. The jobs operate on unbounded streams of data until you stop them.
Because SSB runs on Flink, your jobs can use the main features of Flink: exactly-once processing, processing by event time, savepoints, and Flink SQL tables and connectors. With the connectors, you can enrich your streaming data with data from slowly changing sources, such as database tables.
In SSB, checkpointing is off by default, and the default checkpoint mode is At Least Once. For fault tolerance and exactly-once state, turn on Enable Checkpointing in the job settings, and set Checkpoint Mode to Exactly Once. For more information, see Checkpoints and savepoints.
Key concepts
- Unbounded streams
- A stream has a start but no end. A Flink job processes each event as it arrives and keeps running until you stop it.
- State
- Many queries, such as aggregations and joins, remember information across events. Flink keeps this state close to the processing so that it can access the state with low latency.
- Time
- Flink can process events by the time they happened (event time) or by the time they arrive (processing time). Watermarks tell Flink how far event time has progressed, so that windows and joins can produce complete results.
- Exactly-once processing
- When you turn on checkpointing, Flink takes checkpoints, which are consistent snapshots of the state of a job. If a job fails, Flink restores it from the latest checkpoint. When Checkpoint Mode is Exactly Once, each event affects the state exactly once.
- Savepoints
- A savepoint is a snapshot that you control. You can stop a job with a savepoint and start it again later from the same point.
For a longer description of each concept, see Flink concepts for Cloudera SQL Stream Builder users.
For more information about Flink, see the Apache Flink documentation.
