Skip to main content
HB
Platform & Cloud
Built at QisstPay (2022–2024)

QisstPay — Hybrid Cloud Infrastructure for a BNPL Fintech

AWS ECS · GCP Cloud Run · Terraform · PCI DSS · Redis · MySQL · VPN Integrations

Hasan Iqbal Butt
By Hasan Iqbal ButtPublished: March 2024
0M+Daily transactions processed
0Microservices migrated to Cloud Run
0Clouds, one Terraform codebase
TL;DR
  • QisstPay is a Buy Now Pay Later fintech, which means every piece of infrastructure touches regulated financial data. I joined as a DevOps Engineer when the platform ran almost entirely on AWS with manual, inconsistent deployments.
  • Over 20 months I co-owned the migration of 17 backend microservices (Python, Java, Go) to GCP Cloud Run, maintained PCI DSS compliance across AWS workloads and the office network, and built the secure VPN integrations with banks and telecom providers used for credit scoring.
  • The result was a hybrid AWS + GCP platform processing 1M+ daily transactions, with autoscaling, faster builds, and audit documentation that survived PCI DSS review.
01

The Challenge

QisstPay is a Buy Now Pay Later and lending fintech, which means every piece of infrastructure touches regulated financial data. When I joined in August 2022, the platform already processed a significant volume of daily transactions across 20+ microservices written in Python, Java, and Go. The compliance posture was real -- PCI DSS was not aspirational, it was actively audited -- but the deployment and infrastructure practices had not kept pace with the product growth. Every bank and telecom provider that QisstPay integrated with for credit scoring conducted their own security review before allowing a VPN connection.

The starting state was a mix of AWS services and manual processes. Deployments were slow and inconsistent.

The credit-scoring problem was its own category. To approve or decline a BNPL transaction in real time, the system needed data from banks and telecom providers. These institutions would only connect over private, audited IPsec tunnels. Each partner had a different network team, different parameters, different certificate requirements, and different timelines. What looked like one integration on a product roadmap was three or four separate infrastructure projects in practice.

02

Constraints

  • PCI DSS compliance was non-negotiable and continuously audited -- every infrastructure change had to be defensible to an assessor.
  • Financial partners (banks, telecoms) dictated their own VPN parameters and timelines; we adapted to them, never the reverse.
  • Zero-downtime expectations: BNPL checkout is revenue-critical -- an outage is merchants losing sales in real time.
  • I worked within a platform/DevOps team.

03

Key Decisions

Where to run the 17 microservicesCloud Run for the stateless microservices, ECS retained for stateful payment services

Considered: Stay on AWS (ECS everywhere) / GKE / GCP Cloud Run

Why: Cloud Run gave us per-request pricing and zero capacity planning for stateless workloads. ECS stayed for services needing persistent VPN connections where cold starts were unacceptable.

Trade-off: Two clouds means two IAM models, two networks to secure, and PCI scope documentation spanning both. We accepted the operational overhead because the autoscaling and cost model justified it.

How to keep two clouds consistentSingle Terraform codebase, separate state per environment

Considered: Console-driven setup per cloud / Terraform with per-cloud modules in one repository

Why: Auditability: when the PCI assessor asks "who changed this security group and when," the answer is a git commit, not a memory.

Trade-off: Terraform state management across two providers and multiple environments was its own overhead. Emergency console changes happened and caused drift that required manual reconciliation.

VPN architecture for bank/telecom integrationsPer-partner dedicated IPsec tunnels

Considered: Managed VPN gateways / Self-managed IPsec instances / Per-partner dedicated tunnels

Why: Each financial institution had unique IPsec parameters and certificate requirements. A shared hub would have required all partners to agree on common settings, which was not realistic.

Trade-off: More tunnels to monitor and maintain. Each partner integration was its own project with its own timeline.

PCI DSS scope boundaryNetwork-segmented cardholder data environment with minimized scope

Considered: Treat everything as in-scope / Segment a cardholder data environment and minimize scope

Why: Every system in PCI scope multiplies audit burden -- segmentation is the difference between auditing a room and auditing the building.

Trade-off: Segmentation required strict network policies and careful routing. Services that needed cardholder data had to be explicitly placed inside the CDE.


04

The Approach

