<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Eunice Adediran</title>
    <description>The latest articles on DEV Community by Eunice Adediran (@euniceexplains).</description>
    <link>https://dev.to/euniceexplains</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F910736%2F60fe6048-39d2-41e2-a2db-481f09006444.png</url>
      <title>DEV Community: Eunice Adediran</title>
      <link>https://dev.to/euniceexplains</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/euniceexplains"/>
    <language>en</language>
    <item>
      <title>You Dial a USSD Code. How Does Your Bank Receive It Without Internet?</title>
      <dc:creator>Eunice Adediran</dc:creator>
      <pubDate>Sun, 22 Nov 2026 09:00:00 +0000</pubDate>
      <link>https://dev.to/euniceexplains/you-dial-a-ussd-code-how-does-your-bank-receive-it-without-internet-16k5</link>
      <guid>https://dev.to/euniceexplains/you-dial-a-ussd-code-how-does-your-bank-receive-it-without-internet-16k5</guid>
      <description>&lt;p&gt;&lt;em&gt;Inside the telecommunications networks, SS7 signalling, USSD gateways, aggregators, banking APIs and systems behind everyday transactions.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Your phone has no mobile data, and you urgently need to make a call.&lt;/p&gt;

&lt;p&gt;So, you dial your bank's USSD code, select &lt;strong&gt;Buy Airtime&lt;/strong&gt;, enter ₦1,000 and confirm the purchase.&lt;/p&gt;

&lt;p&gt;A few seconds later, your bank account is debited, and your airtime balance increases.&lt;/p&gt;

&lt;p&gt;Nothing unusual, right?&lt;/p&gt;

&lt;p&gt;But here's something interesting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your SIM belongs to a telecommunications company, not your bank. So how does your bank even know you dialled that code?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your mobile network operator doesn't maintain your bank balance. Your bank doesn't own the telecommunications network. And the company responsible for delivering your airtime isn't necessarily the same company processing your payment.&lt;/p&gt;

&lt;p&gt;Yet somehow, all these systems communicate to complete your transaction.&lt;/p&gt;

&lt;p&gt;Banks such as GTBank, Access Bank, UBA and FirstBank offer USSD banking through different service codes, even though their customers may use the same mobile networks.&lt;/p&gt;

&lt;p&gt;So how does a mobile operator know which bank should receive your request?&lt;/p&gt;

&lt;p&gt;Does your phone communicate directly with the bank?&lt;/p&gt;

&lt;p&gt;What happens inside the telecom network?&lt;/p&gt;

&lt;p&gt;And what exactly are SS7, MAP, MSC, HLR, MSISDN and USSD aggregators?&lt;/p&gt;

&lt;p&gt;Let's follow a typical ₦1,000 airtime purchase from your phone through the telecommunications network, into the banking infrastructure and finally to the system that delivers your airtime.&lt;/p&gt;

&lt;p&gt;We'll also explore what happens when your account is debited but the airtime never arrives.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. First, What Exactly Is USSD?
&lt;/h2&gt;

&lt;p&gt;USSD stands for &lt;strong&gt;Unstructured Supplementary Service Data&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It's a telecommunications protocol that allows mobile phones to exchange interactive messages with service applications through a mobile network.&lt;/p&gt;

&lt;p&gt;Unlike a conventional mobile banking application, which typically communicates with the bank over HTTPS using an internet connection, USSD uses the mobile network's service and signalling infrastructure.&lt;/p&gt;

&lt;p&gt;That's why you can use supported USSD services without an active mobile data subscription.&lt;/p&gt;

&lt;p&gt;You don't even need a smartphone. A basic feature phone can access them.&lt;/p&gt;

&lt;p&gt;You've probably used USSD to check your airtime balance, purchase data, transfer money, check an account balance or pay a bill.&lt;/p&gt;

&lt;p&gt;One important characteristic of USSD is that &lt;strong&gt;it's session-based&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When you dial a USSD code, the network establishes an interactive session.&lt;/p&gt;

&lt;p&gt;For example, a simplified banking menu might look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Welcome to USSD Banking

1. Transfer Money
2. Buy Airtime
3. Check Balance
4. Other Services
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You select &lt;code&gt;2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Another screen appears:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Buy Airtime

1. For Yourself
2. For Another Number
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You select an option, enter an amount and complete any required authentication.&lt;/p&gt;

&lt;p&gt;The interaction continues within the same USSD session until it finishes, you exit, or the session times out.&lt;/p&gt;

&lt;p&gt;Unlike SMS, which uses a store-and-forward messaging model, USSD is designed for interactive communication.&lt;/p&gt;

&lt;p&gt;But here's the important distinction:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;USSD doesn't know how to transfer money or purchase airtime. It only provides the communication channel.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The actual banking functionality exists in applications and backend systems connected to that channel.&lt;/p&gt;

&lt;p&gt;To understand how those applications receive your request, we need to look inside the telecommunications network.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. How Does Each Bank Have Its Own USSD Code?
&lt;/h2&gt;

&lt;p&gt;You may have encountered codes such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;*737#&lt;/code&gt; — GTBank&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;*901#&lt;/code&gt; — Access Bank&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;*919#&lt;/code&gt; — UBA&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;*894#&lt;/code&gt; — FirstBank&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are examples of banking service codes, not separate telecommunications networks.&lt;/p&gt;

&lt;p&gt;A USSD code acts as a service identifier within the mobile network's configured routing environment.&lt;/p&gt;

&lt;p&gt;For a financial institution to offer USSD banking, the necessary regulatory, technical and commercial arrangements must be established.&lt;/p&gt;

&lt;p&gt;In Nigeria, the Nigerian Communications Commission (NCC) regulates the telecommunications environment, including applicable short-code arrangements.&lt;/p&gt;

&lt;p&gt;The Central Bank of Nigeria (CBN) regulates the financial-services aspects.&lt;/p&gt;

&lt;p&gt;Once a code is provisioned for a participating service, the relevant mobile operators configure how requests for that code reach the appropriate destination.&lt;/p&gt;

&lt;p&gt;When a customer on MTN dials a banking USSD code, MTN's network routes the request according to its service configuration.&lt;/p&gt;

&lt;p&gt;When an Airtel customer dials the same code, Airtel's network needs a corresponding routing arrangement.&lt;/p&gt;

&lt;p&gt;Both customers may eventually reach the same bank's USSD application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The bank operates the banking service; the participating mobile networks provide the access channel.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But what does the request encounter before reaching the bank?&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Inside the Telecom Network: SIM, MSISDN and IMSI
&lt;/h2&gt;

&lt;p&gt;Let's start with three terms that are often used interchangeably but mean different things.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a telco or MNO?
&lt;/h3&gt;

&lt;p&gt;A &lt;em&gt;telco&lt;/em&gt; is a telecommunications company.&lt;/p&gt;

&lt;p&gt;An &lt;strong&gt;MNO&lt;/strong&gt;, or Mobile Network Operator, operates a mobile network and provides connectivity to subscribers.&lt;/p&gt;

&lt;p&gt;Examples in Nigeria include MTN, Airtel and Glo.&lt;/p&gt;

&lt;p&gt;An MNO operates infrastructure such as radio access networks, mobile core systems and subscriber-management services.&lt;/p&gt;

&lt;p&gt;When you dial a USSD code, the request first enters the telecommunications infrastructure serving your mobile subscription.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a SIM?
&lt;/h3&gt;

&lt;p&gt;SIM stands for &lt;strong&gt;Subscriber Identity Module&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It stores information and security credentials associated with your mobile subscription.&lt;/p&gt;

&lt;p&gt;The mobile operator uses subscriber authentication mechanisms to establish whether the subscription is authorised to access its network.&lt;/p&gt;

&lt;p&gt;But your SIM, IMSI and MSISDN are not the same thing.&lt;/p&gt;

&lt;h3&gt;
  
  
  IMSI — International Mobile Subscriber Identity
&lt;/h3&gt;

&lt;p&gt;The IMSI identifies a mobile subscription within the telecommunications environment.&lt;/p&gt;

&lt;p&gt;It's used by mobile-network systems for subscriber identification and related operations.&lt;/p&gt;

&lt;h3&gt;
  
  
  MSISDN — Mobile Station International Subscriber Directory Number
&lt;/h3&gt;

&lt;p&gt;The MSISDN is the telephone number associated with the mobile subscription.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MSISDN: +23480XXXXXXXX
IMSI:   62130XXXXXXXXXX
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are fictional values for illustration.&lt;/p&gt;

&lt;p&gt;Why does the distinction matter?&lt;/p&gt;

&lt;p&gt;When you register a telephone number with your bank, the bank can associate that number with your customer profile.&lt;/p&gt;

&lt;p&gt;During a USSD interaction, the appropriate telecom integration may supply the subscriber's MSISDN to the banking service.&lt;/p&gt;

&lt;p&gt;The bank can use it to identify the associated customer relationship.&lt;/p&gt;

&lt;p&gt;However, knowing the mobile number isn't sufficient proof that the legitimate account holder initiated the transaction.&lt;/p&gt;

&lt;p&gt;This is especially relevant to SIM-swap fraud.&lt;/p&gt;

&lt;p&gt;A malicious actor might gain control of a registered phone number without being the rightful bank customer.&lt;/p&gt;

&lt;p&gt;This is why banks require appropriate authentication and fraud-prevention controls in addition to phone-number identification.&lt;/p&gt;

&lt;p&gt;The IMSI can be relevant to telecom-side security and risk assessments, but the bank doesn't ordinarily need to receive it simply to display a USSD menu.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. What Are the MSC and HLR?
&lt;/h2&gt;

&lt;p&gt;Now let's follow the request deeper into the telecom network.&lt;/p&gt;

&lt;p&gt;Traditional GSM and UMTS mobile networks use several components to control services and exchange signalling information.&lt;/p&gt;

&lt;p&gt;Two useful examples are the MSC and HLR.&lt;/p&gt;

&lt;h3&gt;
  
  
  MSC — Mobile Switching Centre
&lt;/h3&gt;

&lt;p&gt;An MSC is a control and switching component in traditional mobile core networks.&lt;/p&gt;

&lt;p&gt;It participates in circuit-switched service management and associated signalling.&lt;/p&gt;

&lt;p&gt;In a traditional GSM/UMTS USSD implementation, the serving MSC can participate in processing and routing the subscriber's USSD request.&lt;/p&gt;

&lt;p&gt;It doesn't need to know anything about the customer's bank balance.&lt;/p&gt;

&lt;p&gt;Its responsibility is within the telecom domain.&lt;/p&gt;

&lt;h3&gt;
  
  
  HLR — Home Location Register
&lt;/h3&gt;

&lt;p&gt;The HLR is a traditional mobile-network subscriber database.&lt;/p&gt;

&lt;p&gt;It stores subscription-related information and supports relevant routing, mobility and service procedures.&lt;/p&gt;

&lt;p&gt;Depending on the USSD procedure and implementation, the HLR can participate in reaching the appropriate service functionality.&lt;/p&gt;

&lt;p&gt;An important detail: the request doesn't necessarily travel through these components in one fixed linear sequence.&lt;/p&gt;

&lt;p&gt;Different USSD procedures and mobile-network implementations use different signalling paths.&lt;/p&gt;

&lt;p&gt;The key point is that telecom systems process and route your USSD interaction before the banking application becomes involved.&lt;/p&gt;

&lt;p&gt;And those systems need protocols to exchange signalling messages.&lt;/p&gt;

&lt;p&gt;One of the most important is SS7.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. What Exactly Is SS7, and Why Is It Important?
&lt;/h2&gt;

&lt;p&gt;SS7 stands for &lt;strong&gt;Signalling System No. 7&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It's a family of telecommunications signalling protocols used to exchange control information between network systems.&lt;/p&gt;

&lt;p&gt;Think about what happens when you make a phone call.&lt;/p&gt;

&lt;p&gt;The network needs to identify the destination, determine routing information and coordinate the relevant connection procedures.&lt;/p&gt;

&lt;p&gt;These activities require signalling messages.&lt;/p&gt;

&lt;p&gt;In traditional mobile networks, SS7 provides infrastructure for exchanging signalling information among network components.&lt;/p&gt;

&lt;p&gt;For USSD, another protocol is particularly important.&lt;/p&gt;

&lt;h3&gt;
  
  
  MAP — Mobile Application Part
&lt;/h3&gt;

&lt;p&gt;MAP stands for &lt;strong&gt;Mobile Application Part&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It's an application-layer signalling protocol used by traditional mobile core networks.&lt;/p&gt;

&lt;p&gt;MAP supports operations relating to subscriber management, mobility, SMS and USSD.&lt;/p&gt;

&lt;p&gt;For traditional USSD, MAP defines procedures for exchanging requests and responses between relevant network components.&lt;/p&gt;

&lt;p&gt;A conceptual view looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Mobile Phone
     |
Radio Access Network
     |
Traditional Mobile Core
     |
SS7 / MAP Signalling
     |
USSD Service Infrastructure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a simplified representation, not a complete protocol trace.&lt;/p&gt;

&lt;h3&gt;
  
  
  How is SS7 different from HTTP?
&lt;/h3&gt;

&lt;p&gt;When you open a banking app, your phone may communicate with the bank through HTTPS over an internet connection.&lt;/p&gt;

&lt;p&gt;A request could look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="no"&gt;GET&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;accounts&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;balance&lt;/span&gt;
&lt;span class="nc"&gt;Authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Bearer&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A traditional USSD request doesn't originate as that type of HTTP request from your phone.&lt;/p&gt;

&lt;p&gt;It uses the telecommunications network's USSD signalling procedures.&lt;/p&gt;

&lt;p&gt;A USSD gateway or integration platform can then expose that interaction to the bank through an application-facing API.&lt;/p&gt;

&lt;p&gt;This is how a developer can build a USSD banking application without implementing SS7 directly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does every USSD request use SS7?
&lt;/h3&gt;

&lt;p&gt;Not necessarily.&lt;/p&gt;

&lt;p&gt;Traditional GSM/UMTS USSD is closely associated with SS7 and MAP.&lt;/p&gt;

&lt;p&gt;However, modern telecommunications networks may support USSD through IMS-based mechanisms or through interworking with traditional infrastructure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IMS&lt;/strong&gt; stands for &lt;em&gt;IP Multimedia Subsystem&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;It's an architecture used to provide communications services over IP-based networks.&lt;/p&gt;

&lt;p&gt;3GPP specifies procedures for USSD using IMS, so we shouldn't assume every modern 4G or 5G USSD request follows the exact same traditional SS7 path.&lt;/p&gt;

&lt;p&gt;One important clarification: saying that USSD works &lt;em&gt;without internet&lt;/em&gt; means the customer doesn't need a normal mobile internet data connection. It doesn't mean that the operator's backend never uses IP networking.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. The USSD Gateway: Where Telecom Meets Software
&lt;/h2&gt;

&lt;p&gt;So far, our request is still within the telecommunications environment.&lt;/p&gt;

&lt;p&gt;How does it reach the banking application?&lt;/p&gt;

&lt;p&gt;Through the configured USSD service infrastructure, which may include a &lt;strong&gt;USSD gateway&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A gateway bridges telecom-facing USSD mechanisms and application-facing integrations.&lt;/p&gt;

&lt;p&gt;In a traditional arrangement, it may receive USSD operations through telecom signalling and communicate with backend applications using HTTP, HTTPS or another supported interface.&lt;/p&gt;

&lt;p&gt;Conceptually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Telecommunications Network
           |
       SS7 / MAP
           |
      USSD Gateway
           |
       HTTPS API
           |
    Banking Application
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The actual arrangement varies.&lt;/p&gt;

&lt;p&gt;The gateway or integration platform may handle service routing, session identifiers, input delivery, response formatting and session termination.&lt;/p&gt;

&lt;p&gt;For example, when a customer selects option &lt;code&gt;2&lt;/code&gt; from a menu, an integration platform might send an illustrative callback such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="no"&gt;POST&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ussd&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;callback&lt;/span&gt;
&lt;span class="nc"&gt;Content&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"sessionId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"SESSION-12345"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"serviceCode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"*123#"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"phoneNumber"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"23480XXXXXXXX"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a fictional API contract, not an actual bank's endpoint.&lt;/p&gt;

