Overview
Snaplet is a command line utility that captures snapshots of a database that can be shared with a team, so that everyone can code against the same database.
Snaplet gives developers PostgresQL data that they can code against. It does this by capturing a snapshot of a database: copying the schema and providing a JavaScript runtime for transforming, reducing (subsetting) and generating the data.
The problem
As a developer it's difficult to get an accurate representation of data in production. Coding against accurate data clears assumptions and removes ambiguiety when adding features or fixing bugs.
The most common approaches for solving this are to write seed scripts, or to copy the production database.
Seed scripts are tedious to write and maintain, inaccurate and a tiny representation of accurate data. Whilst copying from production lacks decent workflows, is slow because you have to copy all the data, and contains personal information.
The solution
Snaplet is a self-service workflow that allows developers to copy whilst transforming a data, which can then be shared and restored into any development environment.
Examples
- Join a new team, run
snaplet snapshot restore
and get a copy from the evening before - See a bug in production? run
snaplet snapshot restore --new
and restore an "on demand" snapshot in an instant - Write E2E tests again actual data
- Spin up pull request/ deploy preview databases with accurate data
- Write data-migrations against accurate data
The workflow
- Snaplet's snapshot workers connect to your database
- The workers copy and transform your data.
- The data is archived, encrypted, and the snapshot is stored in a private bucket.
- The snapshots are restored into development environments with the Snaplet CLI.