ksqlDB provides a SQL-like way to define and deploy continuous event-processing queries over Kafka data. It addresses the administrative and coding overhead of creating a full application by running declarative KSQL queries continuously on a server cluster. section 8.4.1
Traditional SQL usually queries a static database snapshot. ksqlDB instead evaluates queries against an ongoing flow of events, making filtering, trend detection, and aggregation available as changes arrive rather than only after batch processing. section 8.4.1
Typical ksqlDB definitions include:
- Declaring an Orders stream with fields, a Kafka topic, JSON value format, and eight partitions. section 8.4.1
- Creating Expensive_Orders by selecting orders whose amount_paid exceeds 100 and emitting changes continuously. section 8.4.1
- Building a table that counts orders by country, optionally using a one-hour tumbling window for time-bounded aggregation. section 8.4.1
Figure 8.18 In the ksqlDB server, the KSQL query is transformed into multiple instances of Kafka Streams applications. These applications consume events from the Orders topic, process the data, and produce the results to the Orders_Count_By_Country topic.
The architecture view shows how a ksqlDB server turns a query into multiple Kafka Streams application instances that consume, process, and publish Kafka records. section 8.4.1

