Over the past few years, payment digitalization has grown exponentially. From utility payments, insurances, microfinance, loyalty and many more financial use cases, digital banking and payments platforms are now processing millions of transactions in a day. mobiquity® is one such leading digital banking and payments platform that powers digital financial services for over 80 banks, financial institutions and telecom operators catering to over 120 million consumers and processing 7 billion transactions annually.
To meet the scale of transactions and diversity of use cases, we have built mobiquity® as highly scalable, reliable and flexible digital banking and payments platform. In this article, I will share my experience of engineering mobiquity® – the next gen digital banking and payments platform.
Design Constraints:
To support diverse lines of business in a uniform way, mobiquity® platform implements a more generic way of handling payments with the design constraints mentioned below:
- Any addition of a new line of business does not impact core payment processing platform.
- Maintain a single code base for all our clients. Extensibility at core to meet changing needs and client specific customisation without changing core platform.
- Consistent money movement
- Immutable
- Auditable
- Zero Sum Principle of accounting
Getting the Architecture Right
The journey started with finding the best architecture pattern to fit within design constraints and ended with an “event driven micro-service” architecture mix of choreography and orchestration. Our engineering team re-wrote all our code into modular services built on top of a messaging infrastructure. At a high level, the architecture is as below.
All these micro-services are controlled by a service orchestrator built in-house and flexible enough to stich any business flow using configurations. Each business flow consists of a number of command events or messages which are served by different micro-services asynchronously.
The system is built for high performance and scalability. Provided below are a few mechanisms we implemented to handle performance and scalability requirements:
- Extensive parallelization of processing with the competing consumers pattern, by having multiple parallel running (micro) service instances.
- Independent scaling of processing components, to more flexibly manage needed capacity, and
- Using optimistic locking, to avoid the need for complex distributed locking mechanisms which was a bottleneck in earlier monolithic architecture.
These patterns ensure that design is scalable and industry proven.
Getting Payment Processing Right
mobiquity® core is payment processing which has to be reliable and fault tolerant. The conceptual model of the mobiquity® Payments processing is based on the ideas of double-entry bookkeeping. The Payments Platform inherits three key principles from
double-entry bookkeeping:
- Immutability of transactions (once created, the payment transactions are immutable: if an transaction was created in error, a new corrective transaction needs to be created)
- Auditability of all money movements (reliably stored and cannot be changed)
- Error detection based on the zero-sum principle. Every entry to an account requires a corresponding and opposite entry to a different account.
The processing of a payment transaction results in money movements to and from accounts. The zero-sum principle also originates from the double-entry bookkeeping and zero-proof bookkeeping, and in this context it means that sum of amounts (+ vs -) in each transaction has to be zero. For instance, a typical payment transaction will involve the collection of the money from a customer for a service (e.g., bill payment), paying (disbursement) of a partner (e.g., recharge operator), as well as obtaining a service charge for business. These three entries will constitute a transaction, and the amount of money collected from the customer has to equal the amount of money obtained by partners and businesses.
The zero-sum principle is a simple error detection mechanism, especially useful it in a loosely coupled distributed systems at scale. Processing of the transaction will results in several transactions, each potentially involving integration with different payment service providers and banks. As delays, network, and other failures will unavoidably happen, zero-sum principle provides a solid method to detect if any errors happened.
These principal are achieved with below three main data objects used for
payment processing.
- Entry – describes a single instance of a money movement to or from an entry (a customer, partner or business)
- Account represents the entity in payments, capturing all entries of that entity. The sum of money amounts in the account entries represents its balance
- Transaction – captures the payments for encapsulating all money movements among the involved parties (customers, partners, and businesses)
Achievement:
Today mobiquity® has “next generation event driven” architecture successfully deployed in production and processing over 20 million transaction a day giving same flexibility, scalability and reliability we demanded for. Our engineering teams are able to meet custom requirements without changing core product. Payment processing is more scalable due to optimistic locking and reliable due to zero sum principle in accounting.
This article is also available on Medium via https://medium.com/@mfs.techblog/engineering-the-next-gen-digital-banking-and-payments-platform-5052cd125c72