Features
Database
Overview

Database Management

Every Odoo environment on OEC.sh runs on its own dedicated PostgreSQL database. This guide explains what your database stores, how to monitor its health, and when to consider using read replicas.


What Your Database Stores

Your PostgreSQL database contains all your Odoo business data:

  • Business Records - Customers, products, invoices, orders, and all transactional data
  • User Accounts - Odoo users, passwords, and access permissions
  • Configuration - Company settings, installed modules, and customizations
  • Attachments Metadata - References to files stored in your filestore

The database is automatically created when you deploy an environment and is isolated from other environments for security.


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)

Database 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.


Database Backups

Your database is included in every backup. OEC.sh automatically creates a complete snapshot of:

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

To learn how to create and restore backups, see Backups.


PgBouncer Connection Pooling

PgBouncer reduces database connection overhead by pooling connections, improving performance for high-traffic environments.

Note: PgBouncer is available on Pro plans and above.

Enabling PgBouncer

  1. Go to your environment's SettingsDatabase 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 for High Traffic

If your Odoo environment handles heavy traffic (many concurrent users or complex reports), you can enable a read replica to improve performance.

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

What is a Read Replica?

A read replica is a copy of your database that stays synchronized with the main database. It handles read-only queries (like reports and dashboards) while your primary database handles all write operations.

Benefits

  • Faster report generation
  • Better dashboard performance
  • Reduced load on your main database
  • Support for analytics tools without impacting daily operations

Requirements

Read replicas are available for:

  • Odoo 18.0 and newer versions only
  • Pro plan or above
  • Environments with sufficient resource quota

Enabling a Read Replica

  1. Go to your environment's SettingsDatabase 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 SettingsDatabase tab
  2. Click Remove in the Read Replica section
  3. Confirm the removal

Removing the replica does not affect your primary database.


What's Next?

  • Backups - Protect your database with regular backups
  • Environments - Learn about managing your Odoo environments
  • Monitoring - Track database and server health