Schema, scale, and query performance done right.
Database performance problems are usually design problems that took a while to surface: a schema shaped around the first feature, indexes added by intuition, an ORM generating queries nobody reviewed, a single primary carrying traffic it was never sized for.
We start from evidence — query statistics, execution plans, lock and I/O behaviour — and change what the evidence supports. That can be a schema revision, a targeted index, connection pooling, partitioning, read replicas or a rewrite of a few critical queries. Every change is staged so it can be measured and reversed.
Reference architecture · Conceptual model
View as text
Applications connect through a transaction-mode pooler. Writes go to the primary, reads that tolerate lag go to replicas fed by streaming replication. The primary archives WAL for point-in-time recovery, schema changes run as expand-and-contract migrations, and query statistics drive indexing decisions.
Components
- Application — ORM · queries
- Pooler — transaction mode
- Migrations — expand · contract
- Primary — writes
- Read replicas — lag-aware reads
- WAL archive — PITR backups
- Query insights — plans · stats
Connections
- Application → Pooler
- Pooler → Primary (writes)
- Pooler → Read replicas (reads)
- Primary → Read replicas (replication)
- Primary → WAL archive
- Migrations → Primary
- Primary → Query insights
What we deliver
- PostgreSQL architecture
- Topology, configuration and resource sizing based on workload shape, not defaults.
- Schema design
- Models that encode invariants as constraints and fit the queries the product actually runs.
- Query optimisation
- Execution-plan analysis and rewrites for the queries that dominate load or latency.
- Indexing strategies
- Indexes chosen from observed access patterns, with write and storage cost accounted for.
- Connection pooling
- Pooler configuration that protects the database from connection storms without breaking session semantics.
- Migrations, scaling and HA
- Zero-downtime expand–contract migrations, partitioning, replicas, failover and tested point-in-time recovery.
Problems we take on
- A handful of queries account for most of the database load and keep getting slower.
- Schema migrations require maintenance windows or have caused incidents.
- Connection limits are hit during traffic spikes or deploys.
- Backups exist, but a restore has never been rehearsed.
What we engineer for
- Evidence first
- Changes justified by plans and statistics, measured before and after.
- Write cost
- Every index and constraint has a write-path and storage cost that has to be paid.
- Recoverability
- Recovery point and time objectives that have been tested, not assumed.
Technologies we design around
Chosen per engagement from requirements. Listed as a reference, not a fixed stack.
- PostgreSQL
- PgBouncer
- TimescaleDB
- Citus
- Redis
- Prisma
How an engagement starts
- 01Collect query statistics, slow-query samples and the current topology.
- 02Rank problems by user impact and risk, with the evidence for each.
- 03Agree a staged change plan with measurement and rollback for every step.