<a id="ksql-tutorials"></a>

# Tutorials and Examples with ksqlDB for Confluent Platform

Learn to build ksqlDB applications through tutorials, blog posts,
developer courses, and videos.

- [ksqlDB quick starts](#ksqldb-tutorials-quickstarts): If you’re new to streaming data technology,
  start with these.
- [ksqlDB blog posts](#ksqldb-blog-posts): Official Confluent blog posts on ksqlDB.
- [Confluent developer courses](#ksqldb-tutorials-developer-courses): Created by devs for devs.
- [Confluent demos on Gitpod](#ksqldb-tutorials-gitpod): Confluent tutorials running on Gitpod.
- [Common use cases](#ksqldb-tutorials-use-cases): Frequently encountered ksqlDB use cases,
  like materializing a view.
- [ksqlDB videos](#ksqldb-tutorials-videos): The latest videos about Confluent Platform ksqlDB and
  Confluent Cloud ksqlDB.

<a id="ksqldb-tutorials-quickstarts"></a>

## ksqlDB quick starts

- [Confluent Platform Quick Start](../../get-started/platform-quickstart.md#quickstart): Demonstrates a simple
  workflow using ksqlDB to write streaming queries against messages in
  Apache Kafka®. You can deploy locally or with Docker.
- [Confluent Cloud Quick Start](/cloud/current/get-started/index.html#section-2-add-ksql-cloud-to-the-cluster): Run ksqlDB
  in a fully managed environment.

  <a id="ksqldb-blog-posts"></a>

## ksqlDB blog posts

- [Is Apache Kafka a Database? With ksqlDB, Most Definitely](https://www.confluent.io/blog/is-kafka-a-database-with-ksqldb/)
- [Real-Time Gaming Infrastructure for Millions of Users with Apache Kafka, ksqlDB, and WebSockets](https://www.confluent.io/blog/real-time-gaming-infrastructure-kafka-ksqldb-websockets/)
- [Data Enrichment in Existing Data Pipelines Using Confluent Cloud](https://www.confluent.io/blog/data-enrichment-for-real-time-data-pipelines-and-analytics/)
- [Serverless Stream Processing with Apache Kafka, Azure Functions, and ksqlDB](https://www.confluent.io/blog/serverless-stream-processing-with-apache-kafka-and-azure/)
- [Apache Kafka at Home: A Houseplant Alerting System with ksqlDB](https://www.confluent.io/blog/using-data-pipelines-for-real-time-alerting-with-ksqldb/)
- [Introduction to Streaming Data Pipelines with Apache Kafka and ksqlDB](https://www.confluent.io/blog/streaming-data-pipeline-with-apache-kafka-and-ksqldb/)
- [A Guide to Stream Processing and ksqlDB Fundamentals](https://www.confluent.io/blog/guide-to-stream-processing-and-ksqldb-fundamentals/)
- [Intrusion Detection with ksqlDB](https://www.confluent.io/blog/build-a-intrusion-detection-using-ksqldb/)
- [How Real-Time Stream Processing Safely Scales with ksqlDB, Animated](https://www.confluent.io/blog/how-real-time-stream-processing-safely-scales-with-ksqldb/)

<a id="ksqldb-tutorials-developer-courses"></a>

## Confluent developer courses

- [ksqlDB 101](https://developer.confluent.io/learn-kafka/ksqldb/intro/):
  This course covers ksqlDB architecture, how ksqlDB works, and typical
  use cases, with examples.
- [Inside ksqlDB](https://developer.confluent.io/learn-kafka/inside-ksqldb/streaming-architecture/):
  This advanced ksqlDB course shows you how to read, write, process, and
  transform data using common queries and functions in SQL.

<a id="ksqldb-tutorials-gitpod"></a>

## Confluent demos on Gitpod

- [Gitpod: Confluent Platform Demo](https://gitpod.io/#https://github.com/confluentinc/cp-demo/tree/current-post): Confluent’s showcase demo
  running on Gitpod. Explore Confluent Platform on your mobile devices.

<a id="ksqldb-tutorials-use-cases"></a>

## Common use cases

Use ksqlDB to implement solutions for these common use cases.

### Materialized view/cache

- [Materialized view/cache](materialized-view.md#ksqldb-tutorials-materialized-cache):
  Create and query a set of materialized views about phone calls made to a call
  center. This tutorial demonstrates capturing changes from a MySQL database,
  forwarding them into Kafka, creating materialized views with ksqlDB, and
  querying them from your applications.

### Streaming ETL pipeline

- [Streaming ETL pipeline](etl.md#ksqldb-tutorials-streaming-etl-pipeline):
  Create a streaming ETL pipeline that ingests and joins events together to
  create a cohesive view of orders that have shipped. This tutorial demonstrates
  capturing changes from Postgres and MongoDB databases, forwarding them into Kafka,
  joining them together with ksqlDB, and sinking them out to ElasticSearch for
  analytics.
- [Confluent Platform demo](../../tutorials/cp-demo/index.md#cp-demo): Deploy a Kafka streaming ETL that
  uses ksqlDB for stream processing. All components in the Confluent Platform demo have
  encryption, authentication, and authorization configured end-to-end.
- [Use Case: Streaming ETL](https://www.confluent.io/use-case/streaming-etl/):
  Confluent makes it easy to gain real-time insights by moving from batch to
  streaming ETL through scalable, performant, and cloud-native data pipelines.
  Ingest, aggregate, and transform data streams in-flight from any system,
  application, or device at any scale and across any environment, to power
  real-time analytics use cases.

### Event-driven microservice

- [Event-driven microservice](event-driven-microservice.md#ksqldb-tutorials-event-driven-microservice):
  Create an event-driven microservice that identifies suspicious activity and
  notifies customers. This tutorial demonstrates finding anomalies with ksqlDB
  and sending alert emails using a simple Kafka consumer with SendGrid.
- [Use Case: Event Driven Microservices](https://www.confluent.io/use-case/event-driven-microservices-communication/):
  Completely decouple your architecture and eliminate interservice
  dependencies so developers can build business logic faster. Build a new
  class of highly scalable event-driven microservices that are resilient in
  design and contextually aware.

### Clickstream data analysis pipeline

- [Create Clickstream Data Analysis Pipeline Using ksqlDB in Confluent Platform](clickstream.md#clickstream-demo): The tutorial uses standard streaming functions,
  like `min` and `max`, and enrichment using child tables, stream-table
  join, and different types of windowing functionality.

Clickstream analysis is the process of collecting, analyzing, and
reporting aggregate data about which pages a website visitor visits and
in what order. The path the visitor takes though a website is called the
clickstream.

This tutorial focuses on building real-time analytics of users to determine:

* General website analytics, such as hit count and visitors
* Bandwidth use
* Mapping user-IP addresses to actual users and their location
* Detection of high-bandwidth user sessions
* Error-code occurrence and enrichment
* Sessionization to track user-sessions and understand behavior,
  like per-user-session-bandwidth and per-user-session-hits

If you don’t have Docker, you can run an
[automated version](https://github.com/confluentinc/examples/tree/master/clickstream)
of the Clickstream tutorial designed for local Confluent Platform installs. Running the Clickstream demo
locally without Docker requires that you have Confluent Platform [installed locally](../../installation/overview.md#installation),
along with Elasticsearch and Grafana.

<a id="ksqldb-tutorials-examples"></a>

## ksqlDB how-to guides

[How-to Guides](../how-to-guides/overview.md#ksqldb-how-to-guides) provide compact lessons that
help you work with common ksqlDB functionality, for example:

- [Query structured data](../how-to-guides/query-structured-data.md#ksqldb-how-to-query-structured-data)
- [Create a user-defined function](../how-to-guides/create-a-user-defined-function.md#ksqldb-how-to-create-a-udf)
- [Test a ksqlDB app](../how-to-guides/test-an-app.md#ksqldb-how-to-test-an-application)

## ksqlDB recipes

- [ksqlDB recipes and Kafka Tutorials](https://developer.confluent.io/tutorials)
  include code and step-by-step instructions for building ksqlDB and Kafka
  applications.

<a id="ksqldb-tutorials-videos"></a>

## ksqlDB videos

See the latest videos on Confluent Platform ksqlDB and Confluent Cloud ksqlDB at the
[Confluent YouTube channel](https://www.youtube.com/channel/UCmZz-Gj3caLLzEWBtbYUXaA).

| Video                                                                                                           | Description                                                                                                                      |
|-----------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|
| [Flink vs Kafka Streams/ksqlDB](https://www.youtube.com/watch?v=Wqko7MunKZs)                                    | Jeff Bean and Matthias Sax compare stream processing tools.                                                                      |
| [Build a Plant Monitoring System with ksqlDB](https://www.youtube.com/watch?v=yi-KOg2LSY4)                      | Robin Moffatt’s quick videos about ksqlDB, based on demo scripts that you can run for yourself.                                  |
| [Apache Kafka 101: ksqlDB](https://www.youtube.com/watch?v=Da6MwowCGHo)                                         | Tim Berglund provides a gentle introduction to ksqlDB concepts and queries.                                                      |
| [Confluent Cloud Quick Start, ksqlDB, and Project Reactor (Redux)](https://www.youtube.com/watch?v=xorcbmFDwYA) | Viktor Gamov provisions Kafka, Connect, and ksqlDB clusters in Confluent Cloud and accesses them with the ksqlDB Reactor client. |
| [Demo: The Event Streaming Database in Action](https://www.youtube.com/watch?v=D5QMqapzX8o)                     | Tim Berglund builds a movie rating system with ksqlDB to write movie records into a Kafka topic.                                 |
| [Demo: Seamless Stream Processing with Kafka Connect & ksqlDB](https://www.youtube.com/watch?v=4odZGWl-yZo)     | Set up and build ksqlDB applications using the AWS source, Azure sink, and MongoDB source connectors in Confluent Cloud.         |
| [Introduction to ksqlDB and stream processing](https://www.youtube.com/watch?v=-kFU6mCnOFw)                     | Vish Srinivasan talks Kafka stream processing fundamentals and discusses ksqlDB.                                                 |
| [Ask Confluent #16: ksqlDB edition](https://www.youtube.com/watch?v=SHKjuN2iXyk)                                | Gwen Shapira hosts Vinoth Chandar in a wide-ranging talk on ksqlDB.                                                              |
| [An introduction to ksqlDB](https://www.youtube.com/watch?v=7mGBxG2NhVQ)                                        | Robin Moffatt describes how ksqlDB helps you build scalable and fault-tolerant stream processing systems.                        |
| [ksqlDB and the Kafka Connect JDBC Sink](https://www.youtube.com/watch?v=ad02yDTAZx0)                           | Robin Moffatt demonstrates how to use ksqlDB with the Connect JDBC sink.                                                         |
| [How to Transform a Stream of Events Using ksqlDB](https://www.youtube.com/watch?v=PaHv4fGq-9k)                 | Viktor Gamov demonstrates how to transform a stream of movie data.                                                               |
| [ksqlDB Java Client and Confluent Cloud](https://www.youtube.com/watch?v=6mBY_GL_D5g)                           | Viktor Gamov takes the ksqlDB Java client for a spin and tests it against Confluent Cloud.                                       |

## Recommended resources

- [Confluent Resources](https://www.confluent.io/resources/):
  Videos, presentations, white papers, and more.
