Atomic Rails for Money-in-Motion: A Resilientinstant Payment Gateway with ID Resolution, Retries, and Guaranteed Reversals
This paper presents a payment‑processing gateway that executes debit→credit transfers across banks utilizing a virtual payment ID resolver, a transaction processing core, and bank connectors engineered for low‑latency, high‑reliability flows. The gateway coordinates gRPC services behind load balancers, applies client/server‑side request balancing, and tunes retry policies with bounded attempts to withstand temporary faults, then commits or rolls back atomically via a scheduler‑driven reversal queue to guarantee consistency. A centralized per‑account mutex, database sharding by account hash, and ElasticSearch‑backed idempotency logs provide ordering, concurrency control, and fast lookups at scale, while Dockerized microservices simplify deployment and scale‑out. Benchmarks differ nodes and connection fan‑out to measure throughput and tail latency under debit/credit paths, showing trade‑offs among locks, retries, and batching, and aligning with fast‑payment system patterns and modern gRPC load‑balancing practices for payment gateways.