&lt;p&gt;The backend interprets &lt;code&gt;2&lt;/code&gt; according to the customer's current menu state.&lt;/p&gt;

&lt;p&gt;It may then return a response asking for the next input.&lt;/p&gt;

&lt;p&gt;The platform delivers that response through the USSD channel to the phone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The gateway is one of the components that allows a telecom interaction to become an application request.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Where Do USSD Aggregators Come In?
&lt;/h2&gt;

&lt;p&gt;Now we reach one of the most important actors.&lt;/p&gt;

&lt;p&gt;The aggregator.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;USSD aggregator&lt;/strong&gt; is a provider that helps businesses connect their applications to supported telecommunications networks.&lt;/p&gt;

&lt;p&gt;These providers often operate in the broader &lt;strong&gt;Value Added Services (VAS)&lt;/strong&gt; ecosystem.&lt;/p&gt;

&lt;p&gt;Examples of organisations offering services in the broader USSD and telecom integration market include Qrios, VAS2Nets, Africa's Talking and Interconnect Clearinghouse Nigeria.&lt;/p&gt;

&lt;p&gt;Their capabilities, supported markets and commercial arrangements differ. These are industry examples, not endorsements.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why are aggregators useful?
&lt;/h3&gt;

&lt;p&gt;Imagine you're building a fintech application.&lt;/p&gt;

&lt;p&gt;You want customers on MTN, Airtel and Glo to access your service through USSD.&lt;/p&gt;

&lt;p&gt;You could establish direct integrations with participating operators, subject to the required arrangements.&lt;/p&gt;

&lt;p&gt;But this may involve maintaining several connections with different technical specifications, operational procedures and security requirements.&lt;/p&gt;

&lt;p&gt;An aggregator can simplify the integration by providing a common interface to its supported networks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     MTN       Airtel       Glo
      |           |         |
      +-----------+---------+
                  |
           USSD Aggregator
                  |
              HTTPS API
                  |
           Your Application
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The aggregator may handle supported operator connectivity, USSD application routing, callback delivery, session management, monitoring and related services.&lt;/p&gt;

&lt;p&gt;For a real example of how developers interact with such platforms, Qrios publicly documents USSD application registration and application-facing integrations.&lt;/p&gt;

&lt;p&gt;Interconnect Clearinghouse Nigeria also describes its VAS aggregation model as reducing the need for providers to maintain separate connections to multiple mobile operators.&lt;/p&gt;

&lt;p&gt;But there's a distinction worth remembering.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A USSD aggregator isn't necessarily a payment processor or airtime vending provider.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One service helps deliver the customer's interaction.&lt;/p&gt;

&lt;p&gt;Another processes financial operations.&lt;/p&gt;

&lt;p&gt;Another handles airtime or digital-product fulfilment.&lt;/p&gt;

&lt;p&gt;One company may offer multiple services, but the underlying functions are different.&lt;/p&gt;

&lt;p&gt;Also, not every bank uses a third-party USSD aggregator. Some may maintain direct telecom integrations.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Let's Follow the Complete ₦1,000 Airtime Purchase
&lt;/h2&gt;

&lt;p&gt;Now that we understand the telecom side, let's connect everything to the banking infrastructure.&lt;/p&gt;

&lt;p&gt;Suppose you have ₦15,000 in your bank account.&lt;/p&gt;

&lt;p&gt;You're using an MTN SIM.&lt;/p&gt;

&lt;p&gt;You dial your bank's USSD code, select &lt;em&gt;Buy Airtime&lt;/em&gt;, enter ₦1,000 and authorise the purchase.&lt;/p&gt;

&lt;p&gt;Here's the logical architecture:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CUSTOMER'S PHONE
       |
       | Initiates USSD session
       v
MOBILE NETWORK OPERATOR
       |
       | Telecom signalling
       | Traditional SS7/MAP or
       | another supported mechanism
       v
USSD GATEWAY
       |
       v
USSD AGGREGATOR (IF USED)
       |
       | Application integration
       v
BANK'S USSD APPLICATION
       |
       +--&amp;gt; Customer Identification
       |
       +--&amp;gt; Authentication &amp;amp; Risk Checks
       |
       v
TRANSACTION ORCHESTRATION
       |
       +--&amp;gt; Core Banking / Ledger
       |
       v
AIRTIME VENDING INTEGRATION
       |
       v
MOBILE OPERATOR RECHARGE SYSTEM
       |
       v
AIRTIME CREDITED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is an illustrative architecture. It doesn't represent the actual internal implementation of any named bank.&lt;/p&gt;

&lt;p&gt;Let's walk through the stages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage 1: The request reaches the mobile network
&lt;/h3&gt;

&lt;p&gt;Your phone initiates a USSD session.&lt;/p&gt;

&lt;p&gt;The participating operator handles the signalling interaction and determines how to route it based on the requested service.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage 2: The USSD service receives the interaction
&lt;/h3&gt;

&lt;p&gt;The gateway or other service infrastructure routes the interaction to the configured destination.&lt;/p&gt;

&lt;p&gt;An aggregator may be involved, depending on the arrangement.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage 3: The bank receives the request
&lt;/h3&gt;

&lt;p&gt;The banking application receives the session context.&lt;/p&gt;

&lt;p&gt;It can identify the associated customer using appropriate subscription information, including the provided phone number.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage 4: Authentication and risk checks
&lt;/h3&gt;

&lt;p&gt;The bank applies the authentication and financial controls required for the operation.&lt;/p&gt;

&lt;p&gt;These might include transaction PIN validation, account eligibility checks, transaction limits and fraud monitoring.&lt;/p&gt;

&lt;p&gt;The customer's phone number alone shouldn't be treated as sufficient proof of authorisation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage 5: Financial processing
&lt;/h3&gt;

&lt;p&gt;The USSD application invokes the relevant banking services.&lt;/p&gt;

&lt;p&gt;These services coordinate the account operation and maintain the financial transaction record.&lt;/p&gt;

&lt;p&gt;Depending on the implementation, the bank may authorise or reserve funds, or post a debit as part of a controlled transaction workflow.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage 6: Airtime fulfilment
&lt;/h3&gt;

&lt;p&gt;The banking application or transaction orchestration service communicates with the selected airtime vending integration.&lt;/p&gt;

&lt;p&gt;A fictional request could look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="no"&gt;POST&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;v1&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;airtime&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;recharge&lt;/span&gt;
&lt;span class="nc"&gt;Authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Bearer&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;access&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nc"&gt;Content&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"transactionReference"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"AIR-001234"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"network"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"MTN"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"phoneNumber"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"080XXXXXXXX"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"amount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"currency"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"NGN"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The vending provider uses the relevant operator integration to request fulfilment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage 7: The airtime is credited
&lt;/h3&gt;

&lt;p&gt;The mobile operator's recharge or charging infrastructure processes the instruction.&lt;/p&gt;

&lt;p&gt;If successful, it credits the subscriber's airtime balance.&lt;/p&gt;

&lt;p&gt;The result travels back through the fulfilment path.&lt;/p&gt;

&lt;p&gt;The bank records the transaction outcome, and the customer may receive confirmation through the USSD session or another notification channel.&lt;/p&gt;

&lt;p&gt;What appeared to be one simple transaction actually involved multiple independent systems.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. How Does the Bank's Application Know Which Menu You're On?
&lt;/h2&gt;

&lt;p&gt;There's another interesting engineering problem.&lt;/p&gt;

&lt;p&gt;Suppose the customer selects &lt;em&gt;Buy Airtime&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The next input might be the amount.&lt;/p&gt;

&lt;p&gt;How does the application know that &lt;code&gt;1000&lt;/code&gt; means ₦1,000 rather than another menu option?&lt;/p&gt;

&lt;p&gt;It needs &lt;strong&gt;session state&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A backend may track information such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"sessionId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"SESSION-12345"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"currentStep"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"ENTER_AIRTIME_AMOUNT"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"authenticated"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a simplified example.&lt;/p&gt;

&lt;p&gt;Real implementations must securely manage session identity, authentication context, expiration and transaction state.&lt;/p&gt;

&lt;p&gt;The application should also handle invalid selections, repeated callbacks and sessions that expire midway through a transaction.&lt;/p&gt;

&lt;p&gt;The important point is that a USSD application isn't just a collection of text menus.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It's a stateful application operating over a time-constrained communication channel.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  10. Why Doesn't the Bank Simply Credit the Airtime Itself?
&lt;/h2&gt;

&lt;p&gt;Because the bank account and telecom airtime balance exist in different environments.&lt;/p&gt;

&lt;p&gt;The bank manages the customer's financial account.&lt;/p&gt;

&lt;p&gt;The mobile operator manages the subscriber's airtime entitlement.&lt;/p&gt;

&lt;p&gt;The bank may coordinate the financial purchase through its &lt;strong&gt;Core Banking System (CBS)&lt;/strong&gt; and other financial processing services.&lt;/p&gt;

&lt;p&gt;The airtime provider or operator then fulfils the purchase.&lt;/p&gt;

&lt;p&gt;For this reason, there are two related journeys.&lt;/p&gt;

&lt;h3&gt;
  
  
  Communication journey
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Phone
  |
Mobile Network
  |
USSD Gateway / Aggregator
  |
Banking Application
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Transaction and fulfilment journey
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Banking Application
       |
Financial Processing / CBS
       |
Airtime Vending Provider
       |
Mobile Operator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first delivers the customer's instructions.&lt;/p&gt;

&lt;p&gt;The second performs the financial operation and delivers the purchased service.&lt;/p&gt;

&lt;p&gt;And because these journeys involve independent systems, failures can happen at different points.&lt;/p&gt;




&lt;h2&gt;
  
  
  11. What Happens If You're Debited but Don't Receive Airtime?
&lt;/h2&gt;

&lt;p&gt;You've probably experienced something similar.&lt;/p&gt;

&lt;p&gt;You purchase airtime.&lt;/p&gt;

&lt;p&gt;Your bank account is debited.&lt;/p&gt;

&lt;p&gt;But the airtime doesn't arrive.&lt;/p&gt;

&lt;p&gt;You wait.&lt;/p&gt;

&lt;p&gt;Nothing.&lt;/p&gt;

&lt;p&gt;From an engineering perspective, this is a classic &lt;strong&gt;distributed transaction problem&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Imagine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer authorises purchase
           |
Bank records debit
           |
Recharge request submitted
           |
Operator processes recharge
           |
Response is lost
           |
Bank receives timeout
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The mobile operator might have successfully delivered the airtime, even though the bank didn't receive confirmation.&lt;/p&gt;

&lt;p&gt;Alternatively, the recharge might actually have failed.&lt;/p&gt;

&lt;p&gt;A timeout alone cannot establish which outcome occurred.&lt;/p&gt;

&lt;p&gt;That's why these systems need mechanisms for managing uncertainty.&lt;/p&gt;

&lt;h3&gt;
  
  
  Transaction states
&lt;/h3&gt;

&lt;p&gt;A system may track statuses such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATED
   |
VALIDATED
   |
PROCESSING
   |
   +--&amp;gt; SUCCESSFUL
   |
   +--&amp;gt; FAILED
   |
   +--&amp;gt; PENDING
           |
           +--&amp;gt; SUCCESSFUL
           |
           +--&amp;gt; FAILED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Real systems may also have separate financial posting, fulfilment and reversal states.&lt;/p&gt;

&lt;h3&gt;
  
  
  Idempotency
&lt;/h3&gt;

&lt;p&gt;Idempotency helps prevent multiple executions of the same intended transaction.&lt;/p&gt;

&lt;p&gt;Suppose the bank submits a recharge request, but the response times out.&lt;/p&gt;

&lt;p&gt;If it blindly retries, the request might be processed twice.&lt;/p&gt;

&lt;p&gt;With effective idempotency, the receiving system can recognise repeated attempts associated with the same operation.&lt;/p&gt;

&lt;p&gt;For example, the retry might preserve the original transaction reference.&lt;/p&gt;

&lt;p&gt;However, using the same reference doesn't automatically guarantee duplicate protection. The relevant provider and downstream systems need to enforce the appropriate behaviour.&lt;/p&gt;

&lt;h3&gt;
  
  
  Status enquiries
&lt;/h3&gt;

&lt;p&gt;Instead of assuming failure, the bank may query the original transaction status.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="no"&gt;GET&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;v1&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;transactions&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="no"&gt;AIR&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;001234&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A fictional response could be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"transactionReference"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"AIR-001234"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"PENDING"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Awaiting fulfilment confirmation"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A pending result means the final outcome remains uncertain.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reconciliation
&lt;/h3&gt;

&lt;p&gt;Reconciliation compares transaction records held by the relevant parties.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;System&lt;/th&gt;
&lt;th&gt;Recorded outcome&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Bank&lt;/td&gt;
&lt;td&gt;₦1,000 debited&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Airtime provider&lt;/td&gt;
&lt;td&gt;Pending&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mobile operator&lt;/td&gt;
&lt;td&gt;Recharge successful&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The systems need to establish a consistent final outcome.&lt;/p&gt;

&lt;p&gt;Reconciliation may involve comparing transaction references, timestamps, amounts, provider records and financial postings.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reversals and compensation
&lt;/h3&gt;

&lt;p&gt;If airtime fulfilment definitively fails after a debit, the bank may need to reverse the debit or perform another financial correction.&lt;/p&gt;

&lt;p&gt;Because the participants are separate systems, the entire operation cannot necessarily be undone through one database rollback.&lt;/p&gt;

&lt;p&gt;Instead, a compensation workflow may be required.&lt;/p&gt;

&lt;p&gt;This is why distributed financial processing needs more than simply checking for an HTTP 200 response.&lt;/p&gt;




&lt;h2&gt;
  
  
  12. Does NIBSS Handle Every USSD Transaction?
&lt;/h2&gt;

&lt;p&gt;No.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;USSD is an access channel, not a payment rail.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The financial infrastructure involved depends on what the customer wants to do.&lt;/p&gt;

&lt;p&gt;If the customer checks a bank balance, the request may remain within the bank's internal account services.&lt;/p&gt;

&lt;p&gt;If the customer purchases airtime, the bank coordinates financial processing and airtime fulfilment.&lt;/p&gt;

&lt;p&gt;If the customer transfers money to another bank, an interbank payment infrastructure may be involved.&lt;/p&gt;

&lt;p&gt;In Nigeria, NIBSS Instant Payments (NIP) is one of the important infrastructures used for interbank transfers.&lt;/p&gt;

&lt;p&gt;A simplified interbank flow could be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;USSD Channel
      |
Sending Bank
      |
Interbank Payment Infrastructure
      |
Receiving Bank
      |
Beneficiary Account
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The transaction may involve beneficiary validation, transfer processing, status confirmation and reconciliation.&lt;/p&gt;

&lt;p&gt;So, even though the user interacts with the same USSD code, the backend workflow can be completely different.&lt;/p&gt;




&lt;h2&gt;
  
  
  13. What About Security, Especially SS7 and SIM Swaps?
&lt;/h2&gt;

&lt;p&gt;The transaction crosses multiple trust boundaries.&lt;/p&gt;

&lt;p&gt;There's the customer's device, the mobile network, potentially an aggregator, the bank and external transaction providers.&lt;/p&gt;

&lt;p&gt;Each layer requires appropriate controls.&lt;/p&gt;

&lt;h3&gt;
  
  
  SS7 security
&lt;/h3&gt;

&lt;p&gt;SS7 was developed for telecommunications signalling in an environment that historically relied heavily on trust between network operators.&lt;/p&gt;

&lt;p&gt;As networks became more interconnected, weaknesses in those trust assumptions created security concerns.&lt;/p&gt;

&lt;p&gt;Telecommunications operators therefore need appropriate signalling security controls, filtering and monitoring.&lt;/p&gt;

&lt;p&gt;But SS7 security is only one part of the overall picture.&lt;/p&gt;

&lt;h3&gt;
  
  
  SIM-swap fraud
&lt;/h3&gt;

&lt;p&gt;A fraudster may attempt to obtain control of a customer's registered mobile number.&lt;/p&gt;

&lt;p&gt;If the banking service relies too heavily on possession of that number, the attacker could attempt unauthorised financial operations.&lt;/p&gt;

&lt;p&gt;Banks need authentication, transaction monitoring and relevant subscriber-risk controls.&lt;/p&gt;

