Тома и базы данных
Persistent volumes for services, one-click Postgres, MySQL, Redis and MongoDB from templates, connecting with `skiffly connect`, and backups.
Volumes#
A volume is a persistent disk mounted into a service at a path. Data survives redeploys, restarts and image changes; it is deleted with the service or the environment.
skiffly volume add --mount-path /data --size 5 # GB
skiffly volume list- Volumes are per service and environment;
staginggets its own empty volume. - A service with a volume runs one replica (block storage cannot be shared).
- Creating a volume redeploys the service so the mount appears.
- Volumes are billed per provisioned GB-month while they exist, including while the service sleeps.
- The volume is mounted owned by root. If the image switches to a non-root
USER(USER node,USER app), files that root wrote earlier stay read-only for it, and the app fails withEACCES/Permission denied. Set the variableRAILWAY_RUN_UID=0(orSKIFFLY_RUN_UID) to run the container as root, or a uid/gid of your choice withRAILWAY_RUN_UID/RAILWAY_RUN_GID. - Resizing is not supported yet: create a larger volume, copy the data over with
skiffly ssh, then delete the old one.volumeInstanceUpdatechanges the mount path or the service.
Databases#
Databases are ordinary services created from templates: an official image, a volume at the data directory, a generated password and a connection string that other services reference.
| Template | Image | Port | Volume | Variable to reference |
|---|---|---|---|---|
postgres (also postgres-16, postgis, pgvector, timescaledb) | postgres:17 | 5432 | /var/lib/postgresql/data, 10 GB | ${{Postgres.DATABASE_URL}} |
mysql, mariadb | mysql:8.4 | 3306 | /var/lib/mysql, 10 GB | ${{MySQL.MYSQL_URL}} |
redis (also valkey, keydb, dragonfly) | redis:7-alpine | 6379 | /data, 2 GB | ${{Redis.REDIS_URL}} |
mongodb | mongo:7 | 27017 | /data/db, 10 GB | ${{MongoDB.MONGO_URL}} |
More engines in the catalog: ClickHouse, CockroachDB, Cassandra, ScyllaDB, Neo4j, SurrealDB, InfluxDB, QuestDB, Meilisearch, Typesense, Qdrant, Weaviate, Elasticsearch, RabbitMQ, NATS, Kafka/Redpanda, MinIO.
New service → Template → PostgreSQL. The service, the volume and the variables are created together and the first deployment starts.
The database listens on the private network only. Give it more memory in Settings → Resources when the workload grows (1 vCPU / 1 GiB is the template default).
Connecting from your machine#
skiffly connect opens a TCP proxy and the matching client with the service's credentials:
skiffly connect postgres # psql
skiffly connect mysql # mysql
skiffly connect redis # redis-cli
skiffly connect mongo # mongosh
skiffly connect postgres --print # print the URL and the client command instead of connectingThe client must be installed locally. The proxy stays until you delete it (skiffly proxy delete), so keep the password strong. Import a dump through the proxy:
pg_restore -h edge.skiffly.cloud -p 21543 -U postgres -d app backup.dumpor from inside the container with skiffly ssh:
skiffly ssh -s postgres -T -- pg_dump -U postgres app > backup.sqlBackups#
Every volume is snapshotted daily (03:00 UTC) with restic to encrypted S3-compatible storage in the EU, keeping 7 daily, 4 weekly and 3 monthly snapshots. Postgres and MySQL services additionally get a logical dump (pg_dumpall / mysqldump) in the same run, so a restore is consistent even if the file-level snapshot caught a write in progress.
Backups are listed on the volume in the dashboard (Backups), with skiffly backups list or MCP list-backups. Backup now (skiffly backups create, MCP create-backup) takes an on-demand backup, at most one per 10 minutes per volume.
Restoring is one click: pick a backup and Restore (skiffly backups restore <backupId>, MCP restore-backup). The current data on the volume is replaced, so a safety backup is taken first; for a file snapshot the service is stopped while the files are restored and started again afterwards, while a database dump is loaded into the running database (all client sessions are terminated). Keep your own dumps for anything you cannot afford to lose; skiffly ssh and skiffly connect make that a one-liner in a cron job.