// CASE STUDY · FINTECH

How we cut API latency 70% on a payments platform — without an infrastructure rewrite.

A growing payments platform got slower with every week it succeeded. The fix wasn't a bigger cluster — it was three round-trips on the hot path that never needed to happen.

ClientNDA — payments platform
IndustryFintech · Payments
EngagementPerformance Sprint
Timeline5 weeks
StackGo · Postgres · Redis
// OUTCOMES
−70%p95 latency on the busiest endpoint1,180 ms → 350 ms
99.98%Uptime sustained across 12 monthsno regression after rollout
3Network round-trips removed from checkoutper request, on the hot path
0Downtime during the rolloutshipped behind flags, incrementally
// THE SITUATION

Getting slower with every win.

The platform worked, and that was the problem. Every new merchant added load, and p95 on the payment-status endpoint had crept past a second. Checkout felt sticky. The team's instinct — a reasonable one — was to scale the cluster up and out.

We asked them to hold off on the credit-card-for-AWS solution for a week and let us measure first. Throwing hardware at a latency problem usually just makes the same bad pattern more expensive.

// WHAT WE FOUND

The latency was in the round-trips, not the servers.

We added distributed tracing and watched a week of real traffic before changing a line. The hot path was making more network calls than anyone realised.

  1. 01A synchronous fraud-scoring call sat in the request path, adding 300–500 ms to every payment.Critical
  2. 02Issuer metadata was fetched from a third-party API on every request, uncached.High
  3. 03Settlement lookups ran N+1 — one query per line item, no batching.High
  4. 04Three internal services were chained sequentially where one aggregated call would do.High
  5. 05A composite index was missing on the busiest filter, forcing a sequential scan.Medium
// THE APPROACH

Measure, fix the hot path, leave the rest alone.

We didn't touch anything that wasn't on the critical path. The goal was the smallest set of changes that moved p95, each one measured under production-like load before and after. No rewrite, no new datastore, no migration weekend.

Everything shipped behind a flag with a one-command rollback, and we load-tested each change against a replayed copy of real traffic so the numbers were honest.

// WHAT WE BUILT

Five changes, in the order they shipped.

  1. Made fraud scoring asynchronous.

    Replaced the blocking call with a fast local pre-check and moved full scoring off the request path. Median dropped 380 ms overnight.

  2. Cached issuer metadata in Redis.

    The third-party lookup went from every-request to a warm cache with a short TTL and background refresh. One fewer external dependency on the hot path.

  3. Batched the settlement lookups.

    Collapsed the N+1 into a single batched query and added the missing composite index. The endpoint stopped scanning.

  4. Collapsed three service calls into one.

    Introduced an aggregation endpoint so the gateway made a single internal call instead of a sequential chain of three.

  5. Gave the team the traces to keep it fast.

    Left tracing, latency SLOs, and a k6 load profile wired into CI so a regression shows up in a PR, not in production.

// THE OUTCOME

A platform that gets faster as it grows up.

Before

Demo-grade request path

  • · synchronous fraud check
  • · uncached issuer lookups
  • · N+1 settlement queries
  • · sequential service chain
  • · no latency budget
After

Production-grade hot path

  • · async scoring + fast pre-check
  • · warm Redis cache
  • · batched + indexed queries
  • · single aggregated call
  • · SLOs enforced in CI

p95 settled at 350 ms and has held there through a year of growth, with uptime at 99.98%. No new servers were added. The team now owns the traces and the load profile, so the next regression is a failed check rather than an incident.

We were about to triple our cluster. They showed us we needed three fewer network calls.
VP of EngineeringPayments platform · name withheld under NDA
// WHAT WE USED

The stack and the services applied.

Tech stack
GogRPCPostgres 15RedisGCP · Cloud RunOpenTelemetryGrafanak6TerraformGitHub Actions
// LET'S TALK

Is your platform getting slower as it grows?

Send us your p95 chart. We'll tell you where the time is actually going — usually within a day.