What is ksqlDB?
Answer
ksqlDB is a streaming SQL database built on Kafka Streams that enables real-time stream processing using SQL syntax. Write SQL to process Kafka streams without writing Java code. Core abstractions: Streams: an unbounded, immutable sequence of events from a Kafka topic. Tables: a mutable, changelog-based view (materialized from a compacted topic). Operations: SELECT (continuous queries), CREATE STREAM AS SELECT (create a derived stream), CREATE TABLE AS SELECT (aggregate into a table), JOIN streams and tables. Example: CREATE STREAM fraud_alerts AS SELECT userId, amount FROM transactions WHERE amount > 10000; — creates a new Kafka topic with transactions over $10K. ksqlDB has a REST API and CLI, enabling non-Java developers to build stream processing pipelines. It runs as a managed service in Confluent Cloud.