Concepts

Data Twin

Verified against Soffi ·

Most apps are only as good as the data behind them. An empty dashboard or a screen stuck on a spinner tells a designer nothing, and pointing a preview at your real backend means production credentials, production data, and a lot of setup. Soffi's Data Twin solves that. It's a twin of your APIs, auth, and data shapes that stands in for your backend and answers your app's requests with realistic data, so every screen renders the way it would for a real user, without touching production.

How it's built

The Data Twin is set up with the Project. When an Admin runs Build my app with the Data Twin switch on, which is the default, Soffi reads your repositories to learn what your app asks its backend for and what the answers look like, then builds a Data Twin that serves that data. Before the Data Twin becomes the Project's baseline, Soffi checks that your app's screens actually render with data, not empty states or errors.

Turn the switch off when your app doesn't need a backend at all, like a marketing site, or when you'd rather run against a backend from your own repositories. You can also start with the Data Twin and connect real services later, one at a time.

A baseline, plus each Workspace's own

The Data Twin comes in two layers.

Project

Baseline

The Data Twin every new Workspace starts with.
Folded back
Starts from
Your Workspace

Its own copy

An account with a hundred invoices

On top of the baseline
A teammate's Workspace

Its own copy

A name long enough to break a layout

On top of the baseline
Pull request merges

Folded into the baseline

  • The next Workspaces start with your additions
  • Workspaces already in progress keep the baseline they started from
Every Workspace starts from the Project's baseline and adds its own data on top. When its pull request merges, the additions fold back into the baseline.

The baseline belongs to the Project. It's the data every new Workspace starts with.

Each Workspace then gets its own copy on top of the baseline. When you need a state the baseline doesn't cover, such as an account with a hundred invoices, an order that failed to ship, or a name long enough to break a layout, tell Soffi in your Workspace and she adds the data or the endpoint there. Your teammates' Workspaces don't change, because the addition lives only in yours.

When your Workspace's pull request merges, Soffi folds its Data Twin additions back into the Project's baseline, so the next Workspaces start with them. Workspaces already in progress keep the baseline they started from.

Keeping production data out

With the Data Twin on, your app's backend requests in a preview go to the Data Twin instead of your real services, so the Workspace doesn't read or write your production data, and nobody needs real customer accounts to see a screen fully populated. The exception is a service you give the Project a key for, which the app calls directly. See Environment variables and keys. Combined with sign-in being off in previews, anyone on your team can open any screen in a Workspace and see it as a real user would.

With the Data Twin off, your app runs against whatever backend its Project setup points it at. Keep that to a development or staging backend, never production.

Who can change it

Anyone with the Editor role or above can shape the Data Twin in a Workspace they're working in. Setting up the Project's Data Twin, and turning it on or off, is part of Project setup and needs an Admin. See Set up your Data Twin.

Was this helpful?