How would you design a global, multi-currency payment gateway with sub-100ms latency?
Sub-100ms means minimising round-trips and keeping the critical path short.
Geo-distribution: Place edge PoPs (Points of Presence) so TLS terminates close to the user; use latency-based DNS or anycast so requests hit the nearest edge. This cuts RTT and keeps the first byte fast.
Data consistency: Use a global database (CockroachDB, Spanner) that supports multi-region writes with strong consistency, or a "Home Region" model where each user's ledger is pinned to a shard in their region. Avoid cross-continent consensus (Paxos/Raft) on the hot path—it adds tens of milliseconds.
Currency and async: Cache FX rates at the edge (e.g. Redis, 60s TTL) so conversion doesn't hit the core DB. Keep only the Authorize step synchronous (card check, balance hold); Capture and Settlement run asynchronously via a message bus (Kafka, etc.) so the user gets a fast response.