Skip to content

LocalDB is a development and testing purpose PostgreSQL database container that automatically restores the latest backup from AWS S3 using pgBackRest.

License

Notifications You must be signed in to change notification settings

penguin-statistics/localdb

Repository files navigation

Penguin Statistics - Logo

Penguin Statistics - LocalDB

License

LocalDB is a development and testing purpose PostgreSQL database container that automatically restores the latest backup from AWS S3 using pgBackRest.

Usage

Prerequisites

  1. Install just

    just a task runner. just is inspired by make and npm run. It is designed to be an extremely simple way to define and run tasks. It is written in Rust, and is available on Windows, macOS, and Linux.

  2. cp .env.example .env and put AWS credentials into .env

Usage

Use just start to start the LocalDB. LocalDB script will properly initialize the PostgreSQL Database within the container, restore the latest backup from AWS S3 using pgBackRest, and start the PostgreSQL server in the container.

You will need to use the same DB credential as of the production DB. Efforts may be made to make the DB credential configurable in the future.

Development

Use just dev to start the LocalDB in development mode. This will first clear the development database volume, initialize the database, then it will fetch the debug backup from AWS S3 and restore it.

We are using the debug backup instead of the prod backup. The debug backup is a deadly simple backup that only contains a postgres.testtable with 3 rows of testing data. This is to make the development process much faster and also saves bandwidth.

License

MIT

About

LocalDB is a development and testing purpose PostgreSQL database container that automatically restores the latest backup from AWS S3 using pgBackRest.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published