Technologies · PostgreSQL

PostgreSQL development for data that has to stay correct

Every Odoo system we deliver runs on PostgreSQL, and most of our custom applications do too. We design the schema, watch the slow queries, and make sure a backup can actually be restored.

Definition

What is PostgreSQL?

PostgreSQL development services cover designing, building, tuning and operating databases on PostgreSQL, the open-source relational database used by Odoo and many custom business applications. PostgreSQL enforces constraints and transactions strictly, supports JSONB documents, full-text search and geospatial data through PostGIS, and replicates to standby servers. The work ranges from modelling tables and indexes to setting up replication, point-in-time recovery and major-version upgrades.

Fit

Where PostgreSQL earns its place

01

Odoo and other ERP workloads

Odoo only runs on PostgreSQL, so performance, backups and upgrades of the ERP depend directly on how the database is configured and maintained.

02

Transactional business data

Orders, invoices, stock moves and payments where foreign keys, constraints and ACID transactions prevent silent inconsistencies.

03

Mixed relational and document data

JSONB columns hold flexible attributes or API payloads next to normal tables, with GIN indexes, so a separate document store is often unnecessary.

04

Reporting on live operational data

Window functions, CTEs, materialized views and read replicas let analysts query production data without slowing down users.

When we recommend something else

  • A WordPress or WooCommerce site — WordPress is built for MySQL or MariaDB, and running it on anything else is unsupported territory.
  • Very high-volume time-series or event analytics where a columnar store such as ClickHouse answers aggregate queries far more cheaply.
  • A small internal tool with one user and no concurrency — SQLite is simpler to ship and back up.
  • Caching, sessions or queues that need sub-millisecond reads — Redis or a message broker fits better than another database table.
Deliverables

PostgreSQL work we take on

Schema design for new applications

Normalized tables, constraints, indexes and migration scripts versioned alongside the application code.

Odoo database tuning

Configuration sized to the server, slow-query analysis with pg_stat_statements, index review on heavy custom modules, and vacuum settings for busy tables.

Replication and high availability

Streaming replicas for failover and read scaling, with automated failover through Patroni where the risk justifies it.

Backups, recovery and upgrades

pgBackRest with point-in-time recovery, scheduled restore tests, and major-version upgrades planned with pg_upgrade or logical replication.

Architecture

A production PostgreSQL stack, layer by layer

L1

Application layer

Odoo workers or application services send queries through an ORM or hand-written SQL that we review for N+1 patterns.

L2

Connection pooling

PgBouncer keeps the number of real database connections small, with the pooling mode chosen to match the application's use of sessions.

L3

Primary server

Memory, WAL, checkpoint and autovacuum settings sized to the hardware and the write pattern, not left at defaults.

L4

Standby replicas

Streaming replication to one or more standbys for failover and for read-only reporting queries.

L5

Backup repository

Full and incremental backups plus continuous WAL archiving to separate storage, enabling recovery to a point in time.

L6

Monitoring

Slow queries, replication lag, bloat, disk growth and connection counts tracked with alerts before they become outages.

Layered architecture of a PostgreSQL project: Application layer, then Connection pooling, then Primary server, then Standby replicas, then Backup repository, then Monitoring.

Ecosystem we work with

  • PgBouncer
  • pgBackRest
  • Patroni
  • PostGIS
  • pgvector
  • pg_stat_statements
  • Logical replication
  • pg_upgrade
  • TimescaleDB
  • Prometheus postgres_exporter
  • Amazon RDS / Aurora
  • Odoo ORM
Integrity & recovery

What a well-run PostgreSQL gives you

01

Integrity enforced in the database

Foreign keys, unique and check constraints catch bad data even when an import script or integration bypasses the application.

02

Queries tuned from evidence

We read EXPLAIN ANALYZE plans and pg_stat_statements before adding indexes, so fixes target the queries that actually cost time.

03

Recoverable by design

Point-in-time recovery means an accidental bulk delete can be rolled back to the minute before it happened, if restores are tested.

04

No license lock-in

PostgreSQL is open source under a permissive license, so it runs the same on your own server, any cloud, or a managed service.

Compare

PostgreSQL or MySQL?

Where PostgreSQL and MySQL differ in practice for business applications
ConsiderationPostgreSQLMySQL
Typical platform fitOdoo, Django, custom ERP and data-heavy appsWordPress, WooCommerce, Magento and many PHP apps
Data integrityStrict by default; check constraints, exclusion constraints, transactional DDLStrict with InnoDB and strict SQL mode; DDL is not transactional
Semi-structured dataJSONB with GIN indexes and rich operatorsJSON type with generated-column and functional indexes
ExtensionsPostGIS, pgvector, TimescaleDB, pg_partman and moreFewer extensions; features come with server releases
Connection handlingProcess per connection; a pooler such as PgBouncer is usually needed at scaleThread per connection; handles many connections natively
Keep exploring
Sources

Sources and further reading

Official documentation and guidance if you want to read more about this topic.

FAQ

PostgreSQL questions

Why does Odoo use PostgreSQL?

Odoo is built only for PostgreSQL because its ORM relies on PostgreSQL features such as strict transactions, sequences and specific SQL behaviour. MySQL, SQL Server and other databases are not supported, so tuning PostgreSQL is part of tuning Odoo.

Can you speed up a slow Odoo database?

Often, yes, but the cause has to be found first. Slowness usually comes from untuned memory settings, missing indexes on custom fields, table bloat from neglected vacuuming, or inefficient code in custom modules; we measure with pg_stat_statements and query plans before changing anything.

Should we use managed PostgreSQL like Amazon RDS or run our own?

Managed PostgreSQL is usually the better choice when you lack in-house database operations skills, because patching, backups and failover are handled for you. Self-hosting gives full control over extensions, configuration and cost, and makes sense when someone is responsible for monitoring and restore testing.

How do you upgrade PostgreSQL to a new major version?

Major upgrades use either pg_upgrade, which is fast but needs a short downtime window, or logical replication to a new server, which keeps downtime to a brief switchover. Either way we rehearse on a copy of production and check extensions and application compatibility first.

Can PostgreSQL replace MongoDB for document data?

In many business applications, yes. JSONB columns store and index JSON documents inside PostgreSQL, so teams keep transactions and joins with relational data; MongoDB is still a better fit when the whole dataset is document-shaped and needs horizontal sharding.

What does a PostgreSQL backup strategy include?

A sound strategy includes full backups, continuous WAL archiving for point-in-time recovery, copies stored away from the database server, encryption, retention rules, and regular restore tests. A backup that has never been restored should not be trusted.

Next step

Is your Odoo or application database slowing you down?

Share your PostgreSQL version, server size and the symptoms you see. We'll review the configuration and slow queries and tell you what is worth fixing first.