<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Wagner Amaral on Medium]]></title>
        <description><![CDATA[Stories by Wagner Amaral on Medium]]></description>
        <link>https://medium.com/@wamaral?source=rss-5be0ac0aca76------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2D9lInYf5BzIJdsG28qwAA.jpeg</url>
            <title>Stories by Wagner Amaral on Medium</title>
            <link>https://medium.com/@wamaral?source=rss-5be0ac0aca76------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 11:49:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wamaral/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Receiving international transfers at Qonto: our SWIFT architecture]]></title>
            <link>https://medium.com/qonto-way/receiving-international-transfers-at-qonto-our-swift-architecture-cd1c0adcc64b?source=rss-5be0ac0aca76------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd1c0adcc64b</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Wagner Amaral]]></dc:creator>
            <pubDate>Thu, 26 Nov 2020 09:56:11 GMT</pubDate>
            <atom:updated>2021-03-15T10:03:48.782Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Qonto customer looking at a bank depicting SWIFT, and receiving money represented by currency symbols on its hand" src="https://cdn-images-1.medium.com/max/1024/1*dSicBnDQb9n7aHkHBz2ctQ.png" /></figure><p>Earlier in 2020, Qonto introduced to its customers the <a href="https://qonto.com/en/blog/product/swift-receive-international-transfers">ability to receive money transfers from all over the world</a>. How did we accomplish that?</p><h3>SWIFT</h3><p>Let’s begin with a quick definition of something which might sound familiar: The <a href="https://www.swift.com/">Society for Worldwide Interbank Financial Telecommunication</a> (<strong>SWIFT</strong>) is the cooperative behind the SWIFT network, the worldwide standard for communication between financial institutions. For Qonto, being connected to this network means we’re accessible to banks all around the world. For our customers, it means easily receiving money from different countries, in several currencies, and have it turn up as Euros in their accounts.</p><p>But how does it work? How can one become a part of this network?</p><h3>The graph network</h3><p>Being a part of the SWIFT network means establishing partnerships with other participants in the network. To send or receive messages over the network, you must have an agreement with one or multiple partners, and you only communicate directly with them — even though all messages go through the same network. We can imagine the network topology as an undirected graph:</p><figure><img alt="SWIFT network topology with Qonto and other banks connected to each other" src="https://cdn-images-1.medium.com/max/1024/1*N_NxMDxH23ZpAUge7T_xaA.png" /></figure><p>Each participant in the network is identified by an unique code issued by the SWIFT cooperative, called <a href="https://en.wikipedia.org/wiki/ISO_9362">Business Identifier Code</a> or <strong>BIC</strong> for short (sometimes also called SWIFT code).</p><p>As part of the SWIFT infrastructure, there is an official registry called <a href="https://www.swift.com/our-solutions/compliance-and-shared-services/swiftref">SWIFTRef</a> serving as a directory of BICs. After you register your BIC on SWIFTRef, you have the ability to publish the list of your direct partners, and by doing that you become reachable to other participants in the network.</p><p>With that in place, Qonto does not need a direct connection to every single participant. In the previous example, if <em>Bank 6</em> wants to send money to Qonto, they can choose the following path through the network:</p><figure><img alt="SWIFT Network topology with arrows coming from a participant bank and reaching Qonto" src="https://cdn-images-1.medium.com/max/1024/1*PJkiwwXMY5SfjHMdWatjiA.png" /></figure><h3>Qonto’s architecture</h3><p>In order to build a scalable and robust system, we set two goals while designing Qonto’s architecture to connect to the SWIFT network:</p><blockquote><em>Being able to add a new network partner without requiring the time and effort of building a new system</em></blockquote><p>Why would we want another partner? In the SWIFT network, depending on the type of transfer, all the intermediary participants can charge a fee for passing along the information. By having more direct partners, we increase the chance of a transfer having fewer intermediaries, <strong>reducing the fees</strong> charged on the transfer.</p><blockquote><em>Convert the data received from the network as early as possible, and never allow network data to </em>leak<em> into our systems</em></blockquote><p>One reason why this is so important: SWIFT was founded in 1973, and while they have a <a href="https://www.swift.com/standards/iso-20022">new message format</a>, the original format is still the most commonly used. It’s not a very friendly format to parse, and it can be quite challenging to find the information you need. Here, try it yourself:</p><pre>{1:F01BNK1DEBEAXXX1258143442}{2:I103QNTOFRP1XXXXN1}{3:{119:STP}}{4:<br>:20:1987238234<br>:23B:CRED<br>:32A:201007EUR1234567,89<br>:50A:/DE10500105176467386842<br>JOHN DOE<br>32 MAIN STREET<br>BERLIN<br>:59:/FR1210096000509958666734W89<br>JANE DOE<br>22 RUE DE PARIS<br>PARIS<br>:71A:OUR<br>-}{5:{MAC:00000000}{PDE:}}{S:{SAC:}{COP:P}}</pre><p>With those goals in mind, here’s the solution we designed:</p><figure><img alt="Layout of Qonto architecture, with 3 internal layers connected through Kafka" src="https://cdn-images-1.medium.com/max/1024/1*e2YsYjDKNDU5ZNREY0oWcg.png" /></figure><p>Let’s get to those layers in more detail.</p><h3>The connector layer</h3><p>This layer is responsible for connecting to a partner, sending and receiving messages, and handling network failures (e.g. retry at a later time if the partner is unreachable).</p><p>We store a raw copy of every message that passes through this layer in a bucket in AWS S3 for safekeeping and replayability. We can think of the S3 bucket internally as a <em>mirror</em> of the messages we exchanged.</p><p>Whenever a new message is received from the network, it is published into a Kafka topic for the other layers to consume. Whenever a new message is sent by the other layers (into another Kafka topic), it is forwarded to our partner. And that’s where this layer’s responsibility ends.</p><p>This layer takes care of the first goal: the effort of adding a new network partner is scoped to creating a new connector in this layer, while keeping changes to the rest of the system minimal.</p><h3>The parser layer</h3><p>The scope here is very small and straight-forward: converting between those nasty SWIFT messages and our own internal representation, the format which the rest of our systems can understand easily.</p><p>This layer is <strong>stateless</strong> (there are no databases). It receives data as input, and produces data as output. Aside from the I/O of reading and writing to Kafka, the entire codebase is basically a pure function. And since it’s Kafka, we can even choose to implement it directly as a stream processor.</p><p>This layer takes care of the second goal: the rest of the system never have to deal with the complicated network data. Here’s the above example, after being converted by the parser:</p><pre>{<br>  &quot;sender_bic&quot;: &quot;BNK1DEBE&quot;,<br>  &quot;sender_account&quot;: &quot;DE10500105176467386842&quot;,<br>  &quot;sender_name&quot;: &quot;JOHN DOE&quot;,<br>  &quot;sender_address&quot;: &quot;32 MAIN STREET\nBERLIN&quot;,<br>  &quot;beneficiary_bic&quot;: &quot;QNTOFRP1&quot;,<br>  &quot;beneficiary_account&quot;: &quot;FR1210096000509958666734W89&quot;,<br>  &quot;beneficiary_name&quot;: &quot;JANE DOE&quot;,<br>  &quot;beneficiary_address&quot;: &quot;22 RUE DE PARIS\nPARIS&quot;,<br>  &quot;amount&quot;: &quot;1234567,89&quot;,<br>  &quot;currency&quot;: &quot;EUR&quot;,<br>  &quot;value_date&quot;: &quot;2020-10-07&quot;<br>}</pre><p>You can look back at the original message and see where the relevant data was originally stored. Our services surely have a much easier time working with the parsed data.</p><h3>The operational layer</h3><p>And finally, this is where we handle the transfers themselves: checking if the operation is valid and permitted, crediting the customer’s account, and triggering notifications.</p><p>This layer <strong>does not need to know</strong> about the network connection, or the structure of the SWIFT messages. It has access to a simple set of normalised data that can be easily manipulated, reducing considerably its scope and the occurrence of bugs.</p><h3>Does it sound familiar?</h3><p>If you squint, you might notice some similarities with the <a href="https://en.wikipedia.org/wiki/Hexagonal_architecture_(software)">hexagonal</a> software architecture. In fact our design was inspired by that architecture, except instead of code, functions, namespaces, we are dealing with microservices and Kafka topics.</p><figure><img alt="Depiction of Hexagonal architecture with 3 layers: Ports, Adapters, Domain" src="https://cdn-images-1.medium.com/max/1024/1*DUYGAfLvdyc_1wydO9C9xQ.png" /></figure><p>The connector layer is the port, and the parser layer is the adapter, and everything is abstracted away from the operational layer (the innermost layer in the hexagonal architecture). We get the same benefits where our services are <strong>decoupled</strong>, controlled by the <strong>data flow</strong>, and each individual piece ends up being easier to reason about on its own.</p><h3>Conclusion</h3><p>Good engineering practices often find their way to help in areas where one might not expect. By applying the principles of layering and separation of concerns to our microservices architecture, we were able to simplify our reasoning about the whole product. Working with smaller logical pieces and straightforward data, Qonto can provide a more <strong>robust</strong> system and a better experience for all our customers.</p><p>✅ <strong>About Qonto<br></strong><a href="https://qonto.com/en">Qonto</a> is a neobank for SMEs and freelancers founded in 2016 by Steve Anavi and Alexandre Prot. Since the launch in July 2017, Qonto has made business banking easy for more than 120,000 companies. Thanks to Qonto, business owners save time (streamlined account opening before a day-to-day user experience with unlimited history, accounting exports, expense management feature), have more control while giving their teams autonomy (real-time notifications, user right management system) and have improved visibility on cash-flows (smart dashboards, transactions auto-tagging, and cash-flow monitoring). They also enjoy stellar customer support, at a fair and transparent price.</p><p>Interested in joining a challenging and game changer company? Consult our <a href="https://qonto.com/en/careers">job offers</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd1c0adcc64b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qonto-way/receiving-international-transfers-at-qonto-our-swift-architecture-cd1c0adcc64b">Receiving international transfers at Qonto: our SWIFT architecture</a> was originally published in <a href="https://medium.com/qonto-way">The Qonto Way</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>