Skip to main content
This reference covers persistent storage on Suga: volumes for data persistence, database templates, and backup strategies.

Volumes

Volumes provide persistent block storage. Unlike service filesystems (ephemeral), volume data persists across restarts, redeployments, and rollbacks.

Creating a Volume

  1. Add a volume to the canvas
  2. Set size (see plan limits below)
  3. Drop the volume onto a service
  4. Set the mount path
  5. Click Apply

Volume Constraints

  • Services per volume: 1 (volumes cannot be shared between services)
  • Replicas with volumes: 1 (required for data consistency)
  • Size limits: vary by plan, see Plan Limits
Volume storage also counts toward your organization’s overall storage pool.
Services with volumes must have exactly 1 replica. Volumes cannot be shared across multiple instances or services.

Data Persistence

Data survives:
  • Container restarts
  • Redeployments
  • Service crashes
  • Rollbacks (data stays current, not rolled back)
Data is lost if:
  • Volume is deleted
  • Environment is deleted
Rolling back a deployment does NOT roll back volume data. However, rolling back to a deployment before the volume existed will result in it being deleted.

Database Templates

Templates provide pre-configured databases with volumes attached.

PostgreSQL

Connection from other services:

Redis

The template caps Redis at 200 MB of data and evicts the least recently used keys when it fills up. Raise --maxmemory if you give the service more memory, and change --maxmemory-policy to noeviction if you are using Redis as a durable store rather than a cache. Connection:

MariaDB

MARIADB_USER and MARIADB_PASSWORD are both required. The image creates that user and grants it access to MARIADB_DATABASE. Connection:

Connecting to Databases

Use service names as hostnames for private networking:

Volume vs External Storage

Use Volumes when:
  • Running your own database
  • Need direct filesystem access
  • Storing small uploads or state
Use External Storage (S3, R2) when:
  • Files exceed your plan’s storage limits
  • Need to share files across services
  • Require public CDN access
  • Want automatic scaling

Common Questions

No, each volume can only mount to one service. For shared data, use a database or external object storage.
You can increase a volume’s size. You cannot decrease it. The underlying storage does not support shrinking, so the canvas blocks a smaller value and the change would be rejected even if it got through. To end up with a smaller volume, create a new one at the size you want and copy the data across.
You can only access volume data from within the container. Use database connections or application APIs.