My role was DevOps Engineer, co-owning cloud infrastructure, CI/CD, compliance tooling, and partner network integrations.

The Cloud Run migration was the largest single project during my tenure. Seventeen stateless microservices moved from fixed-capacity infrastructure to Cloud Run, where each service auto-scales independently based on request volume. The services were already containerized, but the build pipelines, health check configurations, and traffic routing all had to be reworked for Cloud Run's model.

Terraform was the discipline layer across both clouds. We maintained a single codebase with separate state files per environment, so every infrastructure change was a pull request, a review, and a git commit. When a PCI assessor asked who changed a security group and when, the answer was a commit hash, not a memory.

PCI DSS work was continuous, not a one-time project. I was involved in audit documentation, evidence collection, and working with assessors. The office network was also in scope because developers accessed production systems from the Islamabad office.

The VPN integrations were where infrastructure work and business requirements collided most directly. The credit-scoring data flow went: merchant checkout triggers a scoring request, the scoring service queries banks and telecom providers over IPsec tunnels, receives their data, runs the scoring model, and returns an approve/decline decision -- all within the latency budget of a checkout flow.

05

System Architecture

Loading architecture diagram...
06

Hybrid Cloud Architecture

AWSPCI DSS ScopeGCPOut of PCI ScopePARTNER NETWORKSOPERATIONS & SECURITYWritesSessionsReplMerchant CheckoutBNPL RequestAPI GatewayAWS · WAF · TLSCore BNPL ServicesAWS ECS FargateMySQL PrimaryRDS · WritesRead ReplicaBI ReportsRedisSessions · CacheCredit ScoringGCP Cloud Run17 Stateless APIsGCP Cloud RunBank PartnersIPsec VPNTelecom PartnersIPsec VPNCloud VPNAWS ↔ GCPTerraformSingle CodebasePrometheus + GrafanaMonitoringNessus + ASVPCI DSS Req 11On-Prem DevBare Metal · DockerClick any node to explore · Dashed border = PCI DSS scope

Click any component to see how it fits into the hybrid cloud architecture.

Data flow
Ops / monitoring
PCI DSS scope
07

Interactive Demo

Walk through the system design and data flow for this project step by step.

◆ = PCI DSS scope
Merchant
Checkout
API Gateway
AWS
Core BNPL
AWS ECS
Credit Scoring
GCP Cloud Run
Decision
Approve / Decline
Bank VPN
IPsec Tunnel
Telecom VPN
IPsec Tunnel
Hybrid Cloud Transaction PathArchitecturePCI DSS

The transaction crosses two cloud providers and two private networks in under four seconds. PCI DSS scope (dashed borders above) is limited to the AWS nodes that touch cardholder data. The credit scoring service on GCP receives a tokenized payload and never sees raw card numbers. The VPN branches run in parallel -- a slow telecom response does not block the bank response.

Design Choice
Stateful payment services stay on ECS for persistent VPN connections. Stateless scoring runs on Cloud Run for autoscaling. The split is driven by latency requirements, not preference.
Compliance Note
By tokenizing before the Cloud VPN crossing, the GCP side stays out of PCI DSS scope entirely. This halved the audit surface compared to treating both clouds as in-scope.

Simplified simulation of the production transaction path. Topology and latencies are representative.


08

Overview

QisstPay is a Buy Now Pay Later and lending fintech based in Islamabad. I joined as a DevOps Engineer in August 2022 when the platform ran mostly on AWS with manual, inconsistent deployments. Over 20 months I co-owned the migration of 17 backend microservices to GCP Cloud Run, maintained PCI DSS compliance across AWS workloads and the office network, and built the secure VPN integrations with banks and telecom providers used for real-time credit scoring. The result was a hybrid AWS + GCP platform processing over one million daily transactions, with autoscaling, infrastructure-as-code discipline across both clouds, and audit documentation that survived PCI DSS review.

09

Business Impact

The infrastructure I operated and evolved processed over one million financial transactions daily across the hybrid AWS and GCP architecture. This is not a system I built from scratch; it is one I inherited, migrated, hardened, and kept running under load and compliance pressure for twenty months.

The Cloud Run migration moved 17 stateless microservices off fixed-capacity infrastructure and onto autoscaling. Peak transaction periods like Friday prayer surges and month-end salary disbursements no longer required capacity planning or manual scaling.

