The Question
Design
Scalable Payment Gateway and Ledger Design
Design a highly available and reliable payment processing system that integrates with multiple third-party PSPs. The system must ensure exactly-once processing (idempotency), maintain a strictly consistent internal double-entry ledger for auditing, and handle a throughput of 10,000 peak transactions per second while remaining resilient to external service latency and failures.
PostgreSQL
Kafka
Redis
Kubernetes
mTLS
gRPC
Prometheus
Saga Pattern
Transactional Outbox