&lt;h3&gt;
  
  
  API and integration security
&lt;/h3&gt;

&lt;p&gt;Connections between aggregators, financial institutions and vending providers should use appropriate security mechanisms.&lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TLS-protected application APIs.&lt;/li&gt;
&lt;li&gt;Strong service-to-service authentication.&lt;/li&gt;
&lt;li&gt;Secure credential storage.&lt;/li&gt;
&lt;li&gt;Credential rotation.&lt;/li&gt;
&lt;li&gt;Request validation.&lt;/li&gt;
&lt;li&gt;Least-privilege access.&lt;/li&gt;
&lt;li&gt;Rate limiting.&lt;/li&gt;
&lt;li&gt;Audit logging.&lt;/li&gt;
&lt;li&gt;Transaction monitoring.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Session security
&lt;/h3&gt;

&lt;p&gt;USSD applications also need to handle session expiration, repeated requests, invalid input and incorrect session correlation.&lt;/p&gt;

&lt;p&gt;For example, what happens if a customer's USSD session expires while the bank is processing a purchase?&lt;/p&gt;

&lt;p&gt;The system must ensure that the expired session doesn't result in uncontrolled retries or incorrect financial processing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Third-party security
&lt;/h3&gt;

&lt;p&gt;A bank may depend on infrastructure it doesn't directly own.&lt;/p&gt;

&lt;p&gt;That creates a need for third-party security governance, incident procedures, monitoring arrangements and clearly defined operational responsibilities.&lt;/p&gt;




&lt;h2&gt;
  
  
  14. The DevOps Side: Why Healthy Servers Don't Always Mean Healthy Transactions
&lt;/h2&gt;

&lt;p&gt;Imagine you're responsible for operating a bank's USSD application.&lt;/p&gt;

&lt;p&gt;Your servers are running.&lt;/p&gt;

&lt;p&gt;Your APIs are responding.&lt;/p&gt;

&lt;p&gt;Your dashboards are green.&lt;/p&gt;

&lt;p&gt;Yet customers are complaining that they cannot buy airtime.&lt;/p&gt;

&lt;p&gt;How can that happen?&lt;/p&gt;

&lt;p&gt;Because the bank's application is only one component in a much larger transaction journey.&lt;/p&gt;

&lt;p&gt;The mobile network might be experiencing a service disruption.&lt;/p&gt;

&lt;p&gt;The gateway might fail to route sessions.&lt;/p&gt;

&lt;p&gt;The aggregator could be unavailable.&lt;/p&gt;

&lt;p&gt;The authentication service might time out.&lt;/p&gt;

&lt;p&gt;The core banking integration might become slow.&lt;/p&gt;

&lt;p&gt;Or the airtime vending provider might fail to confirm fulfilment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A healthy banking application doesn't guarantee a healthy end-to-end customer journey.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Observability
&lt;/h3&gt;

&lt;p&gt;Suppose a customer reports:&lt;/p&gt;

&lt;p&gt;"I bought ₦1,000 airtime. My account was debited, but I never received it."&lt;/p&gt;

&lt;p&gt;An engineer needs to answer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Did the request reach the banking application?&lt;/li&gt;
&lt;li&gt;Was the customer successfully authenticated?&lt;/li&gt;
&lt;li&gt;Was the debit posted?&lt;/li&gt;
&lt;li&gt;Did the bank submit the recharge?&lt;/li&gt;
&lt;li&gt;Did the vending provider acknowledge it?&lt;/li&gt;
&lt;li&gt;Did the operator confirm fulfilment?&lt;/li&gt;
&lt;li&gt;Was a reversal initiated?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Correlation identifiers, structured logs, metrics, traces and reconciliation records help reconstruct the transaction across supported integration boundaries.&lt;/p&gt;

&lt;h3&gt;
  
  
  Latency and timeouts
&lt;/h3&gt;

&lt;p&gt;USSD sessions have limited lifetimes.&lt;/p&gt;

&lt;p&gt;If the banking application waits too long for several backend services, the customer may experience a timeout.&lt;/p&gt;

&lt;p&gt;The system needs response-time budgets, sensible retry policies and appropriate asynchronous processing.&lt;/p&gt;

&lt;p&gt;If fulfilment cannot be confirmed before the session expires, the transaction may need to continue through a pending and reconciliation workflow.&lt;/p&gt;

&lt;h3&gt;
  
  
  Operational monitoring
&lt;/h3&gt;

&lt;p&gt;Useful metrics include session completion rates, gateway failures, authentication errors, transaction latency, vending-provider timeouts, pending transactions and reconciliation exceptions.&lt;/p&gt;

&lt;p&gt;For critical services, monitoring should reflect the customer's complete experience rather than simply whether individual servers are available.&lt;/p&gt;




&lt;h2&gt;
  
  
  15. Quick Technical Terms Recap
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Term&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;USSD&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Unstructured Supplementary Service Data; interactive communication through a mobile network&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Telco&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Telecommunications company&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;MNO&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Mobile Network Operator&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;SIM&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Subscriber Identity Module&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;IMSI&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;International Mobile Subscriber Identity; identifies a mobile subscription&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;MSISDN&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Mobile Station International Subscriber Directory Number; subscriber's phone number&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;MSC&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Mobile Switching Centre; traditional mobile-core service control component&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;HLR&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Home Location Register; traditional subscriber information database&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;SS7&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Signalling System No. 7; telecom signalling protocol family&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;MAP&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Mobile Application Part; supports traditional mobile-network operations, including USSD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;IMS&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;IP Multimedia Subsystem; architecture for IP-based communication services&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;VAS&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Value Added Services&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;USSD gateway&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Connects telecom-facing USSD infrastructure to service applications&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Aggregator&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Integration provider connecting businesses with supported networks or other services&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;CBS&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Core Banking System&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;NIBSS&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Nigeria Inter-Bank Settlement System&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;NIP&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;NIBSS Instant Payments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Idempotency&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Mechanism that helps prevent repeated execution of the same intended operation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Reconciliation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Comparing records to identify and resolve transaction differences&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  The Next Time You Dial a USSD Code
&lt;/h2&gt;

&lt;p&gt;The next time you buy airtime using USSD, think about what happens behind that tiny screen.&lt;/p&gt;

&lt;p&gt;Your phone initiates a session through a mobile network.&lt;/p&gt;

&lt;p&gt;The network processes the request using its supported signalling mechanisms.&lt;/p&gt;

&lt;p&gt;A gateway, and possibly an aggregator, connects the interaction to the banking application.&lt;/p&gt;

&lt;p&gt;The bank identifies the customer, applies authentication and risk controls, and coordinates the financial operation.&lt;/p&gt;

&lt;p&gt;An airtime vending integration communicates with the relevant operator.&lt;/p&gt;

&lt;p&gt;The operator credits the airtime.&lt;/p&gt;

&lt;p&gt;And supporting systems help monitor, confirm and reconcile the transaction.&lt;/p&gt;

&lt;p&gt;What fascinates me most isn't just the number of technologies involved.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It's how independent systems, owned and operated by different organisations, cooperate to deliver what feels like one simple service.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The mobile operator doesn't own your bank account.&lt;/p&gt;

&lt;p&gt;The bank doesn't own your telecommunications network.&lt;/p&gt;

&lt;p&gt;The USSD aggregator doesn't necessarily process the financial transaction.&lt;/p&gt;

&lt;p&gt;And the airtime provider doesn't need access to the bank's internal ledger.&lt;/p&gt;

&lt;p&gt;Yet they can cooperate through defined protocols, APIs and operational arrangements.&lt;/p&gt;

&lt;p&gt;That's the beauty of infrastructure.&lt;/p&gt;

&lt;p&gt;Sometimes, the most complex engineering is hidden behind the simplest interactions.&lt;/p&gt;

&lt;p&gt;And when everything works, you barely notice it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's one everyday technology you've used and wondered how it actually works behind the scenes?&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>fintech</category>
      <category>architecture</category>
      <category>networking</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How Representment Works: What Happens When a Merchant Challenges a Chargeback</title>
      <dc:creator>Eunice Adediran</dc:creator>
      <pubDate>Sat, 12 Sep 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/euniceexplains/how-representment-works-what-happens-when-a-merchant-challenges-a-chargeback-342e</link>
      <guid>https://dev.to/euniceexplains/how-representment-works-what-happens-when-a-merchant-challenges-a-chargeback-342e</guid>
      <description>&lt;p&gt;A chargeback reaches the merchant.&lt;/p&gt;

&lt;p&gt;But the merchant has evidence that the original transaction was legitimate.&lt;/p&gt;

&lt;p&gt;So what happens next?&lt;/p&gt;

&lt;p&gt;Does the merchant simply accept the financial loss?&lt;/p&gt;

&lt;p&gt;Not necessarily.&lt;/p&gt;

&lt;p&gt;In the previous edition of &lt;strong&gt;Systems Explained Simply&lt;/strong&gt;, we looked at how chargebacks fit into the card-payment dispute flow.&lt;/p&gt;

&lt;p&gt;Now we're following that transaction one step further.&lt;/p&gt;

&lt;p&gt;This time, we're looking at the &lt;strong&gt;merchant-facing side of the dispute lifecycle&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That's where &lt;strong&gt;representment&lt;/strong&gt; comes in.&lt;/p&gt;

&lt;h2&gt;
  
  
  First: What Is Representment?
&lt;/h2&gt;

&lt;p&gt;In simple terms:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Representment is the process through which the merchant side challenges a chargeback by submitting evidence supporting the original transaction.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Conceptually, we've moved from this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Cardholder
    │
    │ Raises dispute
    ▼
Issuing Bank
    │
    ▼
Card Network
    │
    ▼
Acquirer / Payment Provider
    │
    ▼
  Merchant
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;to this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  Merchant
    │
    │ Evidence / Response
    ▼
Acquirer / Payment Provider
    │
    ▼
Card Network
    │
    ▼
Issuing Side
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The exact flow and terminology depend on the network and dispute, but the important idea is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The merchant isn't simply saying, "I disagree."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The merchant needs to respond to the &lt;strong&gt;specific reason for the dispute&lt;/strong&gt; with relevant evidence.&lt;/p&gt;

&lt;p&gt;And that's where things get interesting from a systems perspective.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Chargeback Is Not Just a Chargeback
&lt;/h2&gt;

&lt;p&gt;Suppose two ₦50,000 transactions are disputed.&lt;/p&gt;

&lt;p&gt;They may have the same:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;amount = 50000
status = CHARGEBACK
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;But that doesn't mean they're the same type of dispute.&lt;/p&gt;

&lt;p&gt;One customer might say:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"I didn't authorize this transaction."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Another might say:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"I paid, but the product never arrived."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Those claims require very different responses.&lt;/p&gt;

&lt;p&gt;Conceptually:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Chargeback
    │
    ▼
Identify Dispute Reason
    │
    ├── Unauthorized Transaction
    │       ▼
    │   Relevant fraud/authentication evidence
    │
    ├── Goods Not Received
    │       ▼
    │   Relevant fulfilment/delivery evidence
    │
    └── Duplicate Processing
            ▼
        Relevant transaction records
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This is why &lt;strong&gt;reason codes matter&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reason Codes Drive the Response
&lt;/h2&gt;

&lt;p&gt;Card networks use reason codes or dispute categories to describe why a transaction is being challenged.&lt;/p&gt;

&lt;p&gt;Those codes aren't just labels for reporting.&lt;/p&gt;

&lt;p&gt;They help determine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What the dispute is actually alleging&lt;/li&gt;
&lt;li&gt;What rules apply&lt;/li&gt;
&lt;li&gt;What evidence may be relevant&lt;/li&gt;
&lt;li&gt;What deadlines apply&lt;/li&gt;
&lt;li&gt;How the merchant should respond&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, a dispute alleging fraud may require evidence very different from a dispute alleging that merchandise wasn't received.&lt;/p&gt;

&lt;p&gt;So a merchant-facing dispute system shouldn't be designed around:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chargeback_received = true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;followed by:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;send_generic_evidence()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;A better mental model is:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Chargeback Received
        │
        ▼
Identify Reason Code
        │
        ▼
Determine Requirements
        │
        ▼
Gather Relevant Evidence
        │
        ▼
Validate Response
        │
        ▼
Submit Representment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The &lt;strong&gt;reason for the dispute should influence the evidence strategy&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Evidence Might Matter?
&lt;/h2&gt;

&lt;p&gt;Evidence depends on the dispute.&lt;/p&gt;

&lt;p&gt;For a goods-not-received claim, useful information might include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Delivery confirmation&lt;/li&gt;
&lt;li&gt;Tracking information&lt;/li&gt;
&lt;li&gt;Delivery address&lt;/li&gt;
&lt;li&gt;Customer communication&lt;/li&gt;
&lt;li&gt;Fulfilment records&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a duplicate-processing claim, the merchant may need transaction records demonstrating that the charges correspond to separate legitimate purchases.&lt;/p&gt;

&lt;p&gt;For another dispute category, completely different information may be relevant.&lt;/p&gt;

&lt;p&gt;The important engineering lesson isn't to memorize every possible evidence type.&lt;/p&gt;

&lt;p&gt;It's this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Evidence should be contextual.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A generic evidence packet for every chargeback is a poor model for a system dealing with multiple dispute categories.&lt;/p&gt;

&lt;h2&gt;
  
  
  Representment as a Workflow
&lt;/h2&gt;

&lt;p&gt;From an engineering perspective, representment isn't simply a button labelled:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CHALLENGE CHARGEBACK
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;It's a workflow with state.&lt;/p&gt;

&lt;p&gt;A simplified model could look like:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CHARGEBACK_RECEIVED
        ↓
UNDER_REVIEW
        ↓
EVIDENCE_REQUIRED
        ↓
EVIDENCE_COLLECTED
        ↓
REPRESENTMENT_SUBMITTED
        ↓
AWAITING_OUTCOME
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And eventually:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   ┌───────────────┐
   │               │
   ▼               ▼
ACCEPTED         REJECTED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Real implementations and network terminology vary, but modelling the process as a lifecycle helps us understand an important point:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A dispute evolves over time.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It isn't a single synchronous API request.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deadlines Are Part of the System
&lt;/h2&gt;

&lt;p&gt;There's another constraint payment engineers need to think about:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;time.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Dispute processes operate within defined timeframes.&lt;/p&gt;

&lt;p&gt;That means a merchant may have evidence proving the transaction was legitimate...&lt;/p&gt;

&lt;p&gt;but still need to submit it within the applicable deadline.&lt;/p&gt;

&lt;p&gt;From a system-design perspective, that introduces requirements around:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Timestamps&lt;/li&gt;
&lt;li&gt;Due dates&lt;/li&gt;
&lt;li&gt;Notifications&lt;/li&gt;
&lt;li&gt;Escalations&lt;/li&gt;
&lt;li&gt;Workflow queues&lt;/li&gt;
&lt;li&gt;SLA monitoring&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A dispute-management platform therefore needs to know not only:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;WHAT happened?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;but also:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;WHEN must the next action happen?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Traceability Becomes Critical
&lt;/h2&gt;

&lt;p&gt;Now think back to the original transaction.&lt;/p&gt;

&lt;p&gt;It may have happened weeks earlier.&lt;/p&gt;

&lt;p&gt;Yet the representment process may need information from that original payment.&lt;/p&gt;

&lt;p&gt;So the system needs to connect:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Original Payment
      │
      ▼
   Dispute
      │
      ▼
  Chargeback
      │
      ▼
 Reason Code
      │
      ▼
   Evidence
      │
      ▼
Representment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This is why identifiers and audit trails matter so much in payment architecture.&lt;/p&gt;

&lt;p&gt;If those records are fragmented across multiple systems, assembling a reliable dispute response becomes much harder.&lt;/p&gt;

&lt;h2&gt;
  
  
  Representment Also Has Financial Consequences
&lt;/h2&gt;

&lt;p&gt;Remember our earlier discussion about reconciliation?&lt;/p&gt;

&lt;p&gt;A chargeback can create a financial adjustment against the merchant side.&lt;/p&gt;

&lt;p&gt;If the merchant successfully challenges that chargeback, another financial event may need to be reflected.&lt;/p&gt;

