Skip to content

Databases

This page describes how databases are typically used in local development environments.

The goal is to make it easy to work with data locally, reproduce issues, and test changes safely before deploying.

For local development, databases are usually run locally rather than shared.

Local databases are commonly used to:

  • Develop and test schema changes
  • Debug application behavior
  • Reproduce issues without affecting shared environments

Local databases should be treated as disposable and easy to recreate.

Databases are typically run using containerized setups.

Common expectations:

  • Databases are started using Docker or similar tooling
  • Data volumes may be persisted locally for convenience
  • Containers can be stopped and recreated when needed

Details about how to start databases locally are documented per repository.

Applications and tools connect to local databases using standard connection parameters.

Typical connection details include:

  • Host: localhost
  • Port: default database port
  • Credentials defined in local configuration

Connection details must never be committed to source control.

In some cases, copying data from a shared environment into a local database is useful.

Common scenarios include:

  • Debugging production issues
  • Testing migrations against real data
  • Investigating data-related bugs

When copying data from a shared environment:

  • Prefer full database backups when possible
  • Restore data into a fresh local database
  • Avoid selectively copying tables unless necessary
  • Clearly label local databases that contain copied data

The exact backup and restore process depends on tooling and is documented elsewhere.

Local databases may contain sensitive data.

Guidelines:

  • Do not share local database dumps
  • Do not commit dumps or data files to source control
  • Delete local copies when no longer needed

A local database may not be needed when:

  • Working on frontend applications that consume shared APIs
  • Making changes that do not affect data access
  • Debugging logic that does not depend on persisted state

In these cases, using shared development environments may be sufficient.

  • Prefer local databases for development and debugging
  • Use containerized setups to keep environments consistent
  • Copy data only when necessary and handle it responsibly
  • Keep local database workflows simple and repeatable