Faster database, lower cost

Archiving and optimising a legacy PostgreSQL database cut storage by 80% and average query latency by 74%. I set the approach and directed a senior engineer, who investigated and implemented it.

Case study  2 of 6What I did: Directed

Role
Set the approach and directed the work
Client
A business-messaging platform
Scope
The legacy PostgreSQL database behind the campaign platform
Measurement
Measured before and after

01

The problem

A business-messaging platform ran its campaign platform on a legacy PostgreSQL database. Heavy reporting queries were slow, and one client’s contacts page took 84 seconds to load.

02

What I did

I set the approach (archiving and optimising the database) and directed a senior engineer, who investigated and implemented it. Before any change, I set performance and cost baselines, so the effect could be measured.

Measured against those baselines, storage fell by 80% and average query latency by 74%. Heavy reporting queries ran up to 22 times faster, and the contacts page went from 84 seconds to under one second, with similar improvements on other pages.

Fig. 1  Archiving, before and after

Diagram of the database before and after the work. A tall cylinder labelled Before is archived, along an arrow, into a much shorter solid cylinder labelled After, and a dimension line marks the difference as 80% less storage.

03

Results

Measured against baselines set before the work

  • Storage

    80% less

    storage, after archiving and optimising the database.

  • Query latency

    74% lower

    average query latency, measured before and after the work.

  • Reporting queries

    up to 22 times faster

    for heavy reporting queries. One client's contacts page went from 84 seconds to under one second.

04

Stack

  • PostgreSQL
  • Cloud SQL

Next case study  3 of 6What I did: Built

Self-service reporting

Report requests to engineering fell by about 30%, as stakeholders built the simpler reports themselves in a configurable tool I built with Claude Code.

Next case study

Contact

Get in touch

Tell me about your project, your team or the problem you're working on.

What would you like to discuss?

At least 20 characters.

I'll only use your details to reply. Privacy