&lt;p&gt;Conceptually:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Original Payment        +₦50,000
Chargeback              -₦50,000
Successful Challenge    +₦50,000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Again, the exact accounting treatment depends on the system and process.&lt;/p&gt;

&lt;p&gt;But the architectural point remains:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dispute events affect more than the dispute-management application.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;They can affect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Merchant balances&lt;/li&gt;
&lt;li&gt;Settlement&lt;/li&gt;
&lt;li&gt;Ledgers&lt;/li&gt;
&lt;li&gt;Reconciliation&lt;/li&gt;
&lt;li&gt;Reporting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So representment needs to integrate cleanly with the wider payment platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  Chargeback vs Representment
&lt;/h2&gt;

&lt;p&gt;The easiest way to separate them is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chargeback&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The cardholder disputes a completed card transaction through the issuer, potentially creating a financial adjustment against the merchant side.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Representment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The merchant side responds to the chargeback with evidence supporting the original transaction.&lt;/p&gt;

&lt;p&gt;So:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Payment
   ↓
Dispute
   ↓
Chargeback
   ↓
Reason Code
   ↓
Evidence
   ↓
Representment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And this reveals something important about payment-system design:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The transaction record alone isn't enough.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You also need the history around the transaction.&lt;/p&gt;

&lt;p&gt;Who challenged it?&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;When?&lt;/p&gt;

&lt;p&gt;What evidence was provided?&lt;/p&gt;

&lt;p&gt;What financial adjustments occurred?&lt;/p&gt;

&lt;p&gt;What is its current dispute state?&lt;/p&gt;

&lt;h2&gt;
  
  
  What Should Engineers Take Away?
&lt;/h2&gt;

&lt;p&gt;Representment highlights several useful design principles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Model disputes as workflows, not booleans.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;is_disputed = true&lt;/code&gt; tells you very little about where the case actually is.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Reason codes should influence system behaviour.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Different dispute reasons require different responses and evidence.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Evidence needs structure and traceability.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Documents and transaction data should remain connected to the dispute they support.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Time matters.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Deadlines, notifications and SLA tracking are part of the workflow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Financial events need reconciliation.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Chargebacks and subsequent dispute outcomes can affect merchant balances and financial records.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Preserve the audit trail.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Weeks later, the system should still be able to reconstruct what happened from the original payment through the dispute lifecycle.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Bigger Picture
&lt;/h2&gt;

&lt;p&gt;Our payment system is no longer simply:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST /payments
     ↓
  SUCCESS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We've now followed:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Authorization
     ↓
  Clearing
     ↓
 Settlement
     ↓
   Payout
     ↓
Reconciliation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And then the events that can happen later:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     Payment
        ↓
┌─────────────────┐
│ Refund          │
│ Reversal        │
│ Dispute         │
│ Chargeback      │
│ Representment   │
└─────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The further we go, the clearer something becomes:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A successful payment is a state in a much longer financial lifecycle.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And representment still isn't necessarily the end.&lt;/p&gt;

&lt;p&gt;What happens if the cardholder side and merchant side still don't agree after the merchant responds?&lt;/p&gt;

&lt;p&gt;That's where the dispute can move into later stages.&lt;/p&gt;

&lt;p&gt;We'll continue from there in the next edition of &lt;strong&gt;Systems Explained Simply&lt;/strong&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Systems Explained Simply&lt;/strong&gt; is my series breaking down the infrastructure, workflows, and engineering concepts behind systems we interact with every day.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Eunice Explains&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>payments</category>
      <category>fintech</category>
      <category>architecture</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How Chargebacks Work: Understanding the Card Payment Dispute Flow</title>
      <dc:creator>Eunice Adediran</dc:creator>
      <pubDate>Sat, 29 Aug 2026 11:00:00 +0000</pubDate>
      <link>https://dev.to/euniceexplains/how-chargebacks-work-understanding-the-card-payment-dispute-flow-4ekn</link>
      <guid>https://dev.to/euniceexplains/how-chargebacks-work-understanding-the-card-payment-dispute-flow-4ekn</guid>
      <description>&lt;p&gt;A payment can be successfully authorized, cleared, and settled...&lt;/p&gt;

&lt;p&gt;and still become a problem days or weeks later.&lt;/p&gt;

&lt;p&gt;The merchant may already have received value.&lt;/p&gt;

&lt;p&gt;The transaction may be marked as successful across the payment stack.&lt;/p&gt;

&lt;p&gt;Then the cardholder says:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"I didn't make this transaction."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At this point, we're no longer dealing only with payment processing.&lt;/p&gt;

&lt;p&gt;We're dealing with &lt;strong&gt;dispute management&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let's look at where a chargeback fits into the card payment lifecycle and what happens between the systems involved.&lt;/p&gt;

&lt;h2&gt;
  
  
  First: where does a chargeback happen?
&lt;/h2&gt;

&lt;p&gt;A simplified successful card payment looks something like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Cardholder
     │
     ▼
Issuing Bank
     │
     ▼
Card Network
     │
     ▼
Acquirer / Payment Provider
     │
     ▼
  Merchant
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The exact architecture varies, but the important point is that multiple parties participate in getting a card transaction from the customer to the merchant.&lt;/p&gt;

&lt;p&gt;A chargeback begins &lt;strong&gt;after a cardholder disputes a transaction through their issuer&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Now the direction of communication changes.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Cardholder
     │
     │ Raises dispute
     ▼
Issuing Bank
     │
     │ Dispute / Chargeback
     ▼
Card Network
     │
     ▼
Acquirer / Payment Provider
     │
     ▼
  Merchant
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This is one reason chargebacks shouldn't simply be thought of as "refunds."&lt;/p&gt;

&lt;p&gt;They are part of a &lt;strong&gt;formal card-payment dispute process&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The actors involved
&lt;/h2&gt;

&lt;p&gt;Before looking at the flow, let's identify the major participants.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cardholder
&lt;/h3&gt;

&lt;p&gt;The person whose card was used for the transaction.&lt;/p&gt;

&lt;p&gt;They may dispute a payment for reasons such as an unrecognized transaction, duplicate billing, goods or services not received, or another eligible dispute reason.&lt;/p&gt;

&lt;h3&gt;
  
  
  Issuer
&lt;/h3&gt;

&lt;p&gt;The financial institution that issued the customer's card.&lt;/p&gt;

&lt;p&gt;The cardholder normally raises the dispute with the issuer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Card network
&lt;/h3&gt;

&lt;p&gt;The network provides rules and infrastructure that allow the dispute to move between the issuing and acquiring sides.&lt;/p&gt;

&lt;h3&gt;
  
  
  Acquirer / Payment Provider
&lt;/h3&gt;

&lt;p&gt;The acquiring side processes payments for the merchant and communicates relevant dispute information to the merchant.&lt;/p&gt;

&lt;h3&gt;
  
  
  Merchant
&lt;/h3&gt;

&lt;p&gt;The business that accepted the original payment.&lt;/p&gt;

&lt;p&gt;Depending on the dispute, the merchant may accept the chargeback or provide evidence supporting the original transaction.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens when a dispute is raised?
&lt;/h2&gt;

&lt;p&gt;Suppose a cardholder notices a &lt;strong&gt;₦50,000&lt;/strong&gt; transaction they don't recognize.&lt;/p&gt;

&lt;p&gt;They contact their issuing bank.&lt;/p&gt;

&lt;p&gt;From a systems perspective, we now have an interesting situation.&lt;/p&gt;

&lt;p&gt;The original transaction might already look like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;authorization_status = APPROVED
clearing_status      = COMPLETED
settlement_status    = SETTLED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;But now another state exists:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dispute_status       = OPEN
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The original payment hasn't magically disappeared.&lt;/p&gt;

&lt;p&gt;Instead, a &lt;strong&gt;new process has started around that transaction&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That's an important distinction when designing or understanding payment systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Identify the original transaction
&lt;/h2&gt;

&lt;p&gt;The dispute needs to be associated with the correct payment.&lt;/p&gt;

&lt;p&gt;That means transaction identifiers become extremely important.&lt;/p&gt;

&lt;p&gt;A payment platform may need information such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Transaction reference&lt;/li&gt;
&lt;li&gt;Amount&lt;/li&gt;
&lt;li&gt;Transaction date&lt;/li&gt;
&lt;li&gt;Merchant information&lt;/li&gt;
&lt;li&gt;Card/payment reference&lt;/li&gt;
&lt;li&gt;Processing identifiers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without reliable identifiers, matching a dispute back to the original transaction becomes much harder.&lt;/p&gt;

&lt;p&gt;This is one reason traceability matters so much in financial systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Record the dispute reason
&lt;/h2&gt;

&lt;p&gt;Not every chargeback exists for the same reason.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Transaction A → Cardholder says transaction was unauthorized

Transaction B → Customer says goods were never received

Transaction C → Customer says they were charged twice
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;These are different scenarios.&lt;/p&gt;

&lt;p&gt;The dispute reason determines what information is relevant and how the case proceeds under the applicable card-network rules.&lt;/p&gt;

&lt;p&gt;So a dispute-management system needs more than:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;disputed = true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;It needs to understand &lt;strong&gt;why&lt;/strong&gt; the transaction is being disputed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Move the dispute through the payment chain
&lt;/h2&gt;

&lt;p&gt;The issuer processes the cardholder's dispute.&lt;/p&gt;

&lt;p&gt;The dispute information can then move through the relevant card-network process toward the acquiring side.&lt;/p&gt;

&lt;p&gt;Eventually, the merchant or its payment provider may receive information about the disputed transaction.&lt;/p&gt;

&lt;p&gt;Notice something important here:&lt;/p&gt;

&lt;p&gt;This isn't necessarily a synchronous request.&lt;/p&gt;

&lt;p&gt;The customer isn't waiting at a checkout screen while all of this happens.&lt;/p&gt;

&lt;p&gt;Chargeback processing can involve events occurring across different systems and at different times.&lt;/p&gt;

&lt;p&gt;From an engineering perspective, you're dealing with an &lt;strong&gt;asynchronous workflow&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Handle the financial impact
&lt;/h2&gt;

&lt;p&gt;If the dispute progresses to a chargeback, there can be a financial adjustment associated with the original transaction.&lt;/p&gt;

&lt;p&gt;Conceptually:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Original payment

Cardholder ───────────────► Merchant
              ₦50,000


Chargeback financial flow

Cardholder ◄─────────────── Merchant side
              ₦50,000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;That diagram is deliberately simplified.&lt;/p&gt;

&lt;p&gt;In reality, the movement occurs through the financial institutions and payment rails involved rather than through a direct transfer between the merchant and cardholder.&lt;/p&gt;

&lt;p&gt;But it helps illustrate the direction of the financial effect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Keep the systems reconciled
&lt;/h2&gt;

&lt;p&gt;Now something else becomes important.&lt;/p&gt;

&lt;p&gt;Remember our previous &lt;strong&gt;Systems Explained Simply&lt;/strong&gt; article on reconciliation?&lt;/p&gt;

&lt;p&gt;Chargebacks create additional financial events that also need to be accounted for.&lt;/p&gt;

&lt;p&gt;A system may need to distinguish between:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Original Sale        +₦50,000
Chargeback           -₦50,000
--------------------------------
Net Effect                 ₦0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If one system records the original transaction but another records both the transaction and the chargeback, the totals won't agree.&lt;/p&gt;

&lt;p&gt;So dispute processing doesn't exist in isolation.&lt;/p&gt;

&lt;p&gt;It affects &lt;strong&gt;ledgering, settlement, reconciliation, reporting, and merchant balances&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is where the different parts of payment architecture start connecting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why transaction state matters
&lt;/h2&gt;

&lt;p&gt;A common mistake when thinking about payments is assuming a transaction has only two states:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SUCCESS
FAILED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Real payment systems are more complicated.&lt;/p&gt;

&lt;p&gt;A transaction can successfully complete its original lifecycle and later become associated with other events.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AUTHORIZED
    ↓
CLEARED
    ↓
SETTLED
    ↓
PAID OUT
    ↓
DISPUTED
    ↓
CHARGEBACK
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The exact states and terminology depend on the system, but the principle is important:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Successful" doesn't always mean "nothing else can happen to this transaction."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Financial systems often need to preserve the original event while recording subsequent events against it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Refund vs Reversal vs Chargeback
&lt;/h2&gt;

&lt;p&gt;These three processes can look similar from the customer's bank account because money may return.&lt;/p&gt;

&lt;p&gt;Architecturally, they're different.&lt;/p&gt;

&lt;h3&gt;
  
  
  Refund
&lt;/h3&gt;

&lt;p&gt;The original payment completed and the &lt;strong&gt;merchant intentionally initiates a return of funds&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Payment → Completed → Merchant initiates refund
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Reversal
&lt;/h3&gt;

&lt;p&gt;The original transaction should not complete normally, so its financial effect is &lt;strong&gt;cancelled or unwound&lt;/strong&gt;.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Payment → Problem → Reversal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Chargeback
&lt;/h3&gt;

&lt;p&gt;The original payment completed, but the &lt;strong&gt;cardholder later disputes it through the issuer&lt;/strong&gt;.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Payment → Completed → Dispute → Chargeback
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The destination may look similar.&lt;/p&gt;

&lt;p&gt;The triggering event is completely different.&lt;/p&gt;

&lt;h2&gt;
  
  
  What should engineers take away from this?
&lt;/h2&gt;

&lt;p&gt;Chargebacks reveal several important characteristics of payment-system design.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Payments are asynchronous.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Events can happen long after the checkout request has finished.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Transaction identifiers matter.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You need reliable ways to correlate disputes and financial adjustments with the original transaction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;State needs to be explicit.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A transaction being successfully settled doesn't prevent later dispute events.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Auditability matters.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When money is disputed, systems need enough history to explain what happened.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reconciliation doesn't stop at settlement.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Refunds, reversals, chargebacks, and other adjustments also need to be reflected correctly across financial records.&lt;/p&gt;

&lt;p&gt;And perhaps most importantly:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A payment isn't just an API request.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's a lifecycle.&lt;/p&gt;

&lt;h2&gt;
  
  
  Putting it together
&lt;/h2&gt;

&lt;p&gt;Our payment architecture is starting to look much bigger than:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST /payments
     ↓
  SUCCESS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;A more realistic mental model is:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Authorization
     ↓
  Clearing
     ↓
 Settlement
     ↓
   Payout
     ↓
┌───────────────┐
│ Later Events  │
├───────────────┤
│ Refund        │
│ Reversal      │
│ Dispute       │
│ Chargeback    │
└───────────────┘
     ↓
Reconciliation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And that brings us to the next interesting question.&lt;/p&gt;

&lt;p&gt;What happens when the cardholder raises a chargeback...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;but the merchant has evidence that the original transaction was legitimate?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The chargeback isn't necessarily the end of the workflow.&lt;/p&gt;

&lt;p&gt;The merchant side may be able to challenge it.&lt;/p&gt;

&lt;p&gt;That's where &lt;strong&gt;representment&lt;/strong&gt; comes in.&lt;/p&gt;

&lt;p&gt;We'll explore that next in &lt;strong&gt;Systems Explained Simply&lt;/strong&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Systems Explained Simply&lt;/strong&gt; is my series breaking down the infrastructure, workflows, and engineering concepts behind systems we interact with every day.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Eunice Explains&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>fintech</category>
      <category>payments</category>
      <category>architecture</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Authorization Explained: What Really Happens Before Your Card Payment Is Approved?</title>
      <dc:creator>Eunice Adediran</dc:creator>
      <pubDate>Sat, 11 Jul 2026 13:06:39 +0000</pubDate>
      <link>https://dev.to/euniceexplains/authorization-explained-what-really-happens-before-your-card-payment-is-approved-3po</link>
      <guid>https://dev.to/euniceexplains/authorization-explained-what-really-happens-before-your-card-payment-is-approved-3po</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;A deep dive into the first stage of every card payment.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Most of us have made a card payment and seen the familiar message:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Transaction Successful&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The entire process takes only a few seconds.&lt;/p&gt;

&lt;p&gt;From the customer's perspective, that's the end of the story.&lt;/p&gt;

&lt;p&gt;Behind the scenes, however, that approval is the result of a distributed system involving merchants, payment providers, payment switches, card schemes, issuing banks, fraud detection systems, and multiple network hops.&lt;/p&gt;

