---
title: Databases
url: "/docs/databases/"
canonical_url: https://docs.blossom88.com/docs/databases/
markdown_url: https://docs.blossom88.com/docs/databases.md
summary: Create database instances and manage the databases inside them
categories:
- data
- databases
---

# Databases

Run PostgreSQL, MySQL, MariaDB or MongoDB with private connection URLs,
managed storage and recovery. Create a Database instance under **Data →
Databases**, or [ask your agent to add one](/learn/databases/).

A **Database instance** supplies the engine, compute and storage. PostgreSQL
can hold several **Databases** with separate credentials on that instance;
adding one does not provision another Server.

| Engine | Version | Protection |
|---|---|---|
| [PostgreSQL](/docs/databases/postgres/) | 18 | Backups, point-in-time recovery, replicas and automatic failover |
| [MySQL](/docs/databases/mysql/) | 9 | Recovery backups and public access over TLS |
| [MariaDB](/docs/databases/mariadb/) | 12 | Recovery backups and public access over TLS |
| [MongoDB](/docs/databases/mongodb/) | 8 | Recovery backups and public access over TLS |

## Availability

**Every Server runs only your Account's workloads.** Shared means sharing
with your own Databases and Caches, never another customer.

| Option | What you get |
|---|---|
| Shared | Instances share your Data Capacity. Blossom recovers them together after a Server failure; connections pause briefly. |
| Dedicated | Each node gets its own Server and failure boundary. Recommended for production. |

New instances default to Shared where the Location offers Data Capacity,
otherwise Dedicated. Both keep data on storage that follows the node when a
Server is replaced. Dedicated PostgreSQL can add a standby or read replicas;
see [High Availability](/docs/databases/postgresql-high-availability/).

## Shared Sizes

| Size | CPU / memory | Fits per 2 vCPU / 4 GB unit |
|---|---|---:|
| Small | 0.5 vCPU / 875 MB | 4 |
| Medium | 1 vCPU / 1.75 GB | 2 |
| Large | 2 vCPU / 3.5 GB | 1 |

Small is the default; MongoDB starts at Medium. Memory uses decimal MB/GB.
Each instance has its own disk. For custom sizes and engine minimums, see
[database_instance:create](/docs/reference/cli/database_instance/create/).

## Create An Instance

> Add a PostgreSQL instance named production with 20 GiB of storage and backups.

    blossom database_instance:init

database_instance.yml:

```yaml
database_instance:
  name: production
  engine: postgres
  availability: shared
  storage_gib: 20
  backup_storage_id: blossom_cloud
  database_name: app_production
```

    blossom database_instance:create --data database_instance.yml --follow

The selected Location determines where it runs. The estimate appears before
allocation, and your Location's capacity ceiling applies.

To use existing usernames or passwords, see
[Credentials](/docs/databases/security/#credentials).

## Connect An Environment

Open **Variables and Links → Manage connections** on the Environment and
connect the Database. Every Service receives `DATABASE_URL` on its next deploy.
The Database and Environment must belong to the same Account and region.

For PostgreSQL, select a Database on the instance:

    blossom database:list --database_instance database_instance-100
    blossom environment_link:init

environment_link.yml:

```yaml
environment_link:
  environment_id: environment-100
  target_type: Database
  target_id: database-100
  var_name: DATABASE_URL
```

    blossom environment_link:create --data environment_link.yml

Other engines link with `target_type: DatabaseInstance` and the instance ID.
Use the supplied URL; its private hostname survives recovery. Public access
is opt-in and TLS-protected. See
[Database And Cache Security](/docs/databases/security/).

External databases can use a manually configured connection URL; Blossom does
not manage their backups or recovery.

## Rotate The Password

    blossom database_instance:credentials:rotate --id database_instance-100 --follow

Blossom updates the engine and restarts linked Environments with the new URL.
The old password stops working and connections pause briefly. Update clients
outside Environment Links yourself. For a chosen password, use
[password stdin](/docs/reference/cli/database_instance/credentials/rotate/).

## Pricing

Shared instances fill whole Data Capacity units without a per-instance
compute fee. Dedicated nodes, standbys and replicas have their own compute
and disks. Compare regional rates in the
[calculator](https://app.blossom88.com/pricing/calculator).

## What You Get

A private connection URL in your App, storage that survives Server replacement,
and engine-specific [backup and recovery options](/docs/backups/).
