GolangPython/DjangoPostgreSQLRedisDistributed Systems

Upay Mobile Financial Services


On this page

Upay is a prominent Mobile Financial Service (MFS) in Bangladesh by UCB Fintech Company Limited. It processes massive volumes of transactions, requiring absolute precision, strict compliance, and ultra-low latency.

As a Backend Engineer, I moved beyond standard CRUD APIs to architect a highly decoupled, polyglot payment infrastructure, with my most significant contribution being the core Basic MFS Transaction Gateway.

1. High-Throughput Transaction Gateway (Go & Echo)

The beating heart of Upay’s peer-to-peer and cash-in/cash-out ecosystem is a high-throughput orchestration engine built in Golang. Validating a single financial transaction requires querying multiple downstream services (Core Ledger, Limit Management, Fees, Customer Profiles).

  • Scatter-Gather Concurrency: To prevent unacceptable API timeouts, I aggressively parallelized non-dependent network calls using Go’s Goroutines and Channels. This pipeline simultaneously fetches sender/receiver profiles while running limit checks, minimizing network I/O blocking.
  • Microservices Orchestration (Saga): Implemented strict compensation logic. If a downstream service or local database commit fails after limits are checked, asynchronous reversal functions are triggered to release held funds, ensuring distributed transaction consistency without slow Two-Phase Commits (2PC) or distributed locks.
  • Database Optimization: Migrated primary keys to ULIDs (Universally Unique Lexicographically Sortable Identifiers) to drastically reduce PostgreSQL index fragmentation and tuned connection pooling to prevent exhaustion under peak loads.

2. The Universal Financial Aggregator (DPS Service)

To seamlessly integrate disparate third-party legacy banking systems into a single standardized ecosystem, I architected a highly scalable Universal Aggregator in Python/Django.

  • Interface-Driven Integration: Utilized strict Strategy and Adapter patterns (Open/Closed Principle) to normalize varied external banking APIs into a unified internal schema, reducing new bank onboarding time from months to days.

3. Configuration-Driven Utility Rate Engine

Integrating dozens of utility providers typically leads to massive code redundancy and hardcoded fee structures. I architected a highly dynamic configuration layer to abstract this.

  • Dynamic Rule Evaluation: The engine evaluates complex financial rules (fixed amounts, percentages, max-caps, and variable slabs) dynamically at runtime.
  • Deterministic O(1) Caching: Implemented a sophisticated, multi-tiered Redis caching layer. By generating deterministic cache keys based on transaction metadata, the system bypassed the relational database entirely for recurring rate calculations.