&lt;p&gt;Before any money moves, one important question must be answered:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Should this payment be approved?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That question is answered during &lt;strong&gt;Authorization&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In this article, we'll explore what authorization is, why banks place authorization holds, and how this stage fits into the overall card payment lifecycle.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Payment Lifecycle
&lt;/h2&gt;

&lt;p&gt;Every successful card payment follows a sequence of events.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer
    │
    ▼
Authorization
    │
    ▼
Clearing
    │
    ▼
Settlement
    │
    ▼
Payout
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This article focuses on the first stage.&lt;/p&gt;

&lt;p&gt;Authorization.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Authorization?
&lt;/h2&gt;

&lt;p&gt;Authorization is the process of deciding whether a payment should be allowed to continue.&lt;/p&gt;

&lt;p&gt;It is &lt;strong&gt;not&lt;/strong&gt; the movement of money.&lt;/p&gt;

&lt;p&gt;It is simply a decision.&lt;/p&gt;

&lt;p&gt;When you tap your debit card at a POS terminal or click &lt;strong&gt;Pay Now&lt;/strong&gt; on an online checkout page, a payment request begins its journey.&lt;/p&gt;

&lt;p&gt;The request eventually reaches the bank that issued your card.&lt;/p&gt;

&lt;p&gt;Before approving it, the issuing bank performs several checks.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Does the Bank Check?
&lt;/h2&gt;

&lt;p&gt;An issuing bank doesn't blindly approve every transaction.&lt;/p&gt;

&lt;p&gt;It typically verifies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is the card valid?&lt;/li&gt;
&lt;li&gt;Has the card expired?&lt;/li&gt;
&lt;li&gt;Is the card blocked or reported stolen?&lt;/li&gt;
&lt;li&gt;Is there enough available balance or credit?&lt;/li&gt;
&lt;li&gt;Does the transaction trigger fraud detection rules?&lt;/li&gt;
&lt;li&gt;Does the transaction exceed spending limits?&lt;/li&gt;
&lt;li&gt;Does it require additional authentication?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If any of these checks fail, the transaction is declined.&lt;/p&gt;

&lt;p&gt;If they all pass, the transaction is approved.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Typical Authorization Flow
&lt;/h2&gt;

&lt;p&gt;Imagine buying groceries worth &lt;strong&gt;₦25,000&lt;/strong&gt; using your Access Bank debit card at a supermarket.&lt;/p&gt;

&lt;p&gt;The supermarket uses Moniepoint as its acquiring provider.&lt;/p&gt;

&lt;p&gt;The payment journey looks something like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer
      │
      ▼
POS Terminal
      │
      ▼
Acquirer (Moniepoint)
      │
      ▼
Payment Switch
      │
      ▼
Issuer (Access Bank)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Access Bank evaluates the transaction.&lt;/p&gt;

&lt;p&gt;If everything looks good, it returns an approval response.&lt;/p&gt;

&lt;p&gt;That response follows the same path back to the POS terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Access Bank
      │
      ▼
Payment Switch
      │
      ▼
Moniepoint
      │
      ▼
POS Terminal
      │
      ▼
Transaction Successful
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All of this typically happens in under three seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Authorization Doesn't Move Money
&lt;/h2&gt;

&lt;p&gt;This is one of the biggest misconceptions about card payments.&lt;/p&gt;

&lt;p&gt;Many people assume that once the POS says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Transaction Successful&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;the merchant has already received the money.&lt;/p&gt;

&lt;p&gt;Not quite.&lt;/p&gt;

&lt;p&gt;Authorization simply means:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The bank has approved the payment.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The actual transfer of funds happens later during settlement.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is an Authorization Hold?
&lt;/h2&gt;

&lt;p&gt;After approving a transaction, the bank usually places a &lt;strong&gt;hold&lt;/strong&gt; on the required amount.&lt;/p&gt;

&lt;p&gt;This is known as an &lt;strong&gt;authorization hold&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The money hasn't left your account yet.&lt;/p&gt;

&lt;p&gt;Instead, it has been reserved.&lt;/p&gt;

&lt;p&gt;You can't spend it somewhere else.&lt;/p&gt;

&lt;p&gt;Think of it as reserving a seat at the cinema.&lt;/p&gt;

&lt;p&gt;The seat still exists.&lt;/p&gt;

&lt;p&gt;It simply can't be taken by another customer.&lt;/p&gt;

&lt;p&gt;The same idea applies to your money.&lt;/p&gt;

&lt;p&gt;The funds remain in your account but are no longer available for other purchases.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Do Banks Place Holds?
&lt;/h2&gt;

&lt;p&gt;Authorization holds solve an important problem.&lt;/p&gt;

&lt;p&gt;Imagine this scenario.&lt;/p&gt;

&lt;p&gt;You have &lt;strong&gt;₦30,000&lt;/strong&gt; in your account.&lt;/p&gt;

&lt;p&gt;You make a purchase for &lt;strong&gt;₦25,000&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If the bank immediately approved the payment without reserving the money, you could spend the remaining balance before settlement occurs.&lt;/p&gt;

&lt;p&gt;By the time settlement begins, the money might no longer be available.&lt;/p&gt;

&lt;p&gt;The hold prevents that from happening.&lt;/p&gt;

&lt;p&gt;It guarantees that the approved funds remain available until settlement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where You See Authorization Holds
&lt;/h2&gt;

&lt;p&gt;Most people experience authorization holds without realizing it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hotels
&lt;/h3&gt;

&lt;p&gt;Hotels often place a larger authorization hold during check-in.&lt;/p&gt;

&lt;p&gt;The hold covers your room charges and any additional expenses.&lt;/p&gt;

&lt;p&gt;When you check out, the final amount is settled, and any unused funds are released.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fuel Stations
&lt;/h3&gt;

&lt;p&gt;Some fuel stations authorize a higher amount before dispensing fuel.&lt;/p&gt;

&lt;p&gt;If the final purchase is lower, the remaining hold is removed after settlement.&lt;/p&gt;

&lt;h3&gt;
  
  
  Car Rentals
&lt;/h3&gt;

&lt;p&gt;Rental companies commonly authorize a security deposit before releasing a vehicle.&lt;/p&gt;

&lt;p&gt;The final charge is settled when the vehicle is returned.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Authorization Matters
&lt;/h2&gt;

&lt;p&gt;Authorization protects everyone involved in a payment.&lt;/p&gt;

&lt;p&gt;For customers, it helps prevent fraudulent transactions.&lt;/p&gt;

&lt;p&gt;For merchants, it confirms that the customer can pay.&lt;/p&gt;

&lt;p&gt;For banks, it provides an opportunity to apply fraud detection, spending controls, and risk management before money moves.&lt;/p&gt;

&lt;p&gt;Without authorization, payment systems would become significantly less secure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Putting Everything Together
&lt;/h2&gt;

&lt;p&gt;Here's a simplified view of the authorization process.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer taps card
        │
        ▼
Merchant
        │
        ▼
Acquirer
        │
        ▼
Payment Switch
        │
        ▼
Issuing Bank
        │
        ├── Validate card
        ├── Check balance
        ├── Fraud checks
        ├── Spending limits
        └── Approve or Decline
                │
                ▼
Funds placed on Hold
                │
                ▼
Approval returned to Merchant
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point:&lt;/p&gt;

&lt;p&gt;The transaction has been approved.&lt;/p&gt;

&lt;p&gt;The merchant has &lt;strong&gt;not&lt;/strong&gt; been paid yet.&lt;/p&gt;

&lt;p&gt;The payment lifecycle is only beginning.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;Authorization is only the first stage.&lt;/p&gt;

&lt;p&gt;The next step is &lt;strong&gt;Clearing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is where financial institutions exchange transaction records and agree on exactly what needs to be settled before any money moves.&lt;/p&gt;

&lt;p&gt;We'll explore that in the next article.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Every time you tap your card, dozens of systems work together in a matter of seconds.&lt;/p&gt;

&lt;p&gt;Before you ever see &lt;strong&gt;"Transaction Successful,"&lt;/strong&gt; your bank has already validated your card, checked your balance, evaluated fraud risk, and reserved the required funds.&lt;/p&gt;

&lt;p&gt;That's authorization.&lt;/p&gt;

&lt;p&gt;It may be invisible to the customer, but it's one of the most important stages in every card payment.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>cloudcomputing</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>What Really Happens When You Pay With Your ATM Card?</title>
      <dc:creator>Eunice Adediran</dc:creator>
      <pubDate>Sat, 13 Jun 2026 11:43:36 +0000</pubDate>
      <link>https://dev.to/euniceexplains/what-really-happens-when-you-pay-with-your-atm-card-9am</link>
      <guid>https://dev.to/euniceexplains/what-really-happens-when-you-pay-with-your-atm-card-9am</guid>
      <description>&lt;p&gt;Every day, millions of people make payments using their debit cards. Whether you are buying groceries, paying for fuel, or purchasing an item from a local store, the process usually feels simple. You insert your card into a POS terminal, enter your PIN, and within a few seconds, the transaction is approved.&lt;/p&gt;

&lt;p&gt;Most of us rarely stop to think about what happens during those few seconds.&lt;/p&gt;

&lt;p&gt;Behind every successful card payment is a network of systems, financial institutions, and technology providers working together to ensure that your transaction is processed securely and accurately.&lt;/p&gt;

&lt;p&gt;In this edition, we will explore what happens when you use your ATM card to make a payment at a POS terminal.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Common Scenario
&lt;/h2&gt;

&lt;p&gt;Imagine you walk into a supermarket and purchase items worth ₦20,000. At the checkout counter, the cashier enters the amount into the POS terminal and asks you to insert your debit card.&lt;/p&gt;

&lt;p&gt;You enter your PIN and wait for the transaction to be processed.&lt;/p&gt;

&lt;p&gt;A few seconds later, the terminal displays:&lt;/p&gt;

&lt;p&gt;Transaction Approved&lt;/p&gt;

&lt;p&gt;What happened behind the scenes?&lt;/p&gt;

&lt;p&gt;The Key Participants&lt;/p&gt;

&lt;p&gt;Several parties are involved in making this transaction successful.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Cardholder&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is you, the person making the payment.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Merchant&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The business receiving the payment.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Acquirer&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The financial institution or payment provider responsible for processing card payments on behalf of the merchant.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Payment Switch&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The technology platform responsible for routing transaction messages between financial institutions. In many countries, payment switches help ensure that transaction requests are sent to the correct destination.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Issuer&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The bank that issued your debit card and holds your account.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Journey of the Transaction
&lt;/h2&gt;

&lt;p&gt;Once you insert your card and enter your PIN, the POS terminal reads information stored on the card’s chip.&lt;/p&gt;

&lt;p&gt;The transaction request is then sent from the merchant’s POS terminal to the acquiring institution.&lt;/p&gt;

&lt;p&gt;The acquirer forwards the transaction through the appropriate payment switch or network.&lt;/p&gt;

&lt;p&gt;The payment switch identifies the bank that issued your card and routes the transaction request accordingly.&lt;/p&gt;

&lt;p&gt;Your bank then performs several checks. It verifies that the card is valid, confirms that sufficient funds are available, reviews security rules, and checks for any unusual activity.&lt;/p&gt;

&lt;p&gt;If all checks pass successfully, the bank approves the transaction.&lt;/p&gt;

&lt;p&gt;The approval message then travels back through the same path until it reaches the POS terminal.&lt;/p&gt;

&lt;p&gt;Within a few seconds, the terminal displays the result and the merchant can complete the sale.&lt;/p&gt;

&lt;p&gt;Why Transactions Sometimes Fail&lt;/p&gt;

&lt;p&gt;Not every transaction is successful.&lt;/p&gt;

&lt;p&gt;Common reasons for transaction failures include insufficient funds, network connectivity issues, temporary service outages, card restrictions, expired cards, or security controls designed to prevent fraudulent activity.&lt;/p&gt;

&lt;p&gt;When any part of the process is unable to complete its role, the transaction may be declined or time out.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Bigger Picture
&lt;/h2&gt;

&lt;p&gt;What appears to be a simple payment is actually a coordinated conversation between multiple systems.&lt;/p&gt;

&lt;p&gt;The merchant, acquirer, payment switch, and issuing bank must all communicate successfully before a transaction can be approved.&lt;/p&gt;

&lt;p&gt;This entire process typically takes only a few seconds, which is a testament to the speed and reliability of modern payment systems.&lt;/p&gt;

&lt;p&gt;The next time you pay with your ATM card, remember that a complex network of technology is working behind the scenes to make that transaction possible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Coming Up Next
&lt;/h2&gt;

&lt;p&gt;In the next edition, we will explore one of the most misunderstood concepts in payments:&lt;/p&gt;

&lt;p&gt;Issuer vs Acquirer: Understanding the Two Banks Behind Every Card Transaction.&lt;/p&gt;

&lt;p&gt;If you found this article helpful, consider subscribing to stay updated on future editions of EuniceExplains.&lt;/p&gt;

&lt;p&gt;Feel free to share it with anyone interested in payments, fintech, cloud computing, and the technology powering modern systems.&lt;/p&gt;

</description>
      <category>cloudcomputing</category>
      <category>tutorial</category>
      <category>computerscience</category>
      <category>development</category>
    </item>
    <item>
      <title>Why Good Autoscaling Starts With Understanding the Workload</title>
      <dc:creator>Eunice Adediran</dc:creator>
      <pubDate>Mon, 06 Apr 2026 19:53:23 +0000</pubDate>
      <link>https://dev.to/euniceexplains/why-good-autoscaling-starts-with-understanding-the-workload-nej</link>
      <guid>https://dev.to/euniceexplains/why-good-autoscaling-starts-with-understanding-the-workload-nej</guid>
      <description>&lt;p&gt;When people talk about autoscaling in Kubernetes, the conversation usually starts with CPU and memory.&lt;/p&gt;

&lt;p&gt;But in real systems, especially in payment platforms, those numbers do not always show the problem early enough.&lt;/p&gt;

&lt;p&gt;A service can look fine from a resource point of view while transactions are already piling up in a queue. CPU may still be low. Memory may still look normal. But the system is already under pressure.&lt;/p&gt;

&lt;p&gt;That is why good autoscaling starts with understanding how a service works, not just watching resource usage.&lt;/p&gt;

&lt;h3&gt;
  
  
  Not every service should scale the same way
&lt;/h3&gt;

&lt;p&gt;A common mistake is using the same autoscaling method for every service.&lt;/p&gt;

&lt;p&gt;In reality, services behave differently, and the signs of pressure are not always the same.&lt;/p&gt;

&lt;p&gt;Some services are queue-based. These handle transactions, settlements, or other background jobs from Kafka or another messaging system. In cases like this, queue depth or consumer lag often tells you more than CPU.&lt;/p&gt;

&lt;p&gt;Some services run background tasks on a schedule or through internal events. Their work is usually more steady, so CPU and memory can be useful scaling signals.&lt;/p&gt;

&lt;p&gt;Some services handle API requests. These are more sensitive to traffic levels and response times, so request rate and latency often matter more.&lt;/p&gt;

&lt;p&gt;Once you see services this way, autoscaling becomes less about using one standard setup and more about choosing what fits each workload.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why CPU is not always enough
&lt;/h3&gt;

&lt;p&gt;For queue-based processing, scaling on CPU alone can be too slow.&lt;/p&gt;

&lt;p&gt;If a burst of payment events lands in a queue, the real issue is not that the pods are already using too much CPU. The issue is that work is waiting.&lt;/p&gt;

&lt;p&gt;If you wait for CPU to rise before scaling, the backlog is already building and processing is already slowing down.&lt;/p&gt;

&lt;p&gt;That is why queue depth or consumer lag is often the better signal. It shows that pressure is coming, not just that it has already arrived.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use the signal that reflects real demand
&lt;/h3&gt;

&lt;p&gt;For queue-driven services, event-based autoscaling is usually a better fit because it responds to the actual workload.&lt;/p&gt;

&lt;p&gt;If lag rises, add more consumers. If lag drops and stays low for a while, scale down carefully.&lt;/p&gt;

&lt;p&gt;CPU and memory still matter, but they work better as supporting signals than the main trigger. They help if processing becomes heavier than expected or if the queue metric is not available.&lt;/p&gt;

