Read and write datasets from your app
Every dataset a pipeline publishes is served at /api/datasets straight from its
Parquet files. There’s no export step: when a run commits, the new data is live.
Open Datasets in the app to browse them, try lookups and run SQL. Applications call
the same API with an API key (Authorization: Bearer …),
which can be limited to the datasets it needs.
| Call | Returns |
|---|---|
GET /api/datasets |
Every dataset, with its key, rows and snapshot |
GET /api/datasets/orders |
Schema, key, size, write status |
GET /api/datasets/orders/get?id=42 |
The row with that key |
GET /api/datasets/orders/range?from=100&to=200&limit=50 |
Rows with 100 <= id < 200, in key order |
GET /api/datasets/orders/sample?limit=20 |
A few rows |
POST /api/datasets/query {"sql": "SELECT …"} |
Read-only SQL over all datasets |
columns=id,totalreturns only those columns.snapshot=17reads an earlier version of the dataset.- Values are typed from the URL, so
?day=2026-09-30works on a date key. - Composite keys: give every key column,
?region=eu&id=42.
A key lookup reads about one page of one file. Responses include a stats block and a
server-timing header so you can see why a read took the time it did.
Give your dataset a key. Set key on the pipeline’s dataset target. Flux sorts the
files by it and adds bloom filters, which is what makes lookups fast. Ranges work best on
the key, too.
SQL is for questions, not exports: it’s capped at 10,000 rows and a time limit. For large extracts, add a file target to a pipeline.
Datasets are read-only by default. An admin can make one writable on its page (Writes → Allow writes), or with:
PUT /api/datasets/customers/writes{"enabled": true, "writer_role": "editor"}The dataset needs a key. Then editors (or admins only, if you choose) can write:
POST /api/datasets/customers/rows{"put": [{"id": 42, "name": "Acme", "tier": "gold"}], "delete": [{"id": 7}]}{"seq": 1031, "put": 1, "deleted": 1, "pending": 12}- put inserts or replaces the whole row for its key. Give every column that can’t be null; unknown columns are rejected.
- delete takes just the key columns.
- Up to 1,000 operations per request, applied together. Each request is durable when it returns.
- Writes show up in every read right away on the server that took them. To be sure
another server shows it too, pass the returned sequence:
get?id=42&after=1031(or"after": {"customers": 1031}in a SQL request).
Writes are kept in a log and folded into the dataset’s files in the background, after
50,000 writes or 5 minutes by default (Flush now does it immediately). Each flush is
a new snapshot, so it shows up in history and fires flux.dataset.committed triggers like
a pipeline run.
When a pipeline also writes the dataset
Section titled “When a pipeline also writes the dataset”Pipeline runs keep working. Writes made through the API since the last flush win over the run’s rows for the same keys; everything else comes from the run. Flush before changing a writable dataset’s columns.
Limits
Section titled “Limits”- Full rows only; there’s no partial update.
- Very high write rates to one dataset queue behind each other (writes to a dataset are applied one request at a time). Batch rows into fewer requests.
- If writes pile up faster than they’re flushed, requests get
429until a flush catches up.
The engineering detail is in design 07.