Digital Banking Backend Platform — Secure Microservices Architecture
Key Performance Metrics
Uptime
Time Saved
Business Challenge
The digital bank needed to launch in 8 months with a complete banking stack — customer onboarding with e-KYC, core banking with real-time ledger, payment processing with BI-FAST and QRIS integration, lending with automated credit scoring, regulatory reporting to OJK, and compliance with PCI DSS and GDPR-equivalent regulations. The existing options — buying a legacy core banking system or building on a vendor platform — were rejected due to high licensing costs and limited customization. The bank chose to build a custom platform to maintain competitive differentiation and avoid vendor lock-in.
## Solution Architecture
Solution Architecture
We designed a domain-driven microservices architecture with 12 bounded contexts: Customer, Account, Transaction, Payment, Lending, Card, Notification, Audit, Reporting, Identity, Configuration, and Gateway. Each service owns its database schema in a shared PostgreSQL cluster with logical separation enforced at the application layer. Inter-service communication uses Apache Kafka for asynchronous events and gRPC for synchronous calls requiring immediate consistency. An API Gateway (Kong) provides centralized authentication, rate limiting, request transformation, and API versioning.
### Transaction Processing Pipeline
Transactions flow through a multi-stage pipeline designed for correctness under failure: API Gateway validates JWT and rate limits → Transaction Service validates business rules (sufficient balance, account status, limits) → creates a pending transaction in the ledger → publishes TransactionInitiated event to Kafka → Account Service updates balance (optimistic locking with version field) → Payment Service routes to external network (BI-FAST, QRIS) → publishes TransactionCompleted event → Notification Service sends push notification. Every state transition is logged immutably to the audit service. Failed transactions trigger compensating actions via the Saga pattern.
### Security Architecture
**Defense in Depth:** Network segmentation with Kubernetes network policies isolating services by trust level. mTLS between all services using HashiCorp Vault for certificate management. JWT with short-lived access tokens (15 minutes) and refresh token rotation. API keys hashed with SHA-256 for service-to-service authentication. All sensitive data (PII, account numbers) encrypted at the application layer before storage using AES-256-GCM with per-customer encryption keys. HSM integration for cryptographic key management. OWASP ASVS Level 2 compliance verified through independent penetration testing.
## Key Features
Key Features
Customer onboarding with e-KYC integration (Dukcapil verification, biometric liveness detection, OCR document scanning). Core banking with double-entry ledger, real-time balance computation, transaction categorization, and monthly statement generation. Payment processing with BI-FAST (real-time), QRIS (merchant-presented and customer-presented), virtual account, and interbank transfer via SKN. Lending with automated credit scoring, loan origination workflow, disbursement, repayment scheduling, and collections management. Regulatory reporting with automated OJK reports (LBU, LKPBU), suspicious transaction monitoring, and audit trail with cryptographic integrity.
## Technology Stack
Technology Stack
Java 21 with Spring Boot 3 for core banking microservices — chosen for its mature ecosystem, strong typing, and enterprise-grade transaction management. Apache Kafka for event streaming with exactly-once semantics for financial events. PostgreSQL 16 for transactional data with connection pooling via HikariCP and read replicas for reporting queries. Redis for distributed caching, session management, and rate limiting. HashiCorp Vault for secrets management, encryption-as-a-service, and PKI. Kong API Gateway for centralized routing, authentication, and rate limiting. Docker and Kubernetes for container orchestration with pod anti-affinity for high availability. Prometheus and Grafana for metrics, OpenTelemetry for distributed tracing, ELK stack for centralized logging.
## DevOps Pipeline
Results
Platform launched on schedule in 8 months. Processes 10,000+ transactions per second with p99 latency under 200ms. Achieved 99.99% uptime (less than 53 minutes downtime per year). PCI DSS Level 1 compliance certified on first audit. Customer onboarding time reduced from 3 days (manual) to 5 minutes (automated e-KYC). Loan approval time reduced from 5 days to 2 minutes through automated credit scoring.
## Lessons Learned
Lessons Learned
Microservices architecture requires significant investment in observability — distributed tracing was essential for debugging transaction failures across 12 services. The Saga pattern is necessary for cross-service transactions but adds complexity — every forward operation needs a corresponding compensating transaction with idempotency guarantees. API versioning must be designed from day one — breaking changes to internal service contracts cascade through the entire platform. Financial software demands a different level of testing rigor — we implemented property-based testing for transaction validation, chaos engineering for failure injection, and parallel run validation comparing new system output against manual calculations for 3 months before go-live.
Technologies Used
Related Projects
Ready to build your enterprise solution?
Discuss your software engineering needs with the HattaDev engineering team.
Free consultation. No commitment.