15/05/2023
| 💸 Uber Payments Processing Architecture 💸
processes billions of dollars in payments every year. To ensure that these payments are processed securely and consistently, Uber uses a complex architecture that is based on the principles of double-entry bookkeeping.
✌️ The architecture consists of two main parts: collections and disbursements. Collections handle the process of collecting payments from riders and eaters, while disbursements handle the process of paying out money to drivers and restaurants.
🚘🤑🌍🔒 Uber's payment processing architecture solves the challenge of creating consistent data to move money securely at scale. With users in 70 countries, a multi-region setup, and a complex payment structure, ACID transactions and the Saga pattern don't work. Instead, Uber uses retry jobs that constantly scan transactions and fix failed parts to achieve data consistency.
💰 The payment flow starts with the creation of an order for a ridesharing trip or a payout to a driver. The order processing service selects the right processor based on geographical location and payment method, and the order Reader/Writer service persists data in the database and updates accounts and balances. The data access service generates invoices, receipts, statements, and taxes based on the orders stored in the DB.
🔑 Idempotency is also important in the system to handle duplicate requests and prevent data discrepancies and double-spending problems. Uber uses unique IDs and logic to validate requests to ensure accounts are correctly debited and credited.
👨💻👩💻 Uber's engineers have created a reliable and secure payment processing architecture that ensures consistent data and seamless transactions for users worldwide.
Product, UX, Tech London Community