ksqlDB tutorials and examples¶
Confluent provides many resources for learning how to create ksqlDB applications.
- ksqlDB quick starts: If you’re new to streaming data technology, start with these.
- Confluent developer courses: Created by devs for devs.
- Confluent demos on Gitpod: Confluent tutorials running on Gitpod.
- Common use cases: Frequently encountered ksqlDB use cases, like materializing a view.
- ksqlDB examples: Code examples and how-to guides for devs.
- ksqlDB videos: The latest videos about Confluent Platform ksqlDB and Confluent Cloud ksqlDB.
ksqlDB quick starts¶
- Confluent Platform Quick Start: 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: Run ksqlDB in a fully managed environment.
Confluent developer courses¶
- ksqlDB 101: This course covers ksqlDB architecture, how ksqlDB works, and typical use cases, with examples.
- Inside ksqlDB: This advanced ksqlDB course shows you how to read, write, process, and transform data using common queries and functions in SQL.
Confluent demos on Gitpod¶
- Gitpod: Confluent Platform Demo: Confluent’s showcase demo running on Gitpod. Explore Confluent Platform on your mobile devices.
Common use cases¶
Use ksqlDB to implement solutions for these common use cases.
- Materialized view/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: 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.
- 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.
ksqlDB in a Kafka streaming ETL¶
- Confluent Platform 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.
Clickstream data analysis pipeline¶
- Clickstream Data Analysis Pipeline Using ksqlDB: The tutorial uses standard streaming functions,
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 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, along with Elasticsearch and Grafana.
Confluent provides many examples and how-to guides to help you develop your ksqlDB applications.
Examples are short code snippets that show frequently-used ksqlDB operations, for example:
How-to Guides provide compact lessons that help you work with common ksqlDB functionality, for example:
You can configure Java streams applications to deserialize and ingest data in multiple ways, including Kafka console producers, JDBC source connectors, and Java client producers. For full code examples, see Pipelining with Kafka Connect and Kafka Streams.
- Kafka Tutorials include step-by-step instructions for building ksqlDB and Kafka applications.
Free Ebook: Mastering Kafka Streams and ksqlDB¶
- Mastering Kafka Streams and ksqlDB: Learn important stream processing concepts, use cases, and several interesting business problems. Learn the strengths of both Kafka Streams and ksqlDB to help you choose the best tool for each unique stream processing project. Non-Java developers will find the ksqlDB path to be an especially gentle introduction to stream processing.
See the latest videos on Confluent Platform ksqlDB and Confluent Cloud ksqlDB at the Confluent YouTube channel.
|ksqlDB HowTo: A mini video series||Robin Moffatt’s quick videos about ksqlDB, based on demo scripts that you can run for yourself.|
|Apache Kafka 101: ksqlDB||Tim Berglund provides a gentle introduction to ksqlDB concepts and queries.|
|Confluent Cloud Quick Start, ksqlDB, and Project Reactor (Redux)||Viktor Gamov provisions Kafka, Connect, and ksqlDB clusters in Confluent Cloud and accesses with the ksqlDB Reactor client.|
|Demo: The Event Streaming Database in Action||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||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||Vish Srinivasan talks Kafka stream processing fundamentals and discusses ksqlDB.|
|Ask Confluent #16: ksqlDB edition||Gwen Shapira hosts Vinoth Chandar in a wide-ranging talk on ksqlDB.|
|An introduction to ksqlDB||Robin Moffatt describes how ksqlDB helps you build scalable and fault-tolerant stream processing systems.|
|ksqlDB and the Kafka Connect JDBC Sink||Robin Moffatt demonstrates how to use ksqlDB with the Connect JDBC sink.|
|How to Transform a Stream of Events Using ksqlDB||Viktor Gamov demonstrates how to transform a stream of movie data.|
|ksqlDB Java Client and Confluent Cloud||Viktor Gamov takes the ksqlDB Java client for a spin and tests it against Confluent Cloud.|
- Confluent Resources: Videos, presentations, white papers, and more.