# Streams

> Move data between your warehouse and the systems you use, as often as every few minutes. Tables and records come in, and your numbers go out.

A stream moves data between your warehouse and another system, on a schedule. There are two kinds:

| | Streams in | Streams out |
|---|---|---|
| Moves | A database's tables, or an app's records, into your warehouse | Your agreed numbers into fields in Salesforce |
| Reads with | Postgres, published by sanda, or a connector cherry writes from the app's API documentation and an owner or admin approves | The editor: an object, a match field and a value per field |
| Lands as | A table per table or resource, `raw.<stream>__<name>` | Field values on your Salesforce records |
| Each run moves | New and changed rows only | Changed values only |

A **stream graph** joins the two. Every time a stream in lands rows, it runs the task that models what they feed, then starts the streams out that send the result, so a number goes out only once the rows it is built on have been modelled. See [stream graphs](https://docs.sanda-os.com.au/streams/graphs).

A stream is not a [connection](https://docs.sanda-os.com.au/connections). Connections sync databases, files and the apps in the catalogue through sanda's sync engine, on the schedule grid. A stream reads a database or an app's API directly, with its own schedule and its own credential, which is what lets it run every few minutes and reach apps the catalogue does not have.

## Where streams are

Streams are under **Data · Streams**, just below **Modelling** in the left navigation, once Streams is switched on for your console. The page has three tabs:

- **Graphs**: your stream graphs, with how each one's last pass went.
- **Streams in**: your streams in, what waits for approval, the [published sources](https://docs.sanda-os.com.au/streams/postgres) with the databases connected for them, and the connectors with their credentials.
- **Streams out**: your streams out, and the Salesforce orgs connected for them.

## How often a stream runs

A stream keeps its own clock, so it isn't tied to the 15 minute grid other schedules run on. It runs:

- **every few minutes or hours**, as often as your edition allows;
- **daily or weekly** at a time of day, in your time zone;
- **after something lands**, for a stream out: a connection's sync, a stream in, or a stream graph's modelling;
- **by hand**, when someone presses **Run now**.

When a run is still going as its next slot comes round, that slot is skipped rather than queued behind it, and the stream's page counts how many were skipped. For now a workspace's streams run one at a time, so a run that finds another stream's run under way waits for its turn. See [runs at once](https://docs.sanda-os.com.au/streams/runs#runs-at-once).

## Editions and limits

| | Basic | Standard | Enterprise |
|---|---|---|---|
| Streams in | not included | 20 | no limit |
| Streams out | not included | 1 | no limit |
| Fastest schedule | not included | every 15 minutes | every 5 minutes |
| Rows included a month | not included | 10,000,000 rows | 50,000,000 rows |

A trial has Standard's streams. A workspace that moves to an edition with fewer streams keeps every one: the oldest keep running up to the new edition's count, and the rest keep their definitions and wait, saying why. A stream scheduled more often than the new edition runs one skips its scheduled runs, saying so, until its schedule is changed. Moving back up is immediate. See [editions](https://docs.sanda-os.com.au/billing/editions).

## What streams cost

Streams are on two lines of your invoice:

- **Stream runs.** Each run that does its work is A$0.000182, whatever it moved. A run that fails, or is skipped, is not counted.
- **Stream rows.** The rows streams move: rows a stream in landed new or changed, and records a stream out's destination accepted. Each edition includes some every month, and the rest are A$20 a million. A run that finds nothing new moves nothing on this line.

A run also wakes your warehouse for a minute or more, which is billed as [compute](https://docs.sanda-os.com.au/billing/usage), like any other work on it. That is usually the larger part: a stream that runs every few minutes keeps your warehouse awake for much of the day, so choose the slowest schedule your team really needs. A stream every 15 minutes wakes it four times as often as one every hour.

You don't have to work it out. Where you choose a stream's schedule, the editor says what it costs a month at that schedule: its runs, and the least compute they wake. Once a stream has run, its page adds its rows at its recent pace, leaving out its first load. A stream with no schedule says what one run costs, and once it has run, what it costs a month at the pace it has been running. The estimate uses the prices your invoice uses.

## Who can do what

| | Owners and admins | Members and read-only members |
|---|---|---|
| See streams, stream graphs, their tables, runs and passes | Yes | Yes |
| Preview what a stream out would send | Yes | Yes |
| Ask cherry to build a stream in, and try its connector | Yes | No |
| Approve a connector, connect or disconnect a credential or a database | Yes | No |
| Create, change, pause, run or delete a stream or a stream graph | Yes | No |

A stream acts on the whole workspace's behalf with the workspace's credentials, so only owners and admins change one.

:::links
- [Stream graphs](https://docs.sanda-os.com.au/streams/graphs): Land, model and send, every time a stream in lands rows.
- [Streams in](https://docs.sanda-os.com.au/streams/in): A database's tables or an app's records, landed in your warehouse.
- [Stream a Postgres database](https://docs.sanda-os.com.au/streams/postgres): Connect it, choose its tables, and they arrive every few minutes.
- [Build a stream in with cherry](https://docs.sanda-os.com.au/streams/build-a-stream-in): From the app's documentation to a running stream.
- [Streams out](https://docs.sanda-os.com.au/streams/out): Your numbers, written into Salesforce fields.
- [Runs](https://docs.sanda-os.com.au/streams/runs): What each run did, and what to do when one fails.
:::
