1. Concepts
  2. StubberDB

Concepts

StubberDB

A managed PostgreSQL database automatically kept in sync with your stubs

StubberDB gives every Stubber org its own PostgreSQL schema, allowing you to query and analyse your stub data using standard SQL tooling without building any custom data pipelines.

Draft and Live Schemas

Each org is provisioned with two schemas that mirror the platform's draft and live branch model:

  • Draft schema — stubs and data from draft stubs are synchronised to the draft schema.
  • Live schema — stubs and data from live stubs are synchronised to the live schema.

This separation means you can safely iterate on schema changes in draft without affecting your live data.

All stubberdb tasks either explicitely require a branch to be specified, or execute against the current branch of the stub.

Automatic Sync

When StubberDB is enabled on an org, the update_stubberdb action stage is added to every stub execution automatically.
Each time a stub runs, this stage synchronises the stub's current state into the appropriate branch of the org's StubberDB schema.

Stub Table

StubberDB provides a single stubs table in each schema, which contains a row for every stub in the org.

Each row in the stubs table represents a single stub and is updated on every execution. The table contains the following columns:

Column Description
stubref Unique reference identifier for the stub
state The stub's current state
subject The subject of the stub
program_templateuuid The templateuuid the stub is executing
program_branch The branch the stub is executing
program_context The context the stub is executing
metrics_action_count Total number of actions executed on the stub
metrics_notification_count Total number of notifications sent from the stub
metrics_task_count Total number of tasks executed on the stub
metrics_is_flagged Whether the stub has been flagged
metrics_stubbucks_used Total Stubbucks consumed by the stub
created_at Timestamp when the stub was created
updated_at Timestamp of the last update to the stub record

Enabling StubberDB

StubberDB is enabled at the org level. Once enabled, all stubs in the org will automatically begin syncing on each execution.

NOTE

Go to StubberDB org settings to enable StubberDB for your org.