Skip to main content

Management and Execution

CLI​

Everything you can do with a Catchment is available from the duckstring CLI, also installed as ds. That includes deploying Ponds, setting Refreshes, controlling runs and querying data. The CLI works through the Catchment's HTTP API, so scripts, CI jobs and agents can do anything a person can.

UI​

Each Catchment serves a web UI at its own address. It shows the graph of Ponds and Ripples as they run, the history of every run, and the published data. You can set Refreshes and control runs from the UI, but the graph itself only changes when you deploy code.

The web UI: the demo pipeline running, the sidebar open on reports, and run history below
The web UI on the demo pipeline under a continuous Refresh. The sidebar shows the selected Pond, reports, and the panels below list recent runs and the detail of one.

Local Execution​

A Catchment runs the same way on a laptop as on a server. You can deploy Ponds to a local Catchment, refresh them and inspect their data, knowing they will behave the same once deployed elsewhere. Moving to a shared Catchment later takes very few changes. A small pipeline could even stay on a laptop for good.

Hosting​

For a shared Catchment that is always on, run the same server on a dedicated machine. Nothing else changes. Access can be controlled with API keys at three levels: read, demand (read plus Refreshes) and full.

Cloud Compute​

By default, Ponds run on the Catchment's own machine. Individual Ponds can instead run on cloud compute: AWS Fargate or EC2, Azure Container Apps or VMs, or Google Cloud Run or Compute Engine. This needs the Catchment's data stored on that cloud (S3, Azure storage or Cloud Storage) and the cloud's credentials configured. A Catchment runs cloud compute only on the cloud its data is stored on. The choice is made per Pond, in pond.toml or on the Catchment. Where cloud compute isn't configured, the Pond simply runs locally, so the same code works everywhere.

Ducks and Flocks​

Each running Pond gets its own worker process, called a Duck, which runs the Pond's Ripples with DuckDB. A Duck starts when its Pond has work and stops when the Pond goes idle. If the Catchment becomes unavailable mid-run, the Duck finishes the run and reports back once it can.

Occasionally one computation is too large for a Duck's memory, usually when a Trickle has to be recomputed in full. A Pond can allow that work to be sent to a larger engine, called a Flock: MotherDuck, which runs DuckDB itself, or a distributed engine such as StarRocks or Amazon Athena. DuckDB stays the authority on the result. On an engine that isn't DuckDB, only computations measured to give DuckDB's results are sent, and a sample of each result is recomputed in the Duck and compared before it's used. If anything goes wrong, the work runs in the Duck instead.

Failures​

When a Ripple fails, Duckstring can retry it within the same Pond Run, and can retry the whole Pond Run the next time a Source updates. Both retry budgets are set in pond.toml. By default a failed Ripple is retried once within its run, and a failed run isn't retried when a Source updates. Once they're used up, the Pond is marked failed.

Nothing from a failed run is published, so downstream Ponds keep reading the last good output. They're marked blocked rather than failed, so a failure only shows at its root. A failed Pond recovers when a later run succeeds, when a fixed version is deployed, or when it's cleared by hand. Each failure's error and traceback appear in the run history, and failures can also be sent as alerts to a webhook or email address.

Control​

Beyond Refreshes, a few commands act directly on a Pond's execution. They're available from duckstring control and the UI.

CommandEffect
wakerun once if the Sources already have newer data, without asking them to run
forcererun now at the current freshness, even with no upstream change
rebuildrebuild the Pond's tables from scratch on its next run
repairrebuild a connected set of Ponds now, in order
sleepclear the Pond's demand and recurring Refreshes, letting runs in progress finish
killstop the Pond's Duck immediately and hold the Pond until it's woken, forced or cleared
clearreset a failed or killed Pond without running it

See also​