&lt;p&gt;Using more than one signal makes the setup more reliable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Scale up fast, scale down carefully
&lt;/h3&gt;

&lt;p&gt;One approach that works well is to scale up quickly and scale down slowly.&lt;/p&gt;

&lt;p&gt;When demand increases, the system should respond fast. In payment systems, slow processing can affect operations and user trust.&lt;/p&gt;

&lt;p&gt;But scaling down should be more careful. Traffic can rise and fall quickly, and removing capacity too soon can cause problems.&lt;/p&gt;

&lt;p&gt;That balance helps keep the system stable while still controlling cost.&lt;/p&gt;

&lt;h3&gt;
  
  
  Autoscaling also needs to be reliable
&lt;/h3&gt;

&lt;p&gt;Another thing that becomes clear in real environments is that autoscaling itself can fail.&lt;/p&gt;

&lt;p&gt;What happens if the autoscaler cannot read queue metrics? What happens if the metric pipeline breaks? What happens if more pods are needed but the cluster has no room for them?&lt;/p&gt;

&lt;p&gt;These are real issues.&lt;/p&gt;

&lt;p&gt;That is why a solid autoscaling setup needs fallback metrics, minimum replica counts, monitoring, and enough cluster capacity to support growth when needed.&lt;/p&gt;

&lt;p&gt;Autoscaling is not something you set once and forget. It needs the same attention as the services it supports.&lt;/p&gt;

&lt;h3&gt;
  
  
  Capacity still matters
&lt;/h3&gt;

&lt;p&gt;Even the best scaling rules will not help if the cluster cannot schedule new pods.&lt;/p&gt;

&lt;p&gt;You can have the right trigger and the right thresholds, and still end up with pods stuck in a pending state because there is not enough room in the cluster.&lt;/p&gt;

&lt;p&gt;That is why pod scaling and cluster planning need to work together. Resource requests need to be realistic, and there needs to be enough capacity to support scaling when traffic grows.&lt;/p&gt;

&lt;h3&gt;
  
  
  What changed for me
&lt;/h3&gt;

&lt;p&gt;The biggest shift for me was stopping seeing autoscaling as just a Kubernetes setting and starting to see it as a design decision.&lt;/p&gt;

&lt;p&gt;That changes the questions you ask.&lt;/p&gt;

&lt;p&gt;Instead of asking, “What CPU threshold should I use?”&lt;br&gt;
You ask, “What metric best shows that this service is under pressure?”&lt;/p&gt;

&lt;p&gt;Instead of asking, “How do I scale every service the same way?”&lt;br&gt;
You ask, “What scaling method fits this workload best?”&lt;/p&gt;

&lt;p&gt;That leads to better decisions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Final thought
&lt;/h3&gt;

&lt;p&gt;The best autoscaling method is not the most common one. It is the one that matches the workload.&lt;/p&gt;

&lt;p&gt;For queue-based systems, that often means scaling on backlog or lag. For APIs, it may mean scaling on traffic and response time. For workers, CPU and memory may still be enough.&lt;/p&gt;

&lt;p&gt;The goal is not to force every service into the same pattern.&lt;/p&gt;

&lt;p&gt;The goal is to let each service scale based on the signal that best shows real demand.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>infrastructure</category>
      <category>tutorial</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>The Terraform Mistakes Survival Guide: How I Migrated a Monolith State Without Destroying a Single Resource</title>
      <dc:creator>Eunice Adediran</dc:creator>
      <pubDate>Sun, 29 Mar 2026 21:01:58 +0000</pubDate>
      <link>https://dev.to/euniceexplains/the-terraform-mistakes-survival-guide-how-i-migrated-a-monolith-state-without-destroying-a-single-4epd</link>
      <guid>https://dev.to/euniceexplains/the-terraform-mistakes-survival-guide-how-i-migrated-a-monolith-state-without-destroying-a-single-4epd</guid>
      <description>&lt;p&gt;I migrated a monolith Terraform state without destroying a single resource.&lt;/p&gt;

&lt;p&gt;Here is how I approached it. There might be better ways to do this, but this worked for me.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;We had one massive state file managing all our GitHub resources. Teams. Members. Admins. Permissions. Everything in one place.&lt;/p&gt;

&lt;p&gt;Every change touched everything. Risky. Slow. Hard to review.&lt;/p&gt;

&lt;p&gt;If someone needed to add a new team member, the plan would show changes across the entire state. One wrong move and you could accidentally destroy resources that had nothing to do with your change.&lt;/p&gt;

&lt;p&gt;I was asked to break it into smaller modules. Teams in one state file. Members in another. Each piece moving independently.&lt;/p&gt;

&lt;p&gt;Sounds simple, right?&lt;/p&gt;

&lt;p&gt;It was not.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Danger: State Drift During Refactor
&lt;/h2&gt;

&lt;p&gt;Here is the problem with splitting state:&lt;/p&gt;

&lt;p&gt;When you move resources to a new module with its own state file, Terraform does not automatically know those resources already exist.&lt;/p&gt;

&lt;p&gt;So this happens:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;New module&lt;/strong&gt; tries to CREATE the resources (because they are not in its state yet)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Old root&lt;/strong&gt; tries to DESTROY them (because you removed the code from there)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is classic state drift during refactor.&lt;/p&gt;

&lt;p&gt;If you run &lt;code&gt;terraform apply&lt;/code&gt; on both without handling this properly, you could end up with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Duplicate resources (if creation succeeds before destruction)&lt;/li&gt;
&lt;li&gt;Deleted resources (if destruction runs first)&lt;/li&gt;
&lt;li&gt;Failed applies with conflicts&lt;/li&gt;
&lt;li&gt;A very bad day&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I was not about to let that happen.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before attempting this migration, make sure you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Terraform 1.5 or later&lt;/strong&gt; (for the &lt;code&gt;import&lt;/code&gt; and &lt;code&gt;removed&lt;/code&gt; blocks syntax)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend access&lt;/strong&gt; to both state files (old root and new module)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resource IDs&lt;/strong&gt; for everything you are migrating (you will need these for imports)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A backup&lt;/strong&gt; of your current state file (run &lt;code&gt;terraform state pull &amp;gt; backup.tfstate&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Time and patience&lt;/strong&gt; (do not rush this)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Solution: Step by Step
&lt;/h2&gt;

&lt;p&gt;I did it in five steps. Each one is critical. Do not skip any.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Create the New Module
&lt;/h3&gt;

&lt;p&gt;First, I created a new directory for the teams module with its own state file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;github-management/
  main.tf
  terraform.tfstate        # old monolith state
  teams/
    main.tf
    backend.tf             # points to new state file
    terraform.tfstate      # new isolated state
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I moved the &lt;code&gt;github_team&lt;/code&gt; and &lt;code&gt;github_team_members&lt;/code&gt; resources into the new &lt;code&gt;teams/main.tf&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="c1"&gt;# teams/main.tf&lt;/span&gt;

&lt;span class="n"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"github_team"&lt;/span&gt; &lt;span class="s2"&gt;"teams"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;for_each&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;teams&lt;/span&gt;

  &lt;span class="n"&gt;name&lt;/span&gt;        &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;each&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;
  &lt;span class="n"&gt;description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;each&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;description&lt;/span&gt;
  &lt;span class="n"&gt;privacy&lt;/span&gt;     &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;each&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;privacy&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"github_team_members"&lt;/span&gt; &lt;span class="s2"&gt;"members"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;for_each&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;teams&lt;/span&gt;

  &lt;span class="n"&gt;team_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;github_team&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;teams&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;each&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;

  &lt;span class="n"&gt;dynamic&lt;/span&gt; &lt;span class="s2"&gt;"members"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;for_each&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;each&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;members&lt;/span&gt;
    &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;username&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;members&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;
      &lt;span class="n"&gt;role&lt;/span&gt;     &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;members&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;role&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point, if I ran &lt;code&gt;terraform plan&lt;/code&gt; in the new module, it would try to create all the teams. That is expected. We fix that next.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Import Existing Resources into the New State
&lt;/h3&gt;

&lt;p&gt;This is where the magic happens.&lt;/p&gt;

&lt;p&gt;I created an &lt;code&gt;import.tf&lt;/code&gt; file in the new teams module:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="c1"&gt;# teams/import.tf&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;github_team&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;teams&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"devops"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"1234567"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;github_team&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;teams&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"backend"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"2345678"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;github_team&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;teams&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"frontend"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"3456789"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# Repeat for all teams you are migrating&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How to find the resource IDs:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For GitHub teams, you can get the team ID from:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The GitHub API: &lt;code&gt;GET /orgs/{org}/teams/{team_slug}&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Your existing state file: &lt;code&gt;terraform state show github_team.teams["devops"]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The GitHub web UI (inspect network requests when viewing the team)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;What this does:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;import&lt;/code&gt; block tells Terraform:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"These resources already exist in the real world. Do not create them. Just attach them to this state file."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When you run &lt;code&gt;terraform plan&lt;/code&gt; after adding imports, you should see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;Plan: 0 to add, 0 to change, 0 to destroy.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you see changes, review them carefully. Minor drift is normal (like description formatting), but structural changes mean something is wrong.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Remove Resources from the Old Root Safely
&lt;/h3&gt;

&lt;p&gt;Now we need to tell the old root module to stop managing these resources without destroying them.&lt;/p&gt;

&lt;p&gt;I created a &lt;code&gt;remove.tf&lt;/code&gt; file in the old root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="c1"&gt;# remove.tf (in old root)&lt;/span&gt;

&lt;span class="n"&gt;removed&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;github_team&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;teams&lt;/span&gt;

  &lt;span class="n"&gt;lifecycle&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;destroy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;removed&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;github_team_members&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;members&lt;/span&gt;

  &lt;span class="n"&gt;lifecycle&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;destroy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What this does:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;removed&lt;/code&gt; block with &lt;code&gt;destroy = false&lt;/code&gt; tells Terraform:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Stop tracking these resources in this state file. But do NOT delete them from the real world."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is the critical piece. Without &lt;code&gt;destroy = false&lt;/code&gt;, Terraform would delete your teams when you apply.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Apply the Migration
&lt;/h3&gt;

&lt;p&gt;Now we apply in the correct order.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First, apply the new module:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; teams/
terraform plan    &lt;span class="c"&gt;# Should show imports, no creates&lt;/span&gt;
terraform apply   &lt;span class="c"&gt;# Imports resources into new state&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Then, apply the old root:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ..
terraform plan    &lt;span class="c"&gt;# Should show removals, no destroys&lt;/span&gt;
terraform apply   &lt;span class="c"&gt;# Removes resources from old state&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The result:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Old state: resources removed (not destroyed)&lt;/li&gt;
&lt;li&gt;New state: resources now tracked&lt;/li&gt;
&lt;li&gt;Real world: nothing changed&lt;/li&gt;
&lt;li&gt;No downtime. No recreation. No deletion.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 5: Clean Up
&lt;/h3&gt;

&lt;p&gt;After successful migration, delete the temporary files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rm teams/import.tf
rm remove.tf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why clean up?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Import blocks are one time operations. Once the resource is in state, the import block does nothing.&lt;/li&gt;
&lt;li&gt;Removed blocks are only needed during transition. Keeping them adds confusion.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your final structure should look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;github-management/
  main.tf                  # remaining resources only
  terraform.tfstate        # smaller, focused state
  teams/
    main.tf                # team resources
    terraform.tfstate      # isolated teams state
  members/
    main.tf                # future migration
    terraform.tfstate      # isolated members state
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Common Pitfalls to Avoid
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Applying in the wrong order
&lt;/h3&gt;

&lt;p&gt;If you apply the old root removal before importing into the new module, you might lose track of resources. Always import first.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Forgetting &lt;code&gt;destroy = false&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This is the most dangerous mistake. Without it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="c1"&gt;# DANGEROUS - will delete resources&lt;/span&gt;
&lt;span class="n"&gt;removed&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;github_team&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;teams&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# SAFE - keeps resources alive&lt;/span&gt;
&lt;span class="n"&gt;removed&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;github_team&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;teams&lt;/span&gt;

  &lt;span class="n"&gt;lifecycle&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;destroy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Missing resource IDs
&lt;/h3&gt;

&lt;p&gt;If you import with the wrong ID, Terraform will either fail or attach to the wrong resource. Double check every ID before applying.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Not backing up state
&lt;/h3&gt;

&lt;p&gt;Always run &lt;code&gt;terraform state pull &amp;gt; backup.tfstate&lt;/code&gt; before starting. If something goes wrong, you can restore with &lt;code&gt;terraform state push backup.tfstate&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Rushing the migration
&lt;/h3&gt;

&lt;p&gt;This is not a task to do on a Friday afternoon. Take your time. Verify each step. Run &lt;code&gt;terraform plan&lt;/code&gt; obsessively.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;h3&gt;
  
  
  "Resource already exists" error
&lt;/h3&gt;

&lt;p&gt;This means you tried to create without importing first. Add the import block and try again.&lt;/p&gt;

&lt;h3&gt;
  
  
  Plan shows unexpected changes after import
&lt;/h3&gt;

&lt;p&gt;Some drift is normal. Review carefully:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Safe drift:&lt;/strong&gt; formatting differences, computed defaults&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dangerous drift:&lt;/strong&gt; structural changes, missing attributes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you see dangerous drift, investigate before applying.&lt;/p&gt;

&lt;h3&gt;
  
  
  "Resource not found" during import
&lt;/h3&gt;

&lt;p&gt;The resource ID is wrong or the resource was deleted. Verify the ID exists in your provider (GitHub, AWS, etc.) before importing.&lt;/p&gt;

&lt;h3&gt;
  
  
  State file locked
&lt;/h3&gt;

&lt;p&gt;Someone else is running Terraform, or a previous run crashed. Wait for the lock to release or manually unlock (carefully) with &lt;code&gt;terraform force-unlock &amp;lt;LOCK_ID&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Never split state without a migration plan.&lt;/strong&gt; The import and removed blocks are your safety net.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Import first, remove second.&lt;/strong&gt; Order matters.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Always use &lt;code&gt;destroy = false&lt;/code&gt; in removed blocks.&lt;/strong&gt; Unless you actually want to delete resources.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Back up your state before starting.&lt;/strong&gt; Every time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Take your time.&lt;/strong&gt; A careful migration takes hours. Fixing a broken one takes days.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This approach took time. But now changes are cleaner and safer. Each module can be updated independently. Reviews are focused. Risk is contained.&lt;/p&gt;

&lt;p&gt;I am sure there are other ways to handle this. Terraform has &lt;code&gt;terraform state mv&lt;/code&gt; commands that can also work. Some teams use Terragrunt for state management. Others use workspaces.&lt;/p&gt;

&lt;p&gt;If you have done something similar, I would love to hear how you approached it.&lt;/p&gt;

&lt;p&gt;What is your go to method for splitting Terraform state?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Save this before your next Terraform refactor.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>terraform</category>
      <category>devops</category>
      <category>infrastructure</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>The Google Cloud CLI Installation Saga: How I Conquered Python Path Hell on macOS</title>
      <dc:creator>Eunice Adediran</dc:creator>
      <pubDate>Tue, 20 Jan 2026 22:39:11 +0000</pubDate>
      <link>https://dev.to/euniceexplains/the-google-cloud-cli-installation-saga-how-i-conquered-python-path-hell-on-macos-3605</link>
      <guid>https://dev.to/euniceexplains/the-google-cloud-cli-installation-saga-how-i-conquered-python-path-hell-on-macos-3605</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;When Homebrew Fails You&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Every macOS developer knows the mantra: "Just use Homebrew." But when it came to installing Google Cloud CLI, Homebrew led me down a rabbit hole of Python errors, broken symlinks, and network timeouts. This is the story of how I discovered that sometimes, the "official" installer is actually the &lt;strong&gt;escape hatch&lt;/strong&gt; you need.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Chapter 1: The Homebrew Illusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Like most developers, I started with what seemed like the simplest approach:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew install --cask google-cloud-sdk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result? Immediate failure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ERROR: /opt/homebrew/opt/python@3.13/libexec/bin/python3: command not found
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The Problem:&lt;/strong&gt; Homebrew's cask made incorrect assumptions about my Python installation. Despite having Python 3.13 from python.org at &lt;code&gt;/usr/local/bin/python3&lt;/code&gt;, Homebrew insisted on looking for it in &lt;code&gt;/opt/homebrew/opt/python@3.13/libexec/bin/python3&lt;/code&gt;—a path that didn't exist in my system.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Chapter 2: The Symlink Band-Aid&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;My first instinct was to "fix" the path issue by creating the missing symlink:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo mkdir -p /opt/homebrew/opt/python@3.13/libexec/bin
sudo ln -sf /usr/local/bin/python3 /opt/homebrew/opt/python@3.13/libexec/bin/python3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This allowed the installer to progress... only to hit the next wall.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Chapter 3: Network Timeouts and Cryptography Woes&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Now the error changed to network issues:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ERROR: HTTPSConnectionPool(host='release-assets.githubusercontent.com', port=443): Read timed out
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The installer was trying to download the &lt;code&gt;cryptography&lt;/code&gt; package from GitHub's CDN and failing consistently. I tried:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Increasing pip timeouts&lt;/li&gt;
&lt;li&gt;Multiple retries&lt;/li&gt;
&lt;li&gt;Different network conditions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Nothing worked. The GitHub CDN seemed to be rejecting or timing out the requests consistently.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Chapter 4: The Revelation - Use Google's Own Installer&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;After hours of frustration, I realized I was trying to fit a square peg (Homebrew's assumptions) into a round hole (my actual system setup). The solution was shockingly simple: &lt;strong&gt;Use Google's official installer directly.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The commands that actually worked:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/install_google_cloud_sdk.bash
chmod +x install_google_cloud_sdk.bash
./install_google_cloud_sdk.bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why this worked when Homebrew failed:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;No Python assumptions&lt;/strong&gt; - The installer used whatever Python was in my PATH&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Better error handling&lt;/strong&gt; - More graceful fallbacks when components failed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Direct from source&lt;/strong&gt; - No Homebrew middleman with its own opinions&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Chapter 5: The Installer's Wisdom&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;When the installer ran, it asked smart questions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Modify profile to update your $PATH and enable shell command completion?
Do you want to continue (Y/n)?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I pressed &lt;code&gt;Y&lt;/code&gt;, and it automatically added the necessary lines to my &lt;code&gt;~/.zshrc&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# The Google Cloud SDK&lt;/span&gt;
&lt;span class="nb"&gt;source&lt;/span&gt; &lt;span class="s1"&gt;'/Users/username/google-cloud-sdk/path.zsh.inc'&lt;/span&gt;
&lt;span class="nb"&gt;source&lt;/span&gt; &lt;span class="s1"&gt;'/Users/username/google-cloud-sdk/completion.zsh.inc'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The key difference:&lt;/strong&gt; The official installer &lt;strong&gt;asked&lt;/strong&gt; about configuration rather than &lt;strong&gt;assuming&lt;/strong&gt; like Homebrew did.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Chapter 6: The GKE Authentication Finale&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;With gcloud installed, I still needed to connect to my Kubernetes cluster:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcloud init  &lt;span class="c"&gt;# Simple setup&lt;/span&gt;
gcloud components install gke-gcloud-auth-plugin  &lt;span class="c"&gt;# Modern auth&lt;/span&gt;
gcloud container clusters get-credentials my-cluster --region us-central1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And just like that, I could run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get nodes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Success!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;The Lessons Learned&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Homebrew Isn't Always the Answer&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Homebrew excels at many things, but for complex, multi-component tools like Google Cloud SDK, its "opinionated" approach can conflict with existing system configurations. The official installer often has better logic for detecting and adapting to your actual environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;2. The Power of Direct Installation&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Google's &lt;code&gt;install_google_cloud_sdk.bash&lt;/code&gt; script:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Handles Python detection more intelligently&lt;/li&gt;
&lt;li&gt;Provides clearer error messages&lt;/li&gt;
&lt;li&gt;Offers interactive configuration&lt;/li&gt;
&lt;li&gt;Comes straight from the source (no packaging layer)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;3. Python Environment Management is Critical&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The root cause was my mixed Python installations. Going forward, I'll either:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stick to one Python distribution method&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;pyenv&lt;/code&gt; for clean version management&lt;/li&gt;
&lt;li&gt;Regularly audit my Python installations&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;4. Network Issues Need Workarounds&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When packages fail to download:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Try the official installer (it might use different sources)&lt;/li&gt;
&lt;li&gt;Install during off-peak hours&lt;/li&gt;
&lt;li&gt;Consider manual component installation if needed&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Your Cheat Sheet for Success&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you're facing similar Google Cloud CLI installation issues on macOS, &lt;strong&gt;skip Homebrew&lt;/strong&gt; and use this proven sequence:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Download Google's official installer&lt;/span&gt;
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/install_google_cloud_sdk.bash

