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:
- Go to Environments and select your environment
- Click the Settings tab
- 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:
| Indicator | Meaning |
|---|---|
| Running | Database is running normally |
| Stopped | Database container is stopped |
| Error | Connection 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
- Go to your environment's Settings → Database tab
- Find the PostgreSQL Optimization panel
- Enable the PgBouncer toggle
- Configure pool size (default: 20)
- 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
- Go to your environment's Settings → Database tab
- Find the PostgreSQL Optimization panel
- Check Enable Read Replica
- Click Save Settings
- Redeploy the environment to apply changes
- After redeployment, click Deploy Replica to deploy the read replica
- Wait for deployment to complete (usually 1-5 minutes)
Monitoring Replica Health
Once deployed, the Read Replica Status widget shows:
| Status | Description |
|---|---|
| Online | Replica is synchronized and healthy |
| Lagging | Replica is falling behind the primary database |
| Offline | Replica is disconnected |
| Error | Replication 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:
- Go to your environment's Settings → Database tab
- Click Remove in the Read Replica section
- 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