Architecture & LLD Preview
Payment Gateway
Route payments through multiple providers with retries, idempotency, and status tracking.
A PaymentGateway Adapter hides each provider's SDK; a RetryPolicy retries transient failures on the same provider before failing over to the next one in the chain, an idempotency key gates every charge before any provider is touched, and a persisted PaymentStatus makes the outcome always queryable instead of assumed.
Core Design Challenge
"Design a payment gateway that routes through multiple providers. How do you retry safely and fail over without double-charging?"
What You'll Learn:
- ✦Double-entry bookkeeping and ledger accuracy rules
- ✦ACID transaction safety, idempotency, and ledger balance consistency
- ✦Optimizing running balance computations for fast queries
- ✦Auditing, logging, and immutable historical records