Designing a High-Throughput E-Wallet & SNAP BI Payment System in Go

Architectural deep dive into building an enterprise-grade digital wallet microservice with Apache Kafka event streaming, Bank Indonesia SNAP BI API compliance, and double-entry ledger consistency.

1. Problem Statement & System Requirements

Digital wallet platforms must process thousands of financial state changes per second without risking balance drift, double debits, or regulatory non-compliance. The system was designed to fulfill four primary requirements:

2. High-Level System Architecture

[Client App] ──(RSA-SHA256 B2B Token)──▶ [API Gateway & Auth Service] │ ▼ (JWT Bearer) [Client App] ──(HMAC-SHA512 /transfer)──▶ [Core Wallet Engine (Go Clean Arch)] │ ┌─────────────────────────────────┼─────────────────────────────────┐ ▼ ▼ ▼ [Redis Idempotency Lock] [PostgreSQL DB (Pessimistic Lock)] [Apache Kafka Event Bus] `lock:payment:{ext_id}` `SELECT ... FOR UPDATE` `payment.created` │ ▼ [Settlement & Recon Worker]

3. Key Engineering Decisions & Rationale

Senior backend engineering is defined by sound architecture judgment rather than technology buzzwords:

4. Architecture Trade-offs (Advantages vs Disadvantages)

✅ Event-Driven Kafka (Pros)

  • Zero API latency impact for heavy downstream auditing.
  • Guaranteed replayability in case of bank settlement downtime.
  • Decoupled worker squads can scale independently.

⚠️ Eventual Consistency (Cons)

  • Requires robust reconciliation workers for final settlement status.
  • Duplicate message filtering required at consumer boundaries.

5. Related Technical Case Studies

📚 Explore Related Architecture Guides

YS

Nur Awwabin Yoga Saputra

Senior Backend Engineer specializing in Go, Distributed Systems, Microservices, and High-Throughput Financial Architecture.