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.
Local databases
Section titled “Local databases”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.
Running databases locally
Section titled “Running databases locally”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.
Connecting to local databases
Section titled “Connecting to local databases”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.
Copying data from shared environments
Section titled “Copying data from shared environments”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
Recommended approach for copying data
Section titled “Recommended approach for copying data”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.
Data safety
Section titled “Data safety”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
When a local database is not required
Section titled “When a local database is not required”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.
Summary
Section titled “Summary”- 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