&lt;span class="c"&gt;# 2. Make it executable&lt;/span&gt;
chmod +x install_google_cloud_sdk.bash

&lt;span class="c"&gt;# 3. Run it (answer 'Y' to PATH modification)&lt;/span&gt;
./install_google_cloud_sdk.bash

&lt;span class="c"&gt;# 4. Restart your shell or source your config&lt;/span&gt;
&lt;span class="nb"&gt;source&lt;/span&gt; ~/.zshrc  &lt;span class="c"&gt;# or ~/.bash_profile&lt;/span&gt;

&lt;span class="c"&gt;# 5. Initialize and configure&lt;/span&gt;
gcloud init
gcloud components install gke-gcloud-auth-plugin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion: Sometimes Simpler is Better&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;My journey taught me that when "standard" installation methods fail, going back to the source—the official installer from the original developers—often provides the clearest path to success. The Google Cloud SDK installer is well-tested, comprehensive, and designed to handle edge cases that third-party package managers might not anticipate.&lt;/p&gt;

&lt;p&gt;The next time you're stuck in dependency hell, remember: the solution might be simpler than you think. Sometimes, you just need to bypass the middleman and go straight to the source.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The working command that saved hours of frustration:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/install_google_cloud_sdk.bash &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; chmod +x install_google_cloud_sdk.bash &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; ./install_google_cloud_sdk.bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sometimes, the official way is the easiest way after all.&lt;/p&gt;

</description>
      <category>python</category>
      <category>google</category>
      <category>cli</category>
      <category>mac</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>Eunice Adediran</dc:creator>
      <pubDate>Thu, 18 Sep 2025 15:54:34 +0000</pubDate>
      <link>https://dev.to/euniceexplains/-i4</link>
      <guid>https://dev.to/euniceexplains/-i4</guid>
      <description>&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://dev.to/euniceexplains/a-complete-guide-to-setting-up-and-troubleshooting-aws-msk-connect-in-private-subnets-2dik" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6rhjyhiuut4k5ktmpsz8.png" height="451" class="m-0" width="800"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://dev.to/euniceexplains/a-complete-guide-to-setting-up-and-troubleshooting-aws-msk-connect-in-private-subnets-2dik" rel="noopener noreferrer" class="c-link"&gt;
            A Complete Guide to Setting Up and Troubleshooting AWS MSK Connect in Private Subnets - DEV Community
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Amazon Managed Streaming for Apache Kafka (MSK) simplifies running Kafka on AWS. MSK Connect extends...
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8j7kvp660rqzt99zui8e.png" width="300" height="299"&gt;
          dev.to
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>datascience</category>
      <category>aws</category>
      <category>kafka</category>
      <category>networking</category>
    </item>
    <item>
      <title>A Complete Guide to Setting Up and Troubleshooting AWS MSK Connect in Private Subnets</title>
      <dc:creator>Eunice Adediran</dc:creator>
      <pubDate>Thu, 18 Sep 2025 15:47:11 +0000</pubDate>
      <link>https://dev.to/euniceexplains/a-complete-guide-to-setting-up-and-troubleshooting-aws-msk-connect-in-private-subnets-2dik</link>
      <guid>https://dev.to/euniceexplains/a-complete-guide-to-setting-up-and-troubleshooting-aws-msk-connect-in-private-subnets-2dik</guid>
      <description>&lt;p&gt;Amazon Managed Streaming for Apache Kafka (MSK) simplifies running Kafka on AWS. MSK Connect extends this by allowing data to flow between Kafka topics and external systems such as Amazon S3, Elasticsearch, or databases. While powerful, the setup process often runs into networking, authentication, and plugin issues, especially when the MSK cluster is placed in &lt;strong&gt;private subnets&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This article provides a step-by-step walkthrough for setting up MSK Connect in private subnets, explains why errors occur, and details how to fix them. It also covers both scenarios: when you are creating a new MSK cluster from scratch, and when you already have an MSK cluster running.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scenario 1: Setting Up MSK Connect from Scratch in Private Subnets
&lt;/h2&gt;

&lt;p&gt;If you don’t yet have an MSK cluster, you must first provision one inside a VPC. Because we are focusing on private subnets, all network communication will rely on correct security group rules and VPC endpoints.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step A: Create the MSK Cluster
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;VPC and Subnets&lt;/strong&gt;:
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;   Use &lt;strong&gt;private subnets&lt;/strong&gt; for your brokers.&lt;/li&gt;
&lt;li&gt;   Ensure these subnets have appropriate routing (e.g., NAT gateway 
or VPC endpoints) to reach AWS services like S3 and CloudWatch.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Security Group (SG) Setup&lt;/strong&gt;:
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;   Create a dedicated security group for MSK.&lt;/li&gt;
&lt;li&gt;   &lt;strong&gt;Inbound rules&lt;/strong&gt;: Allow traffic from the private subnets where clients or Kafka Connect will run.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Outbound rules&lt;/strong&gt;: This is critical. MSK needs outbound access to reach services. If you skip this, you may see errors like:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; org.apache.kafka.common.errors.TimeoutException: Timed out waiting to send the call. Call: fetchMetadata
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;The cluster may still provision, but your connectors will not be able to communicate with the brokers. The fix is simple: ensure outbound rules allow traffic (0.0.0.0/0 on required ports or at least AWS service endpoints).&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Authentication and Broker Ports&lt;/strong&gt;:
&lt;/h4&gt;

&lt;p&gt;MSK supports different authentication mechanisms. The chosen method determines which broker endpoint and port you should use later:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;   &lt;strong&gt;IAM authentication&lt;/strong&gt; → &lt;code&gt;bootstrap_brokers_sasl_iam&lt;/code&gt; on port &lt;strong&gt;9098&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;   &lt;strong&gt;SASL/SCRAM authentication&lt;/strong&gt; → &lt;code&gt;bootstrap_brokers_sasl_scram&lt;/code&gt; on port &lt;strong&gt;9096&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;   &lt;strong&gt;TLS only&lt;/strong&gt; → &lt;code&gt;bootstrap_brokers_tls&lt;/code&gt; on port &lt;strong&gt;9094&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Common mistakes here include using the wrong broker endpoint for the authentication method you selected, which will result in connectivity errors. For example, if you provision the cluster with SASL but later try to connect using the IAM bootstrap brokers, you’ll face timeouts.&lt;/p&gt;

&lt;p&gt;Another consideration:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If &lt;strong&gt;IAM = false&lt;/strong&gt; and &lt;strong&gt;SASL = true&lt;/strong&gt;, you must explicitly create usernames and passwords for your MSK cluster.&lt;/li&gt;
&lt;li&gt;If you choose IAM only, no manual credentials are required.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step B: Create the Kafka Connect Cluster
&lt;/h3&gt;

&lt;p&gt;Once the MSK cluster is ready, you can provision Kafka Connect in the same VPC.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Authentication Choice in Connect&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Kafka Connect only allows two options: &lt;code&gt;NONE&lt;/code&gt; or &lt;code&gt;IAM&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If your MSK cluster was created with SASL, you must select &lt;code&gt;NONE&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If your MSK cluster was created with IAM, then configure Connect to use IAM and point it to &lt;code&gt;bootstrap_brokers_sasl_iam&lt;/code&gt; (port 9098).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Choosing incorrectly will result in connection failures or metadata fetch errors.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Executor Role Permissions&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Kafka Connect tasks run under an IAM execution role. If you plan to use S3 as a sink or source, this role must include at least:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;s3:GetObject&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s3:ListBucket&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without these, connectors fail when trying to write or read from S3.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;VPC Endpoint for S3&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Since your MSK Connect cluster is in a private subnet, it cannot reach S3 directly. You need to create a &lt;strong&gt;Gateway VPC Endpoint&lt;/strong&gt; for S3:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   com.amazonaws.&amp;lt;region&amp;gt;.s3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If this is missing, you will encounter errors such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   org.apache.kafka.connect.errors.ConnectException: com.amazonaws.SdkClientException: Unable to execute HTTP request: Connect to s3.us-east-1.amazonaws.com:443 failed: connect timed out
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The fix is to create the VPC endpoint and associate it with the private route tables.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;CloudWatch Logging&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Always create a CloudWatch log group for Kafka Connect. This allows you to see detailed error messages from tasks, which are invaluable during troubleshooting.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Custom Plugins&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Many real-world connectors (such as the S3 Sink Connector or Protobuf Converter) are not built-in.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Download or build the connector JAR files.&lt;/li&gt;
&lt;li&gt;Package them as a ZIP file.&lt;/li&gt;
&lt;li&gt;Upload the ZIP to an S3 bucket.&lt;/li&gt;
&lt;li&gt;Reference the S3 path when creating the Kafka Connect cluster.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the plugin is missing or not zipped correctly, your connector creation will fail.&lt;/p&gt;

&lt;h3&gt;
  
  
  Common Errors and Fixes (Scenario 1)
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Error&lt;/th&gt;
&lt;th&gt;Cause&lt;/th&gt;
&lt;th&gt;Resolution&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;TimeoutException: Timed out waiting to send the call&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Wrong broker port used or SG outbound blocked&lt;/td&gt;
&lt;td&gt;Confirm broker endpoint matches your authentication type. Check SG outbound rules.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ConnectException: Unable to execute HTTP request&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;MSK Connect in private subnet cannot reach S3&lt;/td&gt;
&lt;td&gt;Create a Gateway VPC Endpoint for &lt;code&gt;com.amazonaws.&amp;lt;region&amp;gt;.s3&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Connector cannot access S3&lt;/td&gt;
&lt;td&gt;Missing IAM permissions on executor role&lt;/td&gt;
&lt;td&gt;Add &lt;code&gt;s3:GetObject&lt;/code&gt; and &lt;code&gt;s3:ListBucket&lt;/code&gt; to the role.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Plugin not found error&lt;/td&gt;
&lt;td&gt;Plugin not uploaded or wrong format&lt;/td&gt;
&lt;td&gt;Upload plugin ZIP to S3 and specify correct path in Connect configuration.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Scenario 2: Setting Up MSK Connect with an Existing Cluster
&lt;/h2&gt;

