<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rajat Jain on Medium]]></title>
        <description><![CDATA[Stories by Rajat Jain on Medium]]></description>
        <link>https://medium.com/@j.rajat2000?source=rss-59422fd49497------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*cR7W4LHwsmzuBYdrlKEfgg.png</url>
            <title>Stories by Rajat Jain on Medium</title>
            <link>https://medium.com/@j.rajat2000?source=rss-59422fd49497------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 16:41:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@j.rajat2000/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[One Customer, One ID: Building a No-Code Customer Profile Platform for Airtel Financial Services]]></title>
            <link>https://medium.com/@j.rajat2000/one-customer-one-id-building-a-no-code-customer-profile-platform-for-airtel-financial-services-93894faaec24?source=rss-59422fd49497------2</link>
            <guid isPermaLink="false">https://medium.com/p/93894faaec24</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[financial-services]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[no-code]]></category>
            <category><![CDATA[fintech]]></category>
            <dc:creator><![CDATA[Rajat Jain]]></dc:creator>
            <pubDate>Tue, 13 Oct 2026 17:51:24 GMT</pubDate>
            <atom:updated>2026-10-13T17:51:24.836Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How we replaced the mobile number with a durable customer identity, and let product teams configure customer profiles without writing code.</em></p><h3><strong>The problem: a mobile number is not a customer</strong></h3><p>For a telco, the mobile number is the natural key. For a financial services platform it is a fragile one. Two problems pushed us to rethink identity.</p><p><strong>A mobile number is mutable.</strong> When a customer permanently disconnects, the number can be reallocated to someone else. A financial profile keyed on that number can silently end up attached to a stranger.</p><p><strong>Journeys allowed mismatched data.</strong> In our earlier flows, a user could apply for a financial product on behalf of someone else by entering that person’s basic details. The result was corrupt records, and weak signals for fraud detection.</p><p>Add the fact that each product (credit cards, personal loans, gold loans, insurance and more) captured its own copy of customer details, and we had fragmented, inconsistent data and customers re-typing information they had already given us.</p><p>We needed a single, durable customer identity that every financial services journey could read from and write to. We called it <strong>Unified Customer Management (UCM)</strong>.</p><h3><strong>What UCM does</strong></h3><p>UCM centrally stores customer financial details and shares them across FS products. It identifies each customer with a unique <strong>UCM ID</strong> rather than a phone number and provides:</p><p>1. <strong>Pre-populated journeys.</strong> UCM enriches data from Airtel’s enterprise customer source and previous FS journeys, so returning customers do not start over.</p><p>2. <strong>Cross-platform fraud signals.</strong> A shared UCM ID allows FS and telecom systems to recognise the same person.</p><p>3. <strong>A profile organised into three areas:</strong></p><p>1. Customer profile</p><p>2. Asset information — the products a customer holds</p><p>3. Behavioural information</p><h3><strong>Identity design: visitor first, customer later</strong></h3><p>Customers do not begin with a verified identity, so UCM explicitly models two states.</p><p>· <strong>Visitor.</strong> A person who has started a journey but has not completed onboarding. UCM assigns a system-generated UUID.</p><p>· <strong>Customer.</strong> A person who has completed onboarding with a verified government identifier — PAN, or passport where supported. UCM assigns an ID derived from that identifier.</p><p>Three flows move a person through the system:</p><p>· <strong>Get Customer Profile</strong> checks for duplicates and returns an existing profile to pre-fill the journey.</p><p>· <strong>Initiate UCM</strong> creates a visitor profile when a journey begins.</p><p>· <strong>Convert UCM</strong> converts a visitor into a customer after successful onboarding.</p><p>PAN and passport numbers are stored as <strong>hashes</strong>, with uniqueness constraints preventing duplicate customer records. UCM also records the identifier type, original onboarding journey, and the identifier used.</p><h3><strong>The no-code part: the profile is configuration</strong></h3><p>The key design choice was to configure the profile rather than hard-code it. Each product needs different data: credit cards require employer and income details, personal loans need references and marital status, and future insurance journeys will require other fields. Hard-coding these variations would require a code change and release for every field.</p><p>Instead, the profile is defined by a <strong>configuration schema</strong>, and the configuration answers three questions for every field:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NBaWkJ6OI2KpfZYHSkrrTg.png" /></figure><p>The result is a field-by-journey matrix. Core fields, such as name and date of birth, are mandatory everywhere; specialised fields, such as employer details, are required only where needed. To add a product, teams declare its fields and mandatory rules, which UCM enforces when data is written.</p><p>Teams register the schema through an API as a named, versioned definition with nested groups for personal, income, contact, address, bank, channel, referral, and asset information. They can add fields or change mandatory rules through configuration without redeploying the service.</p><p><strong>What this buys us:</strong></p><ul><li><strong>Faster product launches.</strong> A new journey is mostly a configuration exercise.</li><li><strong>One definition of “customer.”</strong> Validation rules live in one place, so two products cannot disagree about what a valid profile is.</li><li><strong>Safer change.</strong> Versioned schemas let us evolve the profile without breaking journeys that depend on an earlier shape.</li></ul><h3><strong>Architecture at a glance</strong></h3><p>UCM connects FS product-acquisition journeys with their source systems.</p><p>· <strong>FS UCM</strong> is the system of record for financial-profile data and the visitor-to-customer lifecycle.</p><p>· <strong>Enterprise UCM</strong> is Airtel’s customer system for enrichment. In line with regulatory guidance, it excludes certain sensitive data, and FS UCM preserves that boundary.</p><p>· <strong>Product journeys</strong> use a small API set to fetch, initiate, and convert profiles. Downstream processes, including NBFC loan disbursement, reuse the same profile instead of collecting the data again.</p><h3><strong>Data Model</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*yGUiyBUQewWVlwTfB6GCPw.png" /></figure><h3><strong>UCM Schema</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*LrFOBRgVqJ1Sutd26KUnIw.png" /></figure><h3><strong>Client Integration with UCM</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*XIwvcA3lVrWO5IF_9DJoEQ.png" /></figure><h3><strong>Measuring success</strong></h3><p>We defined success through measurable outcomes.</p><ul><li><strong>Customer Uniqueness Efficiency.</strong> The share of records with unique customer attributes (name, date of birth, gender and father’s name). <em>Target: 100%.</em></li><li><strong>Visitor Customer Rate.</strong> The share of records that still hold only a UUID. This tells us how well we convert visitors into customers.</li><li><strong>API success rate</strong> of 99.99%, <strong>API response time</strong> under 200 ms, <strong>mean time to detect</strong> an issue of one hour, and <strong>mean time to repair</strong> of 15 minutes.</li></ul><h3><strong>Migrating existing data</strong></h3><p>The platform is useful only if it includes existing customers. We migrated data for credit cards, loans, gold loans, top-ups, repeat loans, and credit-score records into UCM, handling draft and in-flight records separately from completed ones. The migration used the same deduplication logic as live traffic, merging customers found across products into one UCM identity.</p><h3><strong>Security and business impact</strong></h3><p>Consolidation improves both security and convenience. Policies are applied consistently, auditing and monitoring are centralised, and less data is duplicated across systems. This reduces exposure and speeds incident response by establishing a clear system of record.</p><p>For the business, a single customer database means:</p><ul><li><strong>Data consistency</strong>, because every journey sees the same facts.</li><li><strong>Efficiency</strong>, because customers and agents stop re-entering data.</li><li><strong>Better analytics</strong>, with the whole onboarding funnel in one place.</li><li><strong>Lower cost</strong>, from running one store instead of several overlapping ones.</li><li><strong>Simpler integration</strong> for every new product.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93894faaec24" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Airtel set up system and processes for ensuring Payment Health and Intelligent Routing!]]></title>
            <link>https://medium.com/airteldigital/payment-health-and-intelligent-routing-17dfd17951ce?source=rss-59422fd49497------2</link>
            <guid isPermaLink="false">https://medium.com/p/17dfd17951ce</guid>
            <category><![CDATA[routing]]></category>
            <category><![CDATA[payments]]></category>
            <category><![CDATA[success-rates]]></category>
            <category><![CDATA[payments-solution]]></category>
            <category><![CDATA[payment-systems]]></category>
            <dc:creator><![CDATA[Rajat Jain]]></dc:creator>
            <pubDate>Thu, 21 Jul 2022 11:34:17 GMT</pubDate>
            <atom:updated>2022-07-26T15:28:29.304Z</atom:updated>
            <content:encoded><![CDATA[<p>The business needs to provide their customers option to make payments online. The customers can pay through different payment modes such as</p><ul><li>Net Banking</li><li>Credit Card</li><li>Debit Card</li><li>Wallet</li><li>UPI</li></ul><p>Different payment service providers are present in the industry that provides such integration, they are referred to as payment gateway. Each payment gateway has the capability to enable customers to pay online using any of the banks available in the industry.</p><p>Following is the list of available payment gateways in the industry:</p><ul><li>PayU</li><li>RazorPay</li><li>CCAvenue</li><li>PayTM</li><li>JusPay</li></ul><p>The payment gateways are in turn integrated with different Bank APIs and provide a standard interface to their clients for seamless integration. The business client just needs to contract closures on banks they need to enable on their website for customers making payments.</p><p><strong>Online Payment Flow</strong></p><p>Thus, a simple flow of payments flow will look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BF928y_asl3ZyihULdq5oQ.png" /></figure><p>Albeit, things don’t work as smoothly as they may sound. As you can see there are API integrations across multiple layers i.e. client, payment gateways, and banks. All these layers are deployed on completely different servers and are maintained by different vendors. These services are subjected to the following practical challenges:</p><ul><li>Power outages</li><li>Servers downtime due to maintenance/upgradation</li><li>Data Migration</li></ul><p>Due to these outages, users will not be able to make payments online. Businesses cannot afford such outages, hence comes the concept of redundancy. The client integrates with multiple payment gateways to provide 100% service availability to their customers. For eg: when the user selects HDFC net banking for payment, the client has integration available with both PayU and CCAvenue, the client will decide based on certain parameters which payment gateway will execute the transaction. This selection of payment gateway on certain parameters is called routing.</p><p><strong>Routing Types</strong></p><ol><li><strong>Static Routing </strong>— A fixed percentage of traffic is given to each payment gateway.</li></ol><p>2.<strong> Dynamic Routing </strong>— The percentage of traffic to each payment gateway may vary based on different parameters such as success rate, response time or charges.</p><p>Another aspect of mitigating revenue loss due to bank downtimes is to upfront restrict users to select the bank on the payment options page by clear communication of the downtime. This will enhance the customer experience as he has the knowledge of the current status of bank availability for payment processing, the concept of showing a bank’s health as per payment mode is called a health check.</p><p>We will cover in detail both concepts of the logic behind the calculation of health checks and dynamic routing for maximizing revenue collection for any business.</p><p>Within the context of Airtel, Airtel has different businesses in the market. The different businesses include travel booking, mobile bill payments, and insurance premiums. Each of their business have a separate customer base, let’s term these businesses as LOB (Line of Business). The business owners of each LOB determine what payment modes shall be enabled for their customer base. Also, they can engage with different payment gateways as per their contractual commission for payment collection. Thus, as a payments platform we would need to support the following integration capability:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oKFB5geK9QKdLq-l5M0wIw.png" /></figure><p><strong>PROBLEM STATEMENT</strong></p><p>The goal of each business is as follows:</p><ol><li>100% online payments system availability.</li><li>Maximum success rate of transactions.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*8JfOjZ7FjPyYrbDMC_WwnA.png" /></figure><p><strong>Health of Payment Instrument</strong></p><p>In order to accomplish both goals, we would capture holistic data at the organizational level to determine the health of payment instruments. As we can see, across all businesses of Airtel they are using Net Banking, Credit Card, Debit Card, UPI, and Wallet. Under these payment modes, all banks are also enabled like SBI, HDFC, ICICI, etc. The uptime of these banks are independent of the business of Airtel, meaning if SBI bank is down on PayU PG, it will be down for all 3 LOBs i.e. travel, mobile, and insurance. Thus, essentially Health of any payment instrument is the function of PG, Payment Mode.</p><p>Health (SBI) = fx (PG, Payment Mode)<br> Now how do we determine the health of SBI Net banking on PayU. There are 2 data sources:</p><ol><li><strong>PayU PG Health Check API </strong>— Each PG provides an API that tells the real-time downtime of any bank enabled on their network. We term this as an API Data source.</li><li><strong>Airtel Transaction Data </strong>— Airtel has 3 businesses collecting payments online, they can query their own transaction data to determine whether SBI bank is performing well for their customers in the recent past. If they sense, there is a dip in success rate they can deduce downtime of SBI Bank on PayU PG. There are multiple tools through which you can aggregate the transaction data in time series for the same like Influx. We term this data source INFLUX.</li></ol><p>Thus, now the health of any payment instrument is also a function of the Data Source. Health (SBI) = fx (PG, Payment Mode, Data Source)</p><p><strong>PG Health Check API</strong></p><p>As mentioned, each PG has the capability to provide real-time health of any payment instrument. PGs are able to provide this information as they receive scheduled downtime alerts from the banks, also they are monitoring the performance of banks on their network to deduce real-time health. The different values provided by PG are as follow:</p><ol><li>UP — Transactions will be successful.</li><li>FLUCTUATING — Transaction might fail.</li><li>DOWN — Transaction will fail.</li></ol><p>Sample PayU PG Health Check Response</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*pvhZixeT84zZpj964uiZfA.png" /></figure><p><strong>Airtel Transaction Data</strong></p><p>For Airtel, the greatest advantage is they can capitalize on data from their multiple businesses to determine the health of any bank. The ultimate goal is to maximize success rate and 100% system capability, there could be a use-case when there is no downtime from the bank but due to some faulty code in Airtel Payments Integration, SBI Net Banking is not working for their customers. These system failures can be best detected by health check determination from Airtel&#39;s own transaction data.</p><p>The flow for determining health status is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dmtvs9iq1-YH2utwb3qtng.png" /></figure><p>The user logs onto the recharge portal of Airtel, chooses the recharge amount, and proceeds to the payment page. The user selects SBI Net Banking as his payment option, PayU PG is selected to complete the transaction, the user is redirected to Bank Page and completes the transaction. The transaction is captured in the database as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*LWPxaV2Z4JIHsKHTKLdVSQ.png" /></figure><p>This is one transaction record in the database, Airtel is a huge company we can expect hundreds of such transactions in a minute across different businesses for SBI Net Banking. Thus, as the next step, we aggregate these transactions against time. The aggregation against time is as follows:</p><p>Select count(*) from transactions group by paymentMode, bankCode, PG, paymentStatus, time(1m)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VOyKxIXCDUTrCndM99gPjg.png" /></figure><p>This aggregated data is present in a database tool named index, the health check service queries the influx database to retrieve the data and calculate the success rate and health check in the below format:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*32W-zbv25jBAuszeYBPg4A.png" /></figure><p>We calculate the success rate by taking a weighted average of the success rate at each minute till the last 30 minutes. The intent is to identify the performance degradation in near real-time, hence highest weight is assigned to the time interval closest to the current time. The same is explained with a working example for SBI Net Banking for PayU PG.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B6VptOq-f9ikiEGul6r3Cw.png" /></figure><p>Thus, Avg (SR) = Sum (C )/ Count (C )= (71.42 + 75 + 66.67 + 81.25) / 4 = 73.58</p><p>Wt Avg (SR) = Sum (C*D) / Sum (D) = (71.42 + 150 + 200.01 + 325) / (1 + 2 + 3 + 4) = 74.64</p><p>As you can see, there is a clear difference in the weighted success rate and average success rate for the last 4 minutes. This is due to the fact that SBI peaked at its performance at 81.25% at the last minute i.e. 10:03 AM. Thus, it is imperative that in near real-time the SBI Net Banking is performing well for PayU PG. Hence, the weighted success rate gives a much clearer picture than the normal average.</p><p><strong>Health Determination</strong></p><p>Now we have got the performance metric of SBI Net Banking for PayU PG in the form of a weighted success rate. Next is to interpret health for the same, we do so by comparing success rate against two threshold values namely up threshold and down threshold value.</p><ul><li>UP Threshold — 70 %</li><li>Down Threshold — 30%</li></ul><p>Case 1: Down Health<br> 0 &lt; Weighted SR &lt;= Down Threshold</p><p>Case 2: Fluctuating Health<br> Down Threshold &lt; Weighted SR &lt;= Up Threshold Case 3: Up Health<br> Up Threshold &lt; Weighted SR &lt;= 100</p><p>Thereby, at 10:05 AM for SBI Net Banking at PayU PG, we calculated Weighted SR as 74.64 %. As per scale, it lies under Case 3:</p><p>70 &lt; 74.64 &lt;= 100<br> Hence, health is deduced as UP.</p><p>The calculation of health is done for each minute by considering transactions of the last 30 minutes, this is aided by a scheduler service that timely queries the transaction data.<br>The business team can configure the following artifacts as per their traffic and SLA:</p><ol><li>Count duration of transactions to be considered for calculating weighted success rate.</li><li>Down threshold.</li><li>Up threshold.</li></ol><p>Now, we have the health information of SBI Net Banking on PayU PG across 2 data sources as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rGaKnmRZmOiom3m0kL4sLw.png" /></figure><p>We combine health from both of these sources to deduce final health as follows:</p><ol><li>Use only API Data Source</li><li>Use only Influx Data Source</li><li>Pessimistic Approach — Take AND combination of health across both data source</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7NQauCb9sV1gPB8vavuxVA.png" /></figure><p>4. Optimistic Approach — Take OR combination of health across both data source</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3j1ZYKgSNy6qk1-M_IyreA.png" /></figure><p>The final result of Health (Bank) = fx(PG, Payment Mode, Data Source) is as follow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XJ1mmCysh4m8YZ99lqTZSg.png" /></figure><p>Airtel company now has a huge database of the real-time health status of banks across payment modes and payment gateways. They can predict the bank&#39;s behavior by cashing in on their huge customer base. This data can also be exposed as an external API to be consumed by other businesses.</p><p>Now, moving on to the part wherein Airtel company need to solve its original problem statement:</p><ol><li>100% online payments system availability.</li><li>The maximum success rate of transactions.</li></ol><p><strong>Health Enquiry</strong></p><p>Health inquiry is the concept that ensures 100% online payment systems capability, this is possible by showing health status upfront on payment options to users about real-time health. Thus, if SBI is having downtime, we can disable the payment option thereby allowing users to choose an alternative approach.</p><p>The health of any bank is a function of the LOB, Payment Mode, PG, Routing Value</p><p>Health (SBI) = fx (LOB, Payment Mode, PG, Routing Value)</p><p>The LOB parameter is very critical in determining the health of banking instrument, as we have seen different businesses has contracts with different PGs. Also, it is their prerogative to decide traffic distribution among those PGs, thus we need to factor in the PG routing contribution to calculate the accurate health of the bank for that particular LOB.</p><p>The flow for calculating health for LOB is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E6Wh6YgLGAOnaRBpCpdXLA.png" /></figure><p>The user needs to make payment via SBI Net Banking for his recharge on the Airtel website.</p><p>Let’s fetch health from the master table for SBI Net Banking across all PGs, we give health a numeric value as shown in the table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*NMHQbLKN1Em7vTGzCJmP4A.png" /></figure><p>The next step is to fetch traffic distribution across different PGs for Travel LOB in the case of SBI Net Banking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*LgvO16m3-kmNZePXzPyegA.png" /></figure><p>Now we will marry the health of SBI Net Banking of a PG with their respective value to get consolidated value.</p><p>Health (Bank) = SUM (Health Value (PG) * Routing Value (PG))</p><p>In the above case,</p><p>Health (SBI) = 1*0.5 + 0.5*0.3 + 0*0.2 = 0.65</p><p>Next is to interpret health for the same, we do so by comparing success rate against two threshold values namely up threshold and down threshold value maintained at LOB Level.</p><ul><li>UP Threshold — 70 %</li><li>Down Threshold — 30%</li></ul><p>Case 1: Down Health</p><p>0 &lt; Health Value &lt;= Down Threshold</p><p>Case 2: Fluctuating Health</p><p>Down Threshold &lt; Health Value &lt;= Up Threshold</p><p>Case 3: Up Health</p><p>Up Threshold &lt; Health Value &lt;= 100</p><p>Thereby, for SBI Net Banking for Traffic Lob, we calculated Health Value as 65 %. As per scale, it lies under Case 2:</p><p>0.3 &lt; 0.65 &lt;= 0.7</p><p>Hence, health is deduced as FLUCTUATING.</p><p>Stimulating the algorithm for another use case.<br>The user needs to make payment via SBI Net Banking for his insurance premium on the Airtel website.</p><p>1. Health from Master Table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*MocpV2b0fQnOL5HX4us2hw.png" /></figure><p>2. Traffic distribution of SBI Net Banking for Insurance LOB</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*T-6BPiIlIoLRMEG6DLCVsw.png" /></figure><p>3. Cross of Health Value with Routing Value</p><p>Health (SBI) = 1 * 1.0 = 1</p><p>4. Health Calculation based on threshold</p><p>Routing Value 100</p><p>Thereby, for SBI Net Banking for Traffic Lob, we calculated Health Value as 100 %. As per scale, it lies under Case 3:</p><p>0.7 &lt; 1.0 &lt;= 1.0<br> Hence, health is deduced as UP.</p><p>As you can see that the health of SBI Net Banking differs for different businesses in the same company. For travel customers, their transactions might fail, but for insurance customers, their transactions will be successful. The primary reason is the performance of the same bank might differ on various PGs integrated.</p><p><em>Traffic Sampling</em></p><p>Consider a case when SBI net banking is down across PG. As per the health inquiry on 10 AM Airtel identifies the downtime by analyzing its transaction data. It decides to disable the payment option, to re-enable the same it will analyze traffic performance on 10:05 AM. So, it would need a few transactions to calculate the success rate. Hence, a small sample of 5 % traffic is opened even when SBI Net Banking is down to calculate the success rate iteratively and take further informed decisions. This concept is called traffic sampling.</p><p><strong>Dynamic Routing</strong></p><p>Let’s discuss the critical feature of dynamic routing and the logic of traffic distribution across PG configured against the bank of payment mode for a lob. There are primarily 2 approaches for changing traffic distribution dynamically based on the real-time health of the payment instrument:</p><ol><li>Soft Routing</li><li>Hard Routing</li></ol><p>a. Pessimistic Approach</p><p>b. Optimistic Approach</p><p>Will discuss the algorithm, applicability, limitations, and advantages of these approaches in detail. The main source of data for dynamic routing is Airtel transaction data which is aggregated at the time-series level using the influx tool.</p><p><strong>Soft Routing</strong></p><p>By soft routing, we are shifting traffic from one PG to another in small steps at regular intervals of time. The shifting of traffic is from low-performing PG to high-performing PG.</p><p>The shifting of traffic is gradual and there is an option to configure both step value and time- interval. Also, there is a minimum and maximum threshold up to which traffic can be routed from low-performing PG.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*r1TVfeyQgzhFKbiOfH_UWQ.png" /></figure><p>Now we will stimulate soft routing for SBI Net Banking for LOB on the Airtel website. Let’s fetch the success rate from the master table for SBI Net Banking across all PGs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*UirUAXg2JTU3RkAdt3PjtA.png" /></figure><p>Thus, the PG which is having lowest success rate for SBI Net Banking is RazorPay currently.<br> As we can see both PayU and CCAvenue are performing better than RazorPay, now we will route traffic from RazorPay to PayU and CCAvenue respectively by step values.</p><p>The next step is to fetch traffic distribution across different PGs for Travel LOB in the case of SBI Net Banking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*jEddO-AkRv9Fwf6JO3ZPgQ.png" /></figure><p>For calculating the updated routing value, we rake in the following configuration.</p><p>Step Value = 5<br> The traffic will be transferred from 1 PG to another in chunks of 5%.</p><p>Minimum Threshold = 5<br> No PG can be assigned traffic less than 5%</p><p>Maximum Threshold = 95<br> No PG can be assigned traffic more than 95%</p><p>The algorithm is as follows:</p><ol><li>Routing Value (Low SR PG) = Routing Value (PG) — ((Count of PG — 1) * (Step Value))</li><li>If<br> Routing Value (Low SR PG) &lt; Minimum Threshold</li></ol><p>then break</p><p>3. Else</p><p>Routing Value (Other PG) = Routing Value (PG) + Step Value 4.</p><p>4. If</p><p>Routing Value (Other PG) &gt; Maximum Threshold</p><p>then break</p><p>5. Else</p><p>Repeat Step 4 for the remaining PGs</p><p>Thus, updated routing values are</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*xsC9ifEhAXICJaE7i3WM-Q.png" /></figure><p>Last but not the least, persist the updated values in the database.</p><p>Based on business SLA and traffic, the frequency of dynamic routing can be tuned. For estimation, a user is able to complete the transaction in 2 minutes. Since dynamic routing&#39;s main source of data is transactional data, hence it is recommended to have at least 5 minutes of intervals to capture substantial data across PG for success rate calculation.</p><p>Now we will stimulate another iteration to check the use-case of minimum or maximum threshold violation. Let’s see the data after 5 minutes of the routing update.</p><p>Success Rate of SBI Net Banking across PG.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*hauWOtRscptfJRJlZbmTCg.png" /></figure><p>As we can see, post routing update, the success rate of PayU and RazorPay increased but CCAvenue has maintained its success rate. As per the algorithm, RazorPay still qualifies for soft routing having the least success rate among all PG.</p><p>The traffic distribution is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*5ui199bhMJi8B56R9eg-BA.png" /></figure><p>Let’s calculate the updated values using step value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x6mBMx3uSolQ3OmDeqlAtA.png" /></figure><p>As we can, see post calculation the traffic assigned to RazorPay is 0 % which is lower than the minimum threshold, so we shall not update the routing for this iteration. The reason for the same is that the source of the dynamic routing update is Airtel transaction data, thus we need some transactions at each PG to calculate the Success Rate. Hence, in a time interval of 5 minutes, we route at least 5 % traffic even to the lowest performer PG, so that the same can compete with better performing PG in the next iteration.</p><p><strong>Hard Routing</strong></p><p>Soft routing does the routing update of traffic distribution gradually. With a time interval of 5 minutes and a step value of 5%, it may take up to 30 minutes before maximum traffic is routed to the best-performing PG. It might be cases when a particular PG has crashed suddenly, then there is a use-case to shift the entire traffic from the PG to another PG. This concept of bulk shifting the traffic from 1 PG to another PG is called hard routing. There are 2 approaches to implementing hard routing, will discuss them in detail.</p><p><em>Pessimistic Approach</em></p><p>The pessimistic approach is the use-case wherein a PG has crashed suddenly and its traffic is routed to another better-performing PG. In this case, we are trying to minimize the damage by phasing out crashed PG, but the traffic diverted is equally distributed among other PG which might not yield the best success rate. The flow for the same is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*89PRQXeWWC-Ahte51lHE7g.png" /></figure><p>Now we will stimulate pessimistic hard routing for SBI Net Banking for LOB on the Airtel website. Let’s fetch the success rate from the master table for SBI Net Banking across all PGs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B0pA15SWsoYDCj9PY-3j5w.png" /></figure><p>Thus, as per the success rate calculation, we can see PayU PG has a success rate of only 3% which is less than the minimum threshold. It is imperative that PayU PG thereby making it eligible for hard routing. We will divert all traffic from PayU PG to other better-performing PG.</p><p>The next step is to fetch traffic distribution across different PGs for Travel LOB in the case of SBI Net Banking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*4bfuAHKKqreyTzwkGE91TA.png" /></figure><p>For calculating the updated routing value, we rake in the following configuration.</p><p>Minimum Threshold = 5<br> No PG can be assigned traffic less than 5%</p><p>Maximum Threshold = 95<br> No PG can be assigned traffic more than 95%</p><p>The algorithm is as follows:</p><ol><li>Traffic to Be Routed = Routing Value (Low SR PG) — Minimum Threshold</li><li>Routing Value (Low SR PG) = Minimum Threshold</li><li>Step Value = Traffic to Be Routed / (Count of PG — 1)</li><li>Routing Value (Other PG) = Routing Value (PG) + Step Value</li></ol><p>5. Repeat Step 4 for remaining PGs</p><p>Thus, updated routing values are</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*q7hrASZ4PVAcKctmAY7eHg.png" /></figure><p>Last but not the least, persist the updated values in the database.</p><p>Thus, as you can see although we have saved our system from crashing by routing traffic from PayU to other PGs, the traffic is split equally between CCAvenue and RazorPay even though CCAvenue has a higher success rate. This is a limitation of pessimistic hard routing as the maximum success rate is not achieved. To overcome this limitation, optimistic hard routing is implemented.</p><p><em>Optimistic Approach</em></p><p>The optimistic approach is the use-case wherein maximum traffic is routed to PG with the highest success rate. All other PGs will have traffic of minimum threshold. This will also cater to the cases wherein PG has crashed suddenly and also the success rate is maximized. The flow for the same is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*3E86lAG2Z-LJacKEvbPjvw.png" /></figure><p>Now we will stimulate pessimistic hard routing for SBI Net Banking for LOB on the Airtel website. Let’s fetch the success rate from the master table for SBI Net Banking across all PGs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*43_dB-L_W7xzu9P1NyJb2Q.png" /></figure><p>Thus, as per the success rate calculation, we can see that CCAvenue PG has the highest success rate of 68%. It is imperative that CCAvenue PG should have maximum traffic. We will divert all traffic to CCAvenue PG.</p><p>The next step is to fetch traffic distribution across different PGs for Travel LOB in the case of SBI Net Banking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*gaBoQ2gg36ciKnWpt4OD9g.png" /></figure><p>For calculating the updated routing value, we rake in the following configuration.</p><p>Minimum Threshold = 5<br> No PG can be assigned traffic less than 5%</p><p>Maximum Threshold = 80<br> No PG can be assigned traffic more than 95%</p><p>The algorithm is as follows:</p><ol><li>Routing Value (Highest SR PG) = Maximum Threshold</li><li>Step Value = 100 — Maximum Threshold / (Count of PG — 1)</li><li>Routing Value (Other PG) = Step Value</li><li>Repeat Step 3 for the remaining PGs</li></ol><p>Thus, updated routing values are</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T5nNgs8k4A6YhK3puiwdmQ.png" /></figure><p>Last but not the least, persist the updated values in the database.</p><p><strong>Comparative Analysis</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*lvGsjbCZNaj8x9ZuJ_2jqg.png" /></figure><p>As we can see each dynamic routing approach has its own set of pros and cons. Thus, the incorporation of the approach is subjected to the business requirements.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17dfd17951ce" width="1" height="1" alt=""><hr><p><a href="https://medium.com/airteldigital/payment-health-and-intelligent-routing-17dfd17951ce">How Airtel set up system and processes for ensuring Payment Health and Intelligent Routing!</a> was originally published in <a href="https://medium.com/airteldigital">Airtel Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>