Not yet released. This guide describes implemented changes awaiting rollout. Availability requires the corresponding backend and dashboard release.
Goal
Run a business-critical PostgreSQL database on its own virtual machine.Prerequisites
- Dedicated switched on for your account
- A wallet balance or a saved card for billing
Workflow
1
List sizes with
stackshift database instance-classes and pick one.2
Create the database with
stackshift database create --data '{"tier":"dedicated", ...}' or POST /api/v1/databases, giving the size, storage and billing period. Save the master password from the response: it is shown only once.3
If the response says payment is required, open the checkout link and pay. The database starts as soon as the payment is confirmed.
4
Connect your app through its project binding, or with the connection details on the database page.
5
Check it is running with
stackshift database get DATABASE and run a real query from your app. stackshift database billing DATABASE shows what you are paying.Create
name: 3 to 40 lowercase letters, digits and dashes.version: 15 to 18 (default 17).typeispostgres. MySQL on Dedicated isn’t available yet and the API answers403for it.storage_gb: 10 to 1024.storage_max_gbis the autogrow limit (default twicestorage_gb, at most 1024).master_usernamedefaults toapp_owneranddatabase_nametoapp.backup_retention_days: 7 to 35 (default 7). This is how far back you can restore.maintenance_window: day 0 (Sunday) to 6 and a start minute after midnight. If you leave it out, we pick one for you.billing:monthly(default),yearlyorhourly.standby:off(default),syncorasync, withon_standby_lossdegrade(default) orblock. See Standby and high availability.deletion_protection:truerefuses deletion until you turn it off.- If no server has room for that size right now you get “We’re adding capacity for this database size, please try again shortly.” Nothing is charged.
POST /api/v1/databases
Connect
- Apps on StackShift reach the database privately; bind it to your app and the connection variables are set at deploy.
- Each database has a direct endpoint and a pooled endpoint (PgBouncer). Use the pooled one for app traffic and the direct one for migrations.
- Connections always use TLS. Download the CA certificate from the database page and keep certificate checks on.
- Turn on public access for a laptop or an external service, preferably limited to your IP addresses.
- Extensions such as
vectorandpostgisinstall withCREATE EXTENSIONas the master user.
Day-to-day
- Change size:
stackshift database resize DATABASE --data '{"instance_class":"d-2vcpu-8gb","apply":"window"}'. The switch happens in your maintenance window (or now with"apply":"now"), and connections drop for a few seconds. Cancel a scheduled change withstackshift database resize-cancel DATABASE. - Storage grows by itself before it fills up, without downtime, up to
storage_max_gb. Raise the limit or grow it yourself withstackshift database storage DATABASE --data '{"storage_gb":100,"storage_max_gb":400}'(PATCH /api/v1/databases/{id}/storage). Growing storage by hand is a priced change, so you confirm the charge first. - Stop, start and restart from the database page or with
stackshift database stop|start|restart DATABASE. A stopped database starts again automatically after 7 days. Its storage is still billed while stopped. - Change
name,deletion_protection,backup_retention_days(7 to 35) ormaintenance_windowin place withstackshift database settings DATABASE --data '{"deletion_protection":false}'(PATCH /api/v1/databases/{id}). Leave out what you don’t want to change. Renaming works on every tier and never changes the database’s addresses; a name another database already uses is refused. The other three settings are Dedicated only. A size change waiting for the window moves with the new window. - Tune PostgreSQL with parameter groups, choose the weekly window for updates, and move to a newer PostgreSQL version when you are ready. See Parameter groups, Maintenance window and updates, and PostgreSQL version upgrades.
- See what your database is busy with, and what happened to it, in Performance Insights and the events feed. Take a fast restore point before a risky change where it is offered.
- Deleting takes a final snapshot first unless you ask to skip it (
?skip_final_snapshot=true). With deletion protection on, deletion is refused until you turn it off.
Availability
Dedicated databases are rolling out. If Create doesn’t offer Dedicated, it isn’t switched on for your account yet, and the API answers403.
Expected result
The database is running on its own virtual machine and your app reads and writes data.
Common failures
Related guides
Starter or Dedicated
Starter databases share a server with other databases. A Dedicated database is its own virtual machine with a standby, read replicas and restore to any second.
Standby and high availability
Add a standby on another server. If the primary fails, the standby takes over and your connection address stays the same.
Restore to any second
Dedicated databases archive every change, so you can restore to an exact second. A restore always creates a new database.
Fast restore points
Take a quick restore point before a risky change and roll the database back to it in minutes. Offered on some servers only.
Performance Insights and events
See what a Dedicated database spends its time on, find its slowest queries, and read a feed of failovers, backups and maintenance.
Parameter groups
Tune PostgreSQL settings such as work_mem or statement_timeout for one or many Dedicated databases with a reusable parameter group.
Maintenance window and updates
Choose the weekly window when StackShift updates your Dedicated database, see what is waiting, and apply it now if you prefer.
PostgreSQL version upgrades
Upgrade a Dedicated database to a newer PostgreSQL major version, in place with a short outage or blue/green with a switch that takes seconds.
Dedicated billing
Pay for a Dedicated database monthly, yearly or by the hour, from your wallet or card.
PostgreSQL and extensions
PostgreSQL 15 to 18 with pgvector, PostGIS, pg_cron and more, ready to turn on with one SQL statement.