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 analyze your stub data using standard SQL tooling without building any custom data pipelines.

Features

  • Allows you to create and manage tabular data that is automatically kept in sync with your stubs on every execution.
  • Provides a single stubs table that contains a row for every stub in your org
  • Supports the same branch model as the rest of the platform, with separate draft and live schemas that mirror your org's branches, allowing you to safely build and keep production and staging data in sync with your live and draft stubs respectively
  • Accessible via any standard PostgreSQL client, allowing you to query and analyze your stub data using familiar SQL tools and techniques
  • Fully managed and maintained by the Stubber team, with no operational overhead for your team
  • Allows you to plug in external BI (Business Intelligence) and analytics tools that support PostgreSQL as a data source

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 synchronized to the draft schema.
  • Live schema — stubs and data from live stubs are synchronized 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 explicitly 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 synchronizes 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.