&lt;p&gt;If you already have an MSK cluster in a private subnet, the process is simpler but still requires validation.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Check Cluster Configuration&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Which authentication method is enabled (IAM, SASL, or TLS)?&lt;/li&gt;
&lt;li&gt;Which broker endpoint corresponds to that method?&lt;/li&gt;
&lt;li&gt;Are security group outbound rules configured?&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Kafka Connect Setup&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Deploy Kafka Connect in the same VPC and private subnets as the cluster.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Match authentication correctly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If cluster uses SASL → select &lt;code&gt;NONE&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If cluster uses IAM → select &lt;code&gt;IAM&lt;/code&gt; and use the IAM bootstrap brokers.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Networking and Permissions&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Ensure the VPC endpoint for S3 is present.&lt;/li&gt;
&lt;li&gt;Confirm the executor role has S3 permissions.&lt;/li&gt;
&lt;li&gt;Verify CloudWatch log group exists.&lt;/li&gt;
&lt;li&gt;Confirm plugins are available in S3 in ZIP format.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Troubleshooting&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;If connectors still fail, check CloudWatch logs. Typical issues point back to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Incorrect broker endpoints&lt;/li&gt;
&lt;li&gt;Missing S3 permissions&lt;/li&gt;
&lt;li&gt;Absent VPC endpoint&lt;/li&gt;
&lt;li&gt;Plugin packaging errors&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Always create MSK clusters in private subnets with the necessary VPC endpoints for dependent services.&lt;/li&gt;
&lt;li&gt;Double-check which broker endpoint you should use. Many timeouts come from mixing IAM/SASL/TLS endpoints.&lt;/li&gt;
&lt;li&gt;Use least-privilege IAM policies, but don’t forget that Kafka Connect executor roles need explicit S3 permissions.&lt;/li&gt;
&lt;li&gt;Package connectors properly in ZIP format before uploading to S3.&lt;/li&gt;
&lt;li&gt;Monitor Kafka Connect logs in CloudWatch for faster troubleshooting.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Running MSK Connect in private subnets requires more than just clicking through the AWS console. You must carefully manage VPC design, security groups, authentication settings, and service endpoints. Most errors arise from either networking misconfigurations (outbound rules, missing VPC endpoints) or mismatched broker authentication. By validating each step and following the error–resolution table, you can avoid the most common pitfalls and deploy a stable Kafka-to-S3 pipeline.&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>aws</category>
      <category>kafka</category>
      <category>networking</category>
    </item>
    <item>
      <title>Implementing Secure Breakglass Access for ArgoCD with Vault, External Secrets, and Terraform</title>
      <dc:creator>Eunice Adediran</dc:creator>
      <pubDate>Tue, 05 Aug 2025 10:03:35 +0000</pubDate>
      <link>https://dev.to/euniceexplains/implementing-secure-breakglass-access-for-argocd-with-vault-external-secrets-and-terraform-dgd</link>
      <guid>https://dev.to/euniceexplains/implementing-secure-breakglass-access-for-argocd-with-vault-external-secrets-and-terraform-dgd</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;This article outlines a secure and automated approach to implementing breakglass access for ArgoCD. Breakglass access refers to emergency administrative access that can be used when standard authentication methods fail or are temporarily unavailable. This solution integrates &lt;strong&gt;HashiCorp Vault&lt;/strong&gt;, the &lt;strong&gt;External Secrets Operator (ESO)&lt;/strong&gt;, and &lt;strong&gt;Terraform&lt;/strong&gt; to securely provision and manage credentials while maintaining flexibility and minimizing operational overhead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Goals
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Automate provisioning of a breakglass user for ArgoCD.&lt;/li&gt;
&lt;li&gt;Store credentials securely using Vault.&lt;/li&gt;
&lt;li&gt;Enable ArgoCD to dynamically access credentials via External Secrets.&lt;/li&gt;
&lt;li&gt;Allow breakglass provisioning to be toggled per environment.&lt;/li&gt;
&lt;li&gt;Avoid manual secret management or multi-repo coordination.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Architecture Components
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HashiCorp Vault&lt;/strong&gt;: Serves as the single source of truth for secrets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;External Secrets Operator (ESO)&lt;/strong&gt;: Syncs secrets from Vault to Kubernetes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Terraform&lt;/strong&gt;: Automates the provisioning of secrets and configuration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ArgoCD&lt;/strong&gt;: The GitOps tool that requires controlled emergency access support.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Solution Breakdown
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Secret Generation and Storage in Vault
&lt;/h3&gt;

&lt;p&gt;Terraform is used to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generate a random password for the breakglass account.&lt;/li&gt;
&lt;li&gt;Hash the password using bcrypt.&lt;/li&gt;
&lt;li&gt;Store both the plaintext and hashed versions in Vault under a dedicated path (e.g., &lt;code&gt;secrets/platform/argocd/breakglass&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"accounts.breakglass.username"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"breakglass"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"accounts.breakglass.password"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;bcrypt-hashed-password&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"argocd-login-password"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;plaintext-password&amp;gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Conditional Provisioning with Terraform
&lt;/h3&gt;

&lt;p&gt;A toggle (&lt;code&gt;create_break_glass_access&lt;/code&gt;) is used to control whether the breakglass secret is provisioned in a specific environment.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When &lt;code&gt;true&lt;/code&gt;: credentials are created and pushed to Vault.&lt;/li&gt;
&lt;li&gt;When &lt;code&gt;false&lt;/code&gt;: an empty password is stored, effectively disabling login.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This avoids needing separate manual steps to deactivate access.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Integration with External Secrets
&lt;/h3&gt;

&lt;p&gt;The External Secrets Operator is configured to sync the Vault secret into a Kubernetes secret (&lt;code&gt;argocd-secret&lt;/code&gt;), which ArgoCD reads for authentication.&lt;/p&gt;

&lt;p&gt;Example &lt;code&gt;ExternalSecret&lt;/code&gt; config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;secretKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;accounts.breakglass.username&lt;/span&gt;
  &lt;span class="na"&gt;remoteRef&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;platform/argocd/breakglass&lt;/span&gt;
    &lt;span class="na"&gt;property&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;accounts.breakglass.username&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;secretKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;accounts.breakglass.password&lt;/span&gt;
  &lt;span class="na"&gt;remoteRef&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;platform/argocd/breakglass&lt;/span&gt;
    &lt;span class="na"&gt;property&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;accounts.breakglass.password&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ensures secrets are injected into the &lt;code&gt;argocd-secret&lt;/code&gt;, enabling login without exposing credentials in Git.&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenge: ConfigMap vs. Secret for ArgoCD Accounts
&lt;/h2&gt;

&lt;p&gt;One of the key design decisions involved how to configure the &lt;code&gt;accounts.breakglass.enabled&lt;/code&gt; flag in ArgoCD. While ArgoCD expects user enablement via its &lt;code&gt;argocd-cm&lt;/code&gt; ConfigMap, syncing this flag dynamically via ESO is not supported out-of-the-box.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Resolution:&lt;/strong&gt;&lt;br&gt;
The system avoids relying on this flag by using a controlled approach:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If the Terraform flag is &lt;code&gt;false&lt;/code&gt;, no valid credentials are stored in Vault.&lt;/li&gt;
&lt;li&gt;As a result, the synced Kubernetes secret contains an empty password, rendering login ineffective even if the account is enabled in the ConfigMap.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This minimizes operational complexity by removing the need to manage multiple sources of truth.&lt;/p&gt;
&lt;h2&gt;
  
  
  Policy Integration
&lt;/h2&gt;

&lt;p&gt;In environments where fine-grained access control is required, a Vault policy is added to allow only specific service accounts or roles (e.g., &lt;code&gt;breakglass&lt;/code&gt;, &lt;code&gt;platform-admins&lt;/code&gt;) to retrieve the secret.&lt;/p&gt;

&lt;p&gt;Example policy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="s2"&gt;"secrets/data/platform/argocd/breakglass"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;capabilities&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"read"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Environment-Specific Controls
&lt;/h2&gt;

&lt;p&gt;The solution supports per-environment deployment using configuration files (e.g., &lt;code&gt;dev.tfvars&lt;/code&gt;, &lt;code&gt;preprod.tfvars&lt;/code&gt;), allowing each environment to independently enable or disable breakglass access.&lt;/p&gt;

&lt;p&gt;This makes it easy to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enable access in preprod or staging for testing.&lt;/li&gt;
&lt;li&gt;Keep access disabled in production unless needed.&lt;/li&gt;
&lt;li&gt;Control access lifecycles via GitOps workflows.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Benefits
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;No need to hardcode or expose credentials in repositories.&lt;/li&gt;
&lt;li&gt;Seamless integration with ArgoCD using existing mechanisms (secrets).&lt;/li&gt;
&lt;li&gt;Unified control via Terraform.&lt;/li&gt;
&lt;li&gt;Supports dynamic toggling without manual intervention.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Implementing a robust break-glass mechanism for ArgoCD using HashiCorp Vault, External Secrets Operator (ESO), and Terraform significantly enhances the security and maintainability of Kubernetes-based environments. By automating the generation, storage, and syncing of emergency credentials, this solution eliminates manual intervention while ensuring credentials remain protected, auditable, and environment-controlled.&lt;/p&gt;

&lt;p&gt;This design also simplifies operations during critical scenarios by reducing the number of steps required to enable or disable access. Integrating with Vault provides centralized secret management, while ESO ensures seamless syncing to Kubernetes. By keeping the setup modular and driven by infrastructure-as-code, organizations can adopt this pattern across multiple environments with minimal duplication and high confidence.&lt;/p&gt;

&lt;p&gt;This approach can serve as a template for other sensitive access workflows, ensuring security is never compromised even under pressure.&lt;/p&gt;

</description>
      <category>argocd</category>
      <category>security</category>
      <category>terraform</category>
      <category>eso</category>
    </item>
    <item>
      <title>Comprehensive Guide to AWS Monitoring, Scaling, and Traffic Management</title>
      <dc:creator>Eunice Adediran</dc:creator>
      <pubDate>Wed, 30 Apr 2025 14:15:52 +0000</pubDate>
      <link>https://dev.to/euniceexplains/comprehensive-guide-to-aws-monitoring-scaling-and-traffic-management-1jhh</link>
      <guid>https://dev.to/euniceexplains/comprehensive-guide-to-aws-monitoring-scaling-and-traffic-management-1jhh</guid>
      <description>&lt;h2&gt;
  
  
  Monitoring and Cost Management with AWS Services
&lt;/h2&gt;

&lt;h3&gt;
  
  
  CloudWatch: Centralized Monitoring Solution
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Alarms and Notifications&lt;/strong&gt;: CloudWatch alarms can trigger:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon EC2 Auto Scaling actions&lt;/li&gt;
&lt;li&gt;SNS topic notifications for alerting&lt;/li&gt;
&lt;li&gt;Automated remediation workflows&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Metrics Collection&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Aggregates data across AWS services&lt;/li&gt;
&lt;li&gt;Supports cross-Region monitoring&lt;/li&gt;
&lt;li&gt;Provides customizable retention periods&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Visualization Tools&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Interactive dashboards for real-time monitoring&lt;/li&gt;
&lt;li&gt;Custom widgets for specific metrics&lt;/li&gt;
&lt;li&gt;Anomaly detection capabilities&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  EventBridge: Event-Driven Architecture
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Processes and routes events through:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Event buses&lt;/strong&gt; for standard event processing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pipes&lt;/strong&gt; for point-to-point integrations&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Enables serverless event-driven applications&lt;/li&gt;
&lt;li&gt;Integrates with 200+ AWS services and SaaS applications&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cost Management Tools
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;AWS Cost Explorer&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visualizes spending patterns&lt;/li&gt;
&lt;li&gt;Forecasts future costs&lt;/li&gt;
&lt;li&gt;Identifies cost optimization opportunities&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;AWS Budgets&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sets custom cost and usage thresholds&lt;/li&gt;
&lt;li&gt;Sends alerts when exceeding limits&lt;/li&gt;
&lt;li&gt;Supports RI utilization tracking&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;AWS Cost and Usage Report&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Provides detailed line-item data&lt;/li&gt;
&lt;li&gt;Enables granular cost allocation&lt;/li&gt;
&lt;li&gt;Supports integration with BI tools&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Auto Scaling Strategies in AWS
&lt;/h2&gt;

&lt;h3&gt;
  
  
  EC2 Auto Scaling Fundamentals
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Auto Scaling Groups (ASGs)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Logical collections of EC2 instances&lt;/li&gt;
&lt;li&gt;Maintains application availability&lt;/li&gt;
&lt;li&gt;Supports multiple purchase options (On-Demand, Spot)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Capacity Settings&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimum: Baseline instance count&lt;/li&gt;
&lt;li&gt;Maximum: Upper scaling limit&lt;/li&gt;
&lt;li&gt;Desired: Optimal running count&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Scaling Methods
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Scheduled Scaling&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Predictable traffic patterns&lt;/li&gt;
&lt;li&gt;Time-based adjustments&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Dynamic Scaling&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Target tracking policies&lt;/li&gt;
&lt;li&gt;Step and simple scaling&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Predictive Scaling&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Machine learning forecasts&lt;/li&gt;
&lt;li&gt;Proactive capacity adjustments&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Advanced Scaling Options
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;AWS Auto Scaling&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unified interface for multiple services&lt;/li&gt;
&lt;li&gt;EC2, ECS, DynamoDB, Aurora&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Application Auto Scaling&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Service-specific scaling&lt;/li&gt;
&lt;li&gt;Custom scaling metrics&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Database Scaling Solutions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Amazon Aurora Scaling
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Vertical Scaling&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Instance class modification&lt;/li&gt;
&lt;li&gt;Manual compute capacity adjustment&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Horizontal Scaling&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Aurora Replicas (up to 15)&lt;/li&gt;
&lt;li&gt;Read workload distribution&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Aurora Serverless&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automatic capacity adjustment&lt;/li&gt;
&lt;li&gt;Cost-effective for variable workloads&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Amazon RDS Scaling Options
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Read Replicas&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Offload read traffic&lt;/li&gt;
&lt;li&gt;Cross-region replication&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Vertical Scaling&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Instance type modification&lt;/li&gt;
&lt;li&gt;Storage scaling&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  DynamoDB Scaling Models
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;On-Demand Capacity&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pay-per-request pricing&lt;/li&gt;
&lt;li&gt;No capacity planning&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Auto Scaling&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automated throughput adjustment&lt;/li&gt;
&lt;li&gt;Application Auto Scaling integration&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Load Balancing Solutions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Elastic Load Balancing (ELB) Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Traffic distribution across AZs&lt;/li&gt;
&lt;li&gt;Health checks and automatic failover&lt;/li&gt;
&lt;li&gt;SSL termination and request routing&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Load Balancer Types
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Application Load Balancer (ALB)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Layer 7 (application layer)&lt;/li&gt;
&lt;li&gt;Content-based routing&lt;/li&gt;
&lt;li&gt;WebSocket and HTTP/2 support&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Network Load Balancer (NLB)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Layer 4 (transport layer)&lt;/li&gt;
&lt;li&gt;Ultra-low latency&lt;/li&gt;
&lt;li&gt;Millions of requests per second&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Gateway Load Balancer (GWLB)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Layer 3 (network layer)&lt;/li&gt;
&lt;li&gt;Security appliance integration&lt;/li&gt;
&lt;li&gt;Traffic inspection capabilities&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Amazon Route 53 DNS Services
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Core Functionality
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Domain registration management&lt;/li&gt;
&lt;li&gt;Hosted zone administration&lt;/li&gt;
&lt;li&gt;Authoritative DNS service&lt;/li&gt;
&lt;li&gt;Integrated health checking&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Advanced Routing Policies
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Simple Routing&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Basic round-robin&lt;/li&gt;
&lt;li&gt;No advanced logic&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Weighted Routing&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Traffic distribution by percentage&lt;/li&gt;
&lt;li&gt;A/B testing scenarios&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Latency Routing&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lowest latency selection&lt;/li&gt;
&lt;li&gt;Global application performance&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Failover Routing&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Active-passive configurations&lt;/li&gt;
&lt;li&gt;Disaster recovery setups&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Geolocation Routing&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Location-based responses&lt;/li&gt;
&lt;li&gt;Content localization&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Geoproximity Routing&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Geographic bias adjustments&lt;/li&gt;
&lt;li&gt;Traffic flow optimization&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Multivalue Routing&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multiple healthy records&lt;/li&gt;
&lt;li&gt;Client-side load balancing&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;IP-Based Routing&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Source IP address routing&lt;/li&gt;
&lt;li&gt;Custom traffic steering&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Implementation Best Practices
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Monitoring&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Establish comprehensive CloudWatch dashboards&lt;/li&gt;
&lt;li&gt;Configure meaningful alarm thresholds&lt;/li&gt;
&lt;li&gt;Implement EventBridge for event-driven automation&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Scaling&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Combine predictive and dynamic scaling&lt;/li&gt;
&lt;li&gt;Test scaling policies under load&lt;/li&gt;
&lt;li&gt;Implement scaling cooldowns&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Load Balancing&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select appropriate LB type for workload&lt;/li&gt;
&lt;li&gt;Configure cross-zone balancing&lt;/li&gt;
&lt;li&gt;Implement SSL offloading&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;DNS Management&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use alias records for AWS resources&lt;/li&gt;
&lt;li&gt;Implement DNSSEC for security&lt;/li&gt;
&lt;li&gt;Configure TTL values appropriately&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By leveraging these AWS services in combination, organizations can build highly available, scalable, and cost-effective cloud architectures with optimal traffic management and performance characteristics.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>monitoring</category>
      <category>management</category>
      <category>kubernetes</category>
    </item>
  </channel>
</rss>
