| 🔒 Concurrency Safety |
Row-level pessimistic write locking (SELECT ... FOR UPDATE) paired with deterministic alphabetical lock ordering by UPI ID, eliminating race conditions and deadlocks during concurrent account debits and credits. |
| 📜 Double-Entry Ledger |
Atomic paired DEBIT and CREDIT records with strict base-10 BigDecimal arithmetic precision denominated in Indian Rupees (INR, symbol: ₹, scale = 4) and Banker's Rounding (HALF_EVEN), preserving an immutable financial audit trail. |
| 🔁 Durable Idempotency |
Mandatory Idempotency-Key headers (validated 255-char regex boundary) backed by raw SHA-256 payload hashing to prevent tampering, coupled with Redisson distributed locking (payflow:lock:idemp:{key}) to coordinate mutations across multi-instance clusters. |
| 🛡️ Resilience & Fault Tolerance |
Dynamic per-user rate limiting (10 req/s, RFC 6585 Retry-After: 1), Resilience4j circuit breaking on external banking rails, bounded timeouts, and automatic memory eviction of inactive limiter buckets. |
| ⚡ Transactional Outbox |
Spring Modulith Event Publication Registry atomically persisting domain events (TransferCompletedEvent) within the database transaction, bridging to Apache Kafka without dual-write inconsistency, with automated background retention cleanup (OutboxCleanupService). |
| 🔐 Zero-Trust Security |
Stateless HMAC-SHA256 JWT tokens with fail-fast production secret validation, strict principal-bound sender verification, role-based access control (ROLE_ADMIN on user enumeration), clickjacking defense (sameOrigin), and RFC 9457 ProblemDetail error responses. |
| 📊 Enterprise Observability |
Native Elastic Common Schema (ECS) JSON structured logging, MDC trace correlation (requestId, traceId, spanId), Prometheus metrics, and profile-conditional Redis distributed caching with targeted cache eviction and Caffeine local fallback. |
| 🤖 Gen-AI Spend Insights |
Spring AI 2.0.1 integration providing automated expenditure classification and contextual budgeting tips with structured JSON output, guarded by Resilience4j circuit breakers and deterministic keyword heuristic fallback. |
| 🚀 Virtual Threads & Concurrency |
Java 25 Project Loom Virtual Threads enabled globally (spring.threads.virtual.enabled: true), with bounded HikariCP connection pool configurations and a low-memory prod-light profile designed for <= 1 GiB single-node production environments. |
| 🐳 Cloud-Native Orchestration & Quality Gates |
Hardened multi-stage Docker build (eclipse-temurin:25-jre, unprivileged payflow:10001 user), full-stack Docker Compose (PostgreSQL 17, Redis 7, Kafka KRaft, Ollama, Prometheus, Grafana), Kubernetes HPA/PDB topology with zero-downtime graceful shutdown, SpotBugs static analysis, and automated JaCoCo coverage enforcement (90% Line / 73% Branch). |