Product Guide
Database
Overview

Database Management

Every Odoo environment on OEC.sh runs on its own dedicated PostgreSQL database, created automatically at deployment time and isolated from other environments. It stores all your Odoo business data: customers, products, invoices, orders, user accounts, configuration, installed modules, and attachment metadata.


Viewing Database Information

To see your database details:

  1. Go to Environments and select your environment
  2. Click the Settings tab
  3. Click the Database sub-tab

Here you will find:

  • PostgreSQL optimization settings
  • Connection pooling configuration
  • Read replica status (Odoo 18+ only)

Health Indicators

OEC.sh monitors your database health automatically. In the environment overview you can see:

IndicatorMeaning
RunningDatabase is running normally
StoppedDatabase container is stopped
ErrorConnection or configuration issue detected

If you see an error status, try restarting the environment. If problems persist, check your server connectivity or contact support.


Backups

Your database is included in every backup. OEC.sh snapshots:

  • All database tables and records
  • Your filestore (attachments and images)
  • Configuration files

See Backups for how to create and restore backups.


PgBouncer Connection Pooling

PgBouncer pools database connections, reducing overhead and improving performance for high-traffic environments.

Note: PgBouncer is available on Pro plans and above.

Enabling PgBouncer

  1. Go to your environment's Settings > Database tab
  2. Find the PostgreSQL Optimization panel
  3. Enable the PgBouncer toggle
  4. Configure pool size (default: 20)
  5. Save and redeploy your environment

Read Replicas

A read replica is a synchronized copy of your database that handles read-only queries (reports, dashboards) while the primary handles writes. This helps when you have many concurrent users or run complex reports.

Note: Read replicas are available on Pro plans and above, for Odoo 18.0+ only.

Requirements

  • Odoo 18.0 or newer
  • Pro plan or above
  • Sufficient resource quota

Enabling a Read Replica

  1. Go to your environment's Settings > Database tab
  2. Find the PostgreSQL Optimization panel
  3. Check Enable Read Replica
  4. Click Save Settings
  5. Redeploy the environment to apply changes
  6. After redeployment, click Deploy Replica to deploy the read replica
  7. Wait for deployment to complete (usually 1-5 minutes)

Monitoring Replica Health

Once deployed, the Read Replica Status widget shows:

StatusDescription
OnlineReplica is synchronized and healthy
LaggingReplica is falling behind the primary database
OfflineReplica is disconnected
ErrorReplication error occurred (see error details)

The widget also displays:

  • Lag (Bytes): Amount of WAL data not yet replicated
  • Lag (Time): How far behind the replica is in seconds
  • Last Checked: When the health check last ran

Lag thresholds:

  • Warning: over 50MB or 15 seconds behind
  • Critical: over 100MB or 30 seconds behind

If the replica shows a lagging, offline, or error status, you can rebuild it by clicking the Rebuild button.

Removing a Read Replica

If you no longer need the replica:

  1. Go to your environment's Settings > Database tab
  2. Click Remove in the Read Replica section
  3. Confirm the removal

Removing the replica does not affect your primary database.