How to build a use case
Every Feldera use case has the same shape. Input connectors feed changes into SQL tables. SQL views compute the answers, and Feldera keeps them current on every change. Output connectors, queries or a change stream deliver the results. To build your use case, start from the example closest to it, then change the sources, the views and the outputs.
Steps
1. Run Feldera
Run Feldera locally with Docker, or use the online sandbox. Install the fda CLI to manage pipelines from a terminal, a script or an agent.
2. Declare tables and connect sources
A table declares the shape of an input. Its connectors property says where the data comes from. This table loads a Delta Lake table, then follows new versions of it:
CREATE TABLE orders (
order_id BIGINT NOT NULL PRIMARY KEY,
customer_id BIGINT,
status VARCHAR,
total DECIMAL(12, 2)
) WITH ('connectors' = '[{
"transport": {
"name": "delta_table_input",
"config": {"uri": "s3://lake/orders", "mode": "snapshot_and_follow"}
}
}]');
See all input connectors: Delta Lake, Iceberg, Kafka, PostgreSQL CDC, Debezium, S3, HTTP and more.
3. Write the logic as views
Write the answers you need as SQL views. Views can use full SQL, build on each other, and be recursive. Declare a view MATERIALIZED to query it at any time:
CREATE MATERIALIZED VIEW revenue_by_status AS
SELECT status, COUNT(*) AS orders, SUM(total) AS revenue
FROM orders
GROUP BY status;
4. Send results out
Attach output connectors to a view to write its changes to Kafka, Delta Lake, PostgreSQL, Redis and other destinations:
CREATE VIEW large_orders
WITH ('connectors' = '[{
"transport": {
"name": "kafka_output",
"config": {"bootstrap.servers": "broker:9092", "topic": "large-orders"}
},
"format": {"name": "json"}
}]')
AS SELECT * FROM orders WHERE total > 10000;
5. Deploy and start
fda create my-pipeline program.sql
fda start my-pipeline
You can also use the web console, the Python SDK or the REST API (OpenAPI spec).
6. Read the results
Query a materialized view:
fda exec my-pipeline "SELECT * FROM revenue_by_status"
Or subscribe to a view's changes over HTTP. With send_snapshot=true, you get the current contents first, then every change:
curl -X POST 'http://localhost:8080/v0/pipelines/my-pipeline/egress/revenue_by_status?format=json&send_snapshot=true'
Pick a starting point
Each example below is a complete pipeline. Copy its SQL, then change the connectors and the views.
| Use case | Sources | Views | Results | Start from |
|---|---|---|---|---|
| Agent context | Any mix of historical and live data | Views that the agent defines and deploys with fda | Ad-hoc queries, HTTP change stream | Agentic fraud detection |
| Fine-grained authorization (a graph use case) | Users, groups, objects and relationship tuples from PostgreSQL CDC or Kafka | Recursive views that resolve nested permissions | Redis, PostgreSQL or Kafka for fast lookups | Static FGA, dynamic FGA, FGA guide |
| Other graphs: reachability, hierarchies, transitive closure | Node and edge tables from any source | Recursive views | Any output | The FGA examples, recursive queries |
| Real-time medallion | Bronze Delta Lake or Iceberg tables | Silver and gold views | Delta Lake | Medallion SQL, guide |
| Lakehouse batch jobs | The batch job's Delta Lake, Iceberg or S3 tables | The job's SQL as views | Back to the lakehouse | Batch analytics SQL, guide |
| Streaming and CDC | Kafka, Debezium, PostgreSQL CDC | Views of any complexity | Kafka, PostgreSQL, Redis, HTTP | Debezium PostgreSQL, Debezium MySQL |
| Fraud detection | Transactions and reference data from Kafka and Delta Lake | Rolling-window features | A model, or a feature store | Fraud SQL, feature engineering SQL, guide |
More complete pipelines: example SQL programs and runnable demos.
Coming from Spark SQL
The felderize skill in Feldera Agent Skills translates Spark SQL to Feldera SQL. The batch jobs guide shows a full conversion.