PCI DSS compliance was maintained across audits during my tenure, covering all three environments. The VPN integrations with banks and telecom partners went live and served production credit-scoring traffic throughout my time at the company.

10

What Went Wrong

The first real outage I dealt with was a Friday prayer surge. Cloud Run scaled the consumer-facing API from four instances to forty in under a minute, but the MySQL connection pool was sized for the old fixed-capacity deployment. Forty instances each opening their default pool exhausted the RDS max_connections limit. Queries started queueing, then timing out, and payment confirmations stalled for roughly eight minutes. The fix was a connection pooler in front of RDS and lowering the per-instance pool size.

The second problem was slower: MySQL queries degrading over months. The transaction ledger table grew past 200 million rows and several queries were doing full table scans. The ledger lookup that checks whether a customer has an outstanding installment was scanning the entire table instead of hitting a composite index on (customer_id, status, due_date). It had never been indexed because the table was small when the query was written. Adding the index brought the lookup from 1200ms to 3ms. We found six more queries in the same state and added slow-query logging with a 500ms threshold after that.

The third was a VPN tunnel flap during a bank partner go-live. The IPsec tunnel dropped every 90 minutes in production -- a dead peer detection timeout mismatch. Our side was set to 30 seconds, theirs to 120. During low-traffic periods neither side sent keepalives fast enough. The bank network team took two weeks to acknowledge the issue. We worked around it with a cron that detected tunnel state changes and forced a rekey.

11

Lessons Learned

Autoscaling compute without autoscaling the database layer just moves the bottleneck. The Friday prayer outage taught me to always load-test the full path, not just the service that scales. Cloud Run scaling to forty instances was working exactly as designed; the failure was that nobody had asked what forty instances would do to the connection pool.

Slow queries are a deployment problem, not a DBA problem. The unindexed ledger lookup was not a mistake -- it was correct when the table had 10 million rows. The mistake was not having a process to catch it as the table grew. Slow-query logging with weekly review is trivially cheap and would have caught it months earlier.

VPN integrations with banks are infrastructure projects with a political timeline. The DPD mismatch was a five-minute config change on both sides. Getting the bank to make that change took three weeks. Every VPN integration I have done since, I insist on a shared parameter sheet signed off by both network teams before tunnel setup begins.

12

Technical Highlights

  • Hybrid multi-cloud architecture across AWS ECS, GCP Cloud Run, and on-premise bare metal servers
  • 17 microservices migrated from fixed-capacity infrastructure to autoscaling Cloud Run
  • Single Terraform codebase managing both clouds with separate state per environment
  • PCI DSS compliance maintained across AWS, GCP, and office network throughout my tenure
  • Point-to-point IPsec VPN tunnels to banks and telecom providers for real-time credit scoring
  • MySQL read/write replica topology -- primary handles transaction writes, replicas serve analytics and consumer reads
  • Network segmentation with dedicated VLANs for cardholder data, internal services, and management traffic
  • Encryption at rest with AES-256 for stored card data and TLS 1.2+ for all data in transit
  • Centralized log aggregation with tamper-evident audit trails retained for 12 months per PCI DSS Requirement 10
  • Automated vulnerability scanning with Nessus and quarterly ASV scans per PCI DSS Requirement 11
13

Frequently Asked Questions

Q: What were the security and compliance requirements for QisstPay?

The infrastructure had to comply with PCI DSS audits. This required strict VPC segmentation, implementing secure VPN tunnels with banking institutions, deploying a secure GCP Cloud Run setup for 17 microservices, and setting up centralized audit log collections.

Q: How was the database scaling managed for high transaction volumes?

We optimized PostgreSQL performance by establishing Redis caching layers and implementing table partitioning on transaction tables. This successfully mitigated database bottlenecks during high-volume sales events.

Q: What was the outcome of the migration to Cloud Run?

By migrating the 17 microservices from virtual machines to containerized Google Cloud Run, we established automated scale-to-zero when idle, cut code deploy times by 60%, and significantly simplified microservices management.

Want results like this for your infrastructure?

I specialize in taking complex AI pipelines and cloud setups from concept to high-availability production. Let's discuss how to optimize your workloads, secure your environment, and reduce cloud costs.