Milen Hristov, a senior Go backend engineer who built the SportPesa betting platform in Nairobi, stresses that every mobile‑money transaction is fundamentally asynchronous, even when it appears instant to users.
SportPesa’s early architecture relied on MySQL NDB Cluster to handle SMS‑based bets routed through Kannel, later shifting all deposits to M‑Pesa as the service grew to about two million monthly active users.
At its peak in 2018, the platform processed roughly $3.7 million (about Ksh 477 million) in daily bets, making it one of Kenya’s largest generators of M‑Pesa traffic.
Lesson 1: never treat payment callbacks as the sole source of truth because they can arrive late, duplicate, be out of order or never arrive; systems need independent status queries and automated reconciliation.
Lesson 3: enforce strict idempotency in every callback handler so that repeated confirmations from the mobile network credit a wallet only once.
Lesson 4: design for the payment provider’s peak load, because during events like major football matches the latency of the mobile‑money rail becomes the system’s latency.
Lesson 5: reconcile daily against the provider’s official statement, as internal databases only reflect the application’s view of transactions.
Hristov notes that engineers accustomed to card‑payment systems often encounter these distributed‑system edge cases late, whereas mobile‑money platforms force mastery of them from day one.
Comments