Storage drivers
A storage driver decides where a self-hosted backend keeps its request history, replays and sandbox data, such as the payments your tests create. The backend picks one when it starts, from STORAGE_TYPE. With nothing set, it keeps everything in memory.
The drivers
- Memory: the default. Nothing to run, and nothing is kept once the container stops.
- Redis
- SQLite: one file on a volume. Nothing to run.
- PostgreSQL
- MySQL / MariaDB
- SQL Server
- Oracle
- CockroachDB
- MongoDB
- DynamoDB: a table in your AWS account, with no server to run. The backend takes its AWS credentials from the usual places: environment variables, a config file, or the role of the machine it runs on.
Every driver is included in the price.
Choose which drivers an image holds
Open the backend's Settings and select the drivers under Storage drivers. A change takes effect with the next build.
- With none selected, the image holds every driver.
- Memory and Redis are in every image.
One image can hold several drivers, for example SQLite for a laptop and PostgreSQL for CI. To see what an image holds:
docker run --rm <image> storage driversHere <image> stands for your image and its version, such as <your-org>.registry.mockzilla.org/ci-payments:v2026.09.23.3.
Set one up
Open the backend's Storage drivers tab and choose a driver. The tab shows the versions it was tested on, how to connect, and every variable it reads.
For PostgreSQL:
docker run -d --name ci-payments --restart unless-stopped -p 2200:2200 \
-e STORAGE_TYPE=postgres \
-e POSTGRES_URL=postgres://mockzilla:secret@db.internal:5432/mockzilla \
<image>The image lists the same variables:
docker run --rm -e STORAGE_TYPE=postgres <image> storage settingsThe schema
A database driver needs its tables. Memory and Redis need none.
By default, the backend creates the schema on its first start, and brings it up to date when you move to a new version. This is safe on every start, and when several copies start at once. It needs permission to create them: a database user that may create tables, or AWS credentials that may create the DynamoDB table.
Without that permission, install the schema yourself:
- Set
STORAGE_INSTALL=falseon the backend. It then only checks the schema. When the schema is missing or behind, the backend refuses to start and says what to apply. - Install the schema once, as a user that may create it. The image does it, and exits.
For the second step, run the image with storage install and the driver's settings:
docker run --rm \
-e STORAGE_TYPE=postgres \
-e POSTGRES_URL=postgres://admin:secret@db.internal:5432/mockzilla \
<image> storage installFor a SQL database, you can instead hand the SQL to your DBA. The image prints it:
docker run --rm -e STORAGE_TYPE=postgres <image> storage print > mockzilla-postgres.sqlSome of the SQL is for certain server versions only. Add --server-version with yours to storage print, and it prints only what applies. The same SQL files also ship next to the image, in its storage folder.
For DynamoDB, you can also create the table yourself, for example with Terraform. Give it the partition key pk and the sort key sk, both strings, and turn TTL on for the ttl attribute. Then set STORAGE_INSTALL=false.
When you move to a new version, install its schema before you switch. A backend whose schema is behind refuses to start.