> ## Documentation Index
> Fetch the complete documentation index at: https://docs.revolte.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Database

> Define storage and instance sizing for your data layer.

Databases require persistent storage and prioritized memory for query performance.

## Storage configuration

| Parameter   | Type    | Description                                            |
| ----------- | ------- | ------------------------------------------------------ |
| **Storage** | `30 GB` | Persistent disk space for your database.               |
| **IOPS**    | `3000`  | Provisioned throughput for high-performance databases. |

## Instance sizing

Choose an instance size that matches your dataset and concurrency needs.

```yaml revolte.yaml theme={"dark"}
revolte:
  version: "1.0"
  project: Demo-Project
  appName: "demo-app"
  env:
    production:
      branch: main
      services:
        rid_2:
          type: DATABASE
          name: db
          specifications:
            cpu: 2
            memory: 1
            storage: 30
            engine: postgres
```

## Database Connection Injection

Provisioning a database service (e.g., named `db` under your YML services configuration) automatically injects the corresponding connection credentials into the environment variables of all other services within the same environment.

This requires no manual secret configuration. The following environment variables are automatically injected at runtime:

```yaml theme={"dark"}
DATABASE_HOST: '#{db.dbUrl}'
DATABASE_PORT: '#{db.dbPort}'
DATABASE_USERNAME: '#{db.dbUsername}'
DATABASE_PASSWORD: '#{db.dbPassword}'
DATABASE_NAME: '#{db.dbName}'
```

*(Note: If your database service name is different from `db`, replace `db` with your exact service name in the references above.)*

## Related

* [Web Service](/yaml/environment-settings/resource-specifications/web-service)
* [Variables & Secrets](/yaml/environment-settings/resource-specifications/variables)

## Next steps

* [Configure Caching](/yaml/environment-settings/resource-specifications/cache)
* [Set up Storage Buckets](/yaml/environment-settings/resource-specifications/storage-bucket)
* [Sync your Changes](/yaml/syncing)
