KB
Kashif Bin Umer
All Case Studies
Client Context: Middle East Fintech & Neo-Banking Platform
Fintech & Financial Services8 weeks2026-02-10

Real-Time Multi-Currency Ledger & PCI-DSS Payment Gateway Architecture

Kashif Bin Umer
Kashif Bin Umer
Founder & CEO, EaseZen Solutions
Role: Principal Solution Architect · Founder & CEO, EaseZen Solutions

Verified Technical & Commercial Impact

0.00%
Ledger Discrepancies
Zero balance discrepancies across $40M+ in monthly volume
<180ms
Settlement Speed
Median payment authorization and ledger commit time
80%
PCI Scope Reduction
Isolated cardholder environment drastically simplified audit pass
0
Duplicate Charges
Complete elimination of double billing issues via distributed idempotency

Executive Summary

Designed an immutable double-entry ledger and zero-data-loss payment routing gateway handling $40M+ monthly transactions, achieving PCI-DSS Level 1 compliance and sub-200ms settlement confirmation.

The Architectural Challenge

The client was expanding from a domestic payment app into a regional cross-border payment platform. Their existing database handled balance updates with simple integer subtraction, leading to race conditions during simultaneous merchant payouts and customer transactions. Furthermore, regulatory compliance demanded strict PCI-DSS Level 1 certification, verifiable double-entry bookkeeping, and an immutable audit trail for every transaction currency conversion.

Architectural Strategy & Solution

Architected a distributed, immutable double-entry ledger based on Martin Fowler's accounting patterns with cryptographic transaction hashing. Integrated an idempotent payment gateway orchestration layer that connects to multiple regional acquiring banks with automated failover and dynamic smart fee routing. Tokenized credit card payloads at edge gateways so zero raw cardholder data touches internal application databases, drastically reducing PCI-DSS scope.

Key Architectural Pillars:

  • Immutable double-entry ledger guaranteeing Debits = Credits for all transactions
  • Cryptographic SHA-256 ledger chaining for tamper-evident financial audit trails
  • Idempotent API design with Redis distributed locks preventing duplicate charges
  • Multi-region banking gateway with dynamic latency-based routing & auto-fallback
  • Zero-trust cardholder data tokenization vault compliant with PCI-DSS Level 1

Architectural Decision Records (ADRs)

Documenting explicit trade-offs and rationale rather than generic consensus.

Immutable Append-Only Double Entry Ledger with PostgreSQL Row-Level Locking

ADR #1
Context

Prevent balance inconsistencies, negative balances, and unauthorized account state mutations.

Acknowledged Trade-Off

Requires balancing debit and credit entries for every transaction; higher storage requirements.

Measured Outcome

100% auditable accounting records; eliminated race conditions and ledger discrepancies to zero.

Edge Card Tokenization via Isolated Vault Service

ADR #2
Context

Need to achieve PCI-DSS Level 1 compliance without having to certify the entire application ecosystem.

Acknowledged Trade-Off

Added a lightweight network hop to tokenize card data upon ingestion.

Measured Outcome

Reduced PCI compliance audit scope by 80%, saving $140k in annual auditing and compliance costs.

Idempotency Keys and Distributed Lock with Redis Redlock

ADR #3
Context

Network hiccups from upstream payment processors caused duplicate charge attempts.

Acknowledged Trade-Off

Transactions must submit a client-side UUID; rejected requests within retry windows.

Measured Outcome

Zero duplicate transactions recorded across over 3.2 million transaction attempts.

Technology Stack & Infrastructure

Go (Golang)PostgreSQLRedisAWS KMSDockerHashiCorp VaultNATS MessagingOpenTelemetry

“The double-entry ledger architecture Kashif designed passed our external financial audit on the first review. His expertise in fintech security and transaction guarantees is unmatched.”

Chief Technology Officer·Executive Leadership(Middle East Fintech Platform)

Architecture FAQs & Implementation Details

Common technical questions and design decisions addressed during this project.

How does the double-entry ledger prevent account balance race conditions?

Rather than storing an editable 'balance' column, every financial event inserts immutable debit and credit ledger rows. Balances are derived snapshots backed by strict row-level serialization locks during pending settlements, guaranteeing mathematical consistency even under thousands of concurrent requests.

How did this architecture reduce PCI-DSS compliance costs?

By implementing an edge tokenization vault using AWS KMS and HashiCorp Vault, raw Primary Account Numbers (PANs) never entered core backend microservices or primary databases. This narrowed the PCI-DSS compliance perimeter from 24 microservices down to just 2 dedicated vault nodes.

More Architecture Case Studies

View all
Kashif Bin Umer · Founder & CEO, EaseZen Solutions

Planning a similar architecture or modernization?

Book a 30-minute consultation. We review your architecture, assess trade-offs, and outline an executable roadmap for your engineering team.

Book Consultation