Databases

Deploy and manage PostgreSQL/Supabase database instances with automatic backups.

Overview

Hostwares provides managed database instances powered by Supabase/PostgreSQL. Each database runs in its own isolated container with dedicated resources.

  • PostgreSQL 15+ with full SQL support
  • Isolated containers per database
  • Automatic daily backups
  • Connection pooling included
  • $3/month per database

Creating a Database

From the Dashboard

  1. Go to Dashboard → New Project → Database
  2. Enter a name for your database
  3. Select the database type (PostgreSQL)
  4. Click Create
  5. Wait for provisioning (usually under 60 seconds)

Via AI Assistant

"Create a new PostgreSQL database called my-db"
"Create a database for my production app"
"Set up a new Supabase instance"

Via API

POST /api/databases
{
  "name": "my-production-db",
  "type": "postgresql"
}

Connection String

After creation, your connection string is available in the database detail page:

postgresql://user:password@host:5432/dbname

Using with your site

  1. Copy the connection string from Dashboard → Databases → [DB] → Connection
  2. Add it as DATABASE_URL in your site's environment variables
  3. Redeploy your site

Connection pooling

For applications with many concurrent connections, use the pooled connection URL:

# Direct connection (for migrations)
DATABASE_URL=postgresql://user:pass@host:5432/db

# Pooled connection (for your application)
DATABASE_URL=postgresql://user:pass@host:6543/db?pgbouncer=true

Framework examples

# Prisma (schema.prisma)
datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

# Drizzle
import { drizzle } from 'drizzle-orm/node-postgres';
const db = drizzle(process.env.DATABASE_URL!);

# Django (settings.py)
DATABASES = {
  'default': dj_database_url.config(default=os.environ['DATABASE_URL'])
}

Management

Control your database containers from the dashboard or via AI:

ActionDescriptionData Impact
StartStart a stopped databaseNo data loss
StopGracefully stop the containerNo data loss
RestartStop and start againNo data loss
DeletePermanently removeALL DATA DELETED

Warning: Deleting a database is irreversible. All data, including backups, will be permanently removed after 7 days.

Backups

Automatic daily backups are included with every database:

  • Frequency: Daily at 3:00 AM UTC
  • Retention: Last 7 daily backups kept
  • Type: Full pg_dump snapshot
  • Restore: Contact support for point-in-time recovery

Manual backup

Create a manual backup anytime from the dashboard:

  1. Go to Databases → [DB] → Backups
  2. Click Create Backup
  3. Download or restore from the backup list

Performance Tips

  • Use connection pooling — Prevents "too many connections" errors
  • Add indexes — Index frequently queried columns
  • Use EXPLAIN ANALYZE — Identify slow queries
  • Limit result sets — Always use pagination for large tables
  • Close connections — Ensure your ORM releases connections properly
  • Monitor size — Keep an eye on database size vs plan limits

Security

  • Encrypted at rest — Database files are encrypted on disk
  • Encrypted in transit — Connections use TLS by default
  • Isolated network — Each database has its own network namespace
  • Strong passwords — Auto-generated 32-character credentials
  • No public access — Databases are only accessible from your Hostwares containers

Running Migrations

Run database migrations during deployment by adding them to your build or start process:

Prisma

// package.json
"scripts": {
  "build": "prisma generate && prisma migrate deploy && next build",
  "start": "next start"
}

Drizzle

// package.json
"scripts": {
  "build": "drizzle-kit push && next build"
}

Django

# Use as start command
python manage.py migrate && gunicorn myapp.wsgi

Ensure your DATABASE_URL is set in environment variables before running migrations.