Query Current State with a Streamhouse on Confluent Cloud
A Streamhouse serves current state from one continuously maintained table, instead of having each team load and maintain its own copy in a separate database. You read the table through Lightning Tables, Snapshot Queries, or Tableflow. AI agents query Lightning Tables over the Model Context Protocol (MCP).
This page describes the always-current table, how to choose a way to read from it, and the products and access patterns that serve it.
Start here: the always-current table
The way into a Streamhouse is a single table. You define your current state once as an Apache Flink® materialized table. You then serve that same table in three ways, for low-latency reads, for operational systems, and for analytics, instead of standing up a separate system for each destination.
To build this pattern yourself in about 30 minutes, see Quick Start: Build a Streamhouse on Confluent Cloud.
One table, three modes
You can serve the same maintained state in three ways:
Serve current state with Lightning Tables for low-latency reads by applications and AI agents.
Drive operational systems by consuming the table’s backing topic with sink connectors. For more information, see Connect to External Services in Confluent Cloud.
Feed the lakehouse you already have by exposing the same state as Apache Iceberg or Delta Lake with Tableflow.
A materialized table writes to a backing topic, and you enable a Lightning Table and Tableflow on that topic. To serve the table this way, give it a primary key. The backing topic of a table with a primary key is compacted by default, so the Lightning Table uses upsert mode and keeps the latest row for each key. For more information, see Enable a Lightning Table for a topic, Tableflow in Confluent Cloud, and Tableflow upsert mode.
Where the table is built
The materialized table is the boundary between processing and querying: processing builds the current state, and the query capabilities serve it. You build and maintain the table in Confluent Cloud for Apache Flink. The deep reference for materialized tables is in the Flink documentation.
Choose a query surface
After you have an always-current table, choose how to read from it based on the task you’re doing. Each workload reads the table through the surface that fits it.
Pick a surface by the task
Surfaces fall into two tiers. Serving-optimized surfaces handle many fast, concurrent queries at low latency, such as agent context, user-facing dashboards, and in-app analytics. Throughput-optimized surfaces handle a few large, complex queries that run in seconds to minutes, such as ad-hoc exploration, complex joins, and aggregations.
If you want to |
Use |
Through |
Availability |
Typical persona |
|---|---|---|---|---|
Look up current state with low latency and high concurrency (serving-optimized) |
Confluent Cloud Console, the API, MCP, the Confluent CLI, or JDBC |
Generally available |
Application, AI/ML, and platform engineers |
|
Serve context to AI agents (serving-optimized) |
MCP |
Generally available |
AI/ML engineers |
|
Run ad-hoc exploration and complex analytical queries (throughput-optimized) |
Flink SQL or a JDBC client |
Generally available |
Data engineers, analysts |
|
Feed a data warehouse or lakehouse (throughput-optimized) |
Iceberg or Delta Lake tables |
Generally available |
Data engineers |
Query products
Query products are the ways the platform serves current state for you to read.
Lightning Tables
A Lightning Table is a read-only table that Confluent Cloud maintains for each topic where you enable it, such as the backing topic of a Flink materialized table. You query it with SQL for point lookups, range scans, and full scans at low latency, so you don’t have to load the state into a separate database yourself. You can query it from the Confluent Cloud Console, API, MCP, Confluent CLI, or JDBC.
For the full documentation, see Lightning Tables in Confluent Cloud.
Snapshot Queries
Snapshot Queries run a bounded query that spans live Apache Kafka® topics and the historical data Tableflow keeps in Iceberg tables, in a single statement, so one decision can draw on both current conditions and long-range context.
For the full documentation, see Snapshot Queries in Confluent Cloud for Apache Flink. To run one, see Run a Snapshot Query with Confluent Cloud for Apache Flink.
Tableflow
Tableflow materializes the backing topic of your always-current table as Apache Iceberg or Delta Lake tables, so your existing warehouse and lakehouse tools read the same state without a separate pipeline.
Tableflow publishes new data to these tables approximately every 5 minutes. For more information, see Table freshness. In the Streamhouse, Tableflow is the lakehouse-facing way to serve the one maintained table.
For the full documentation, see Tableflow in Confluent Cloud.
Access patterns
Access patterns are the ways a consumer connects to the query products in the previous section.
MCP and the Real-Time Context Engine
The Real-Time Context Engine is the Model Context Protocol (MCP) interface to Lightning Tables. In the Streamhouse, MCP is an access pattern rather than a separate query product: it’s how an agent reads the Lightning Table for the always-current table’s backing topic.
For more information, see Real-Time Context Engine in Confluent Cloud. To connect an MCP client and query a Lightning Table, see Query a Lightning Table with MCP in Confluent Cloud.
Ways to query a Lightning Table
You query a Lightning Table with SQL, so you can read the current state in a Streamhouse without writing Kafka consumers. For the interfaces you can use to query a Lightning Table and how they compare, see Query a Lightning Table in Confluent Cloud.
You can query a Lightning Table in the following ways:
From Confluent Cloud Console, by running SQL in the Lightning Table’s preview panel. For a walkthrough, see Step 5: Serve the current state with Lightning Tables.
From AI agents, through the Real-Time Context Engine over the Model Context Protocol (MCP). For more information, see MCP and the Real-Time Context Engine.
From applications, through the API. For more information, see Query a Lightning Table with the API.
From a terminal or a script, with the Confluent CLI. For more information, see Query a Lightning Table with the Confluent CLI in Confluent Cloud.
From BI tools, SQL clients, and Java applications, with JDBC. For more information, see Query a Lightning Table with JDBC in Confluent Cloud.
Note
This website includes content developed at the Apache Software Foundation under the terms of the Apache License v2.