4

Systems & Performance Analysis for a Payments Platform

Root-cause investigations across a national payments stack — a reporting-portal timeout diagnosis proven −86% in production, a bot / audit-trail forensics trace, cross-system financial reconciliations to sub-0.1%, and a build-vs-buy semantic-layer evaluation.

Not all data-engineering work is building pipelines. A large part of mine is reading other teams' systems — application code, databases, query logs, gateways — to find why something is slow, wrong, or drifting, and then proving the fix. A selection:

Reporting-portal timeouts: a cross-stack root-cause, proven in production

A payment-orchestration product's reporting portal was timing out, and the easy story ("ClickHouse is slow") was wrong. I measured the Postgres source directly — the whole database was 626 MB and a full all-time aggregate ran in 55 ms — then read seven application repositories to trace the real causes: unpaginated list endpoints returning ~19,000 rows per call, array-join shapes that couldn't use an index, and PostgreSQL JIT compilation adding 0.7–2.1 s per call (up to 95% of a query's time) on queries that only ever read thousands of rows.

I handed the DBA team a tiered plan. The zero-risk tier — disabling JIT for the portal role — was applied in production and measured: one endpoint went 7.35 s → 1.0 s (−86%), confirming the diagnosis. For the array-join endpoints that config alone couldn't fix, I wrote and verified (read-only, row-by-row against the original) query rewrites: a reconciliation summary dropped ~6.3 s → 18 ms, a disbursement list 188+135 ms → 55 ms. I packaged it as a three-architecture proposal (Postgres optimization · ClickHouse aggregation via refreshable MVs · CDC-fed mirrors) with the trade-offs, not just the SQL.

Bot & audit-trail forensics

A single client IP stopped appearing in a QRIS merchant portal's audit trail after a certain date, while a traffic burst was flagged on the gateway. I traced the full request path through the code — Gateway → Yii application filter → RabbitMQ → a Go logging worker → MongoDB — and established that the audit trail only records requests that reach the app, so the disappearance was most likely an infra-level block, not a code change. The investigation surfaced how the bot evaded fraud detection (cadence ~1 request / 10 min, far under the rate threshold; empty user-agent), a ~98.9% automated-login success rate across 4,610 audit rows, a 12,325-hit single-day gateway burst, and the fact that the only surviving copy of the purged source data lived in the warehouse's raw layer. I also flagged that audit IPs are derived from client-controllable headers and therefore spoofable.

Cross-system financial reconciliation

  • VA report, warehouse vs the product's own ClickHouse: a 2.2× row gap (~31K vs ~67K) that four other report legs didn't show. Root-caused to the source's OLTP→OLAP sync accumulating one row per historical payment key; re-grained the warehouse join to reproduce the stakeholder number and caught a date-field bug affecting 54% of rows. Final match within 0.02% — and the warehouse turned out to be more complete than the source, which had silently dropped 21 valid transactions.
  • Cross-platform VA discrepancy: classified ~700 mismatched rows by account prefix and proved 621 were by-design (routing splits, key recycling), narrowing the genuine-loss escalation to 19 rows.

Build-vs-buy: semantic layer evaluation

Evaluated an open-source semantic layer (Cube) as a governed metrics layer over the warehouse, with explicit kill-criteria. Verdict: NO-GO. Its SQL API truncated Decimal money to float (a GMV value …330319 became …33), pre-aggregations silently truncated results outside their build range, and a multi-stage query amplified production load to 109 GiB read in 20 minutes. A native ClickHouse parameterized-view approach matched every governance benefit — locked definitions, exact Decimal, a CI golden test — with zero added infrastructure.

Capacity, cost & monitoring

  • Reclaimed ~128 GiB of broker disk during a near-full storage alert by right-sizing Kafka topic retention (after mapping every consumer so nothing depended on the data being dropped), and ~194 GB/node of warehouse storage by dropping stale partitions with a cold-storage backfill plan.
  • Built a ClickHouse query monitor with a Telegram bot that cards high-CPU queries (≥70 CPU-seconds) with an inline Kill button and a live-updating elapsed/CPU display.
  • Catalogued the source-system estate (four products, Go/Next.js/Postgres/MySQL/MongoDB/Redis/RabbitMQ) as a change-watch list so upstream schema churn can't silently break the CDC pipelines, and drove a dependency EOL/CVE remediation that lifted the main repo's health score out of RED.

Stack: ClickHouse · PostgreSQL (pg_stat_statements, JIT, query planning) · Go / PHP (source reading) · Kafka / Redpanda · MongoDB · Debezium · Grafana · Python.