Keep results in an internal datasource
Keep a Mission's results from run to run in a storage space Tellius manages, so several Missions and an App can share data without a warehouse.
Missions and Apps don't keep data on their own. A Mission run's tables stay in its conversation, and nothing a person types into an App is saved. An internal datasource is a storage space that Tellius manages for you. A Mission can keep its results there run after run, an App can read them, and an App's buttons can write to it, for example to record a note or an approval.
Use it to link several Missions and an App when you don't have a data warehouse, or another storage system connected to Kaiya, to hold the data in between. Kaiya sets it up for you in the conversation. There is no separate screen to configure it.
Step 1: Ask Kaiya to keep the data
Say what should be kept and who will use it, in the Mission's conversation. For example:
"Keep each run's coverage counts so I can see the history in an App."
"Let territory managers record an override for each account in the App, and keep it."
"Store the latest scorecard so the App always shows the newest run."
Kaiya first looks for an internal datasource you own, or that was shared with you, that fits this use case. A datasource shared with you as read-only can't be stored into.
Step 2: Answer the Internal datasource question
Kaiya always asks before it creates an internal datasource, even when your request already says to keep the results. A question with the header Internal datasource says what the datasource will hold, and offers answers such as:
Create 'Coverage history' (ClickHouse)
Create 'Coverage history' (Postgres)
Use 'existing name', for each existing datasource that could fit
Kaiya names the datasource for what it holds, recommends one engine first and says why in one line. Choose an answer and select Submit. One answer creates one datasource, so Kaiya asks again if the use case needs a second one.
Postgres or ClickHouse
The engine is fixed when the datasource is created.
Postgres
ClickHouse
Best for
Many small, specific changes: notes, approvals, overrides, statuses
Large result sets that a Mission writes and an App analyzes
Typical data
What an App's users type in
Run-by-run snapshots, event or record history, wide results
What App buttons can do
Add, change and delete rows
Add rows only
Several writes in one step
All or nothing
Applied in order, one after another
Rows per store (a guide, not a limit)
Up to about 20,000
Up to about 100,000
Step 3: Choose how much history to keep
Kaiya adds a step to the Mission that keeps an earlier step's rows in a table. The table's columns are the columns of that earlier step. The table is created on the first run, gains a column when the step gains one, and never loses or changes a column.
Every run: each run adds its rows to the table and keeps the ones before it (append). Kaiya stamps each row with the run time.
Only the latest: each run replaces the table's rows with its own (replace).
For anything more, such as one current row per account, several tables in one step, or changing and deleting rows, Kaiya writes a short Python step that saves the data. It can also keep only the latest few runs, or skip rows the table already holds. Tell Kaiya how much history you need when it isn't clear from your request.
Step 4: Publish and run the Mission
Only the published Mission's runs store rows: a run from Run, a scheduled run, or a run you ask Kaiya for after publishing. While you build and check the draft, the step only prepares the tables and reports what it would have written, so your history never fills up with test runs. Kaiya tells you this as you build.
To have data to show in an App, publish the Mission and run it, then build the App. See How to create a Kaiya Mission.
Each result is written once. When a run reuses an earlier result because the step behind it hasn't changed, the step reports that the table already holds this result, and writes nothing. That isn't a failure.
Read and write from an App
Reading. An App reads the table through live cells, so it reads the table again each time it opens and every new run appears without a refresh. See Live data in Apps.
Latest run or all runs. When the table keeps every run, the App shows the latest run unless you ask for history. Charts that show change over time use every run. Kaiya labels which one each view shows, for example Latest run or All runs.
Writing. An App's buttons can write to the datasource, for example Add note. On Postgres, a button can add, change or delete rows. On ClickHouse, it can only add rows. Every click asks the person using the App to confirm before anything is written, and they write with their own access. After the write, the App shows the new row.
Sharing and remixes
Sharing. When you share a Mission or an App, its internal datasources are shared with it, with write access. The people you share it with can run the Mission and use the App's buttons. It is still one set of tables, so their runs and notes appear for you too.
Remixing. A remixed copy still points at the original's datasource. Before the copy runs or is saved, Kaiya asks an Internal datasource question: Create a separate internal datasource for this copy (recommended, so the copy's runs stay apart from the original's) or Keep writing to 'name' (shared with the original). If you choose a separate datasource, Kaiya asks which engine to use. A copy of a copy is asked again. Reading someone else's datasource never needs this choice. See Remix a Mission shared with you.
Good to know
Tellius makes the writes with the datasource's own sign-in. The Mission and the App never hold a password or a connection.
Kaiya writes the SQL for the datasource's engine, so you don't need to know the difference between Postgres and ClickHouse.
The row counts in the engine table are guides. Above them, the rows are still stored and the step notes it. For very large tables, ask Kaiya to aggregate first or use ClickHouse.
Related pages
Was this helpful?