<?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 Elior Boukhobza on Medium]]></title>
        <description><![CDATA[Stories by Elior Boukhobza on Medium]]></description>
        <link>https://medium.com/@Mallowigi?source=rss-3df41db01abf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*1TSZ6zFRkTcT1zsDIToODA.jpeg</url>
            <title>Stories by Elior Boukhobza on Medium</title>
            <link>https://medium.com/@Mallowigi?source=rss-3df41db01abf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 10:38:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Mallowigi/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[Transforming Architecture: A Journey from Monolith to Microservices]]></title>
            <link>https://medium.com/dynamicyield-techblog/transforming-architecture-a-journey-from-monolith-to-microservices-fab487c75b82?source=rss-3df41db01abf------2</link>
            <guid isPermaLink="false">https://medium.com/p/fab487c75b82</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[monolith]]></category>
            <dc:creator><![CDATA[Elior Boukhobza]]></dc:creator>
            <pubDate>Sat, 18 Jan 2025 16:52:13 GMT</pubDate>
            <atom:updated>2025-01-21T07:55:01.834Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d_3LRwHQcahb_6OoeRf75w.png" /></figure><p>Migrating from one infrastructure to another is not a trivial task. There are a lot of factors to take into consideration: time, complexity, pricing, and so on. But it’s something that every company will have to deal with one day or another.</p><p>As someone familiar with Dynamic Yield’s evolution throughout the years, I got to experience first-hand the shortcomings of monolith architectures, so I was more than willing to find a more suited, scalable solution for this problem.</p><p>In recent years, <strong>microservices</strong> have emerged as a popular architecture approach for building scalable infrastructures. It involves dividing big applications into multiple distinct, independent blocks called “Microservices,” offering several benefits over a classic monolithic architecture, such as scalability, isolation, or independence.</p><p>In this post, I’ll explore the advantages and disadvantages of both approaches and showcase the difficulties encountered during the transition and how we tackled them.</p><h3>What are microservices?</h3><p>Microservices architecture revolves around building an architecture consisting of independent blocks called [services] that specialize in one or more specific <strong>domains</strong>.</p><p>In <a href="https://blog.bitsrc.io/demystifying-domain-driven-design-ddd-in-modern-software-architecture-b57e27c210f7">Domain-Driven Design (DDD</a>), a domain represents a specific part of the business that is disjointed from other parts of the application and can be easily isolated into its own environment without impacting other parts of the business.</p><p>For example, a typical application can be divided into the following domains:</p><ul><li>User management</li><li>Payment services</li><li>Auditing</li><li>Marketing campaigns</li></ul><p>By determining the bounds of a domain, it becomes easier to split an existing monolithic architecture into various isolated components that live independently of each other.</p><p>This means that microservices are not only about picking a tech stack for your app. You need to understand the unique processes of your business model in order to mold your architecture into separate, isolated processes.</p><p>Doing so creates a distributed architecture where your services no longer have to be deployed together to a single target but instead are deployed separately into their own services, reducing friction between the business components.</p><h3>The advantages</h3><p>There are many advantages to adopting such an approach. Let’s break it down:</p><ol><li><strong>Complexity</strong>: Large infrastructures take a huge toll on complexity. Components are often tangled with each other, adopting different conventions and styles and making understanding a tedious and difficult process. By isolating components into their own service, you reduce the mental toll of having to understand the whole system by instead focusing only on the part that interests you.</li><li><strong>Team isolation</strong>: As companies grow, teams are formed to focus on specific parts of the business. They shouldn’t have to worry about affecting unrelated parts of the system with their changes, which would often happen in classical monolithic architectures.</li><li><strong>Deployment isolation</strong>: In monolithic architectures, every change requires updating the whole system. This process is generally long and meticulous and can be dangerous. If a fault occurs, the whole system is affected. Splitting into separate services allows them to be deployed at their own pace without affecting the other components.</li><li><strong>Technology independence</strong>: Large architectures are often stuck on a specific tech stack that can be very difficult to update as the software grows throughout the years. Any change can have unforeseen consequences. Microservices allow them to each have their own tech stack and infrastructure, making the process much simpler and more open to changes.</li><li><strong>Fault tolerance</strong>: In a monolithic architecture, any issue can have disastrous repercussions. If a specific part of the system is down or faulty, the whole system is unavailable. In a distributed architecture, only the affected components will be unavailable, drastically reducing error rate and downtime.</li><li><strong>Scalability</strong>: Handling a large system requires a lot of resources and a very meticulous process. Deployments have tight schedules, and tight resource management and strict monitoring are required. By splitting into independent processes, each service has its own resources and schedule and can be scaled according to the situation.</li></ol><p>But there are also a few drawbacks:</p><ol><li><strong>Understanding challenges</strong>: Decoupling makes better isolation, but it also creates some challenges for understanding. In a centric system, all information is concentrated in the same place. In a distributed system, it becomes harder to find which service contains the requested information.</li><li><strong>Management</strong>: While microservices make it easier to deploy specific parts of the system in isolation, it becomes harder when you need to update or deploy them all at once. Dependency management becomes repetitive and prone to mistakes.</li><li><strong>Communication</strong>: Lastly, communication is critical in a distributed architecture. What was easily available in a monolithic architecture now requires more hoops to jump through to retrieve that information. Should services talk to each other? How can they communicate? What happens if one service changes its contract? These are all valid questions that might arise when migrating to microservices.</li></ol><p>Now that we’ve understood things better, how do we achieve this result?</p><h3>Our approach</h3><p>The first step in building a microservices architecture is to break down the monolith into a set of discrete logical domains.</p><p>In Dynamic Yield, we have a large range of applications for the needs of all kinds of customers:</p><ul><li>E-commerce websites</li><li>News websites</li><li>API consumers</li><li>Email marketers</li><li>etc.</li></ul><p>Our first solution was to split the application into several smaller applications for each kind of customer. This would make business parts truly independent of each other. However, doing so created a few problems:</p><ul><li><strong>Duplication</strong>: Some parts would be duplicated across customer types (users, assets, etc…)</li><li><strong>No clear boundaries</strong>: Some customer types require more handling than others, so we could end up with “smaller monoliths”.</li><li><strong>Lack of extensibility</strong>: What if a web-only customer decides to implement some API parts?</li></ul><p>Therefore, rather than grouping elements by <em>business</em>, we decided to group elements by <em>purpose</em>:</p><ul><li>User management (authorization/authentication)</li><li>Assets management</li><li>Identity management (sites, accounts)</li><li>Campaigns</li><li>External resources (feeds, templates, etc…)</li></ul><p>In a nutshell, it looked like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/0*x4FkmVPjUP3dH4xm" /><figcaption>Dynamic Yield’s Backend architecture</figcaption></figure><p>As you can see, rather than one service does-it-all, each service lives independently of the other and can only be accessed with the help of <strong>Gateway Services</strong>.</p><h3>Gateway Services</h3><p>Our second approach was to use<strong> Gateway Services</strong>, also called <em>Aggregators</em>, to provide a supplementary abstraction layer between microservices and the outside world. The purpose of these services is to hide the internal microservices and provide tailored APIs to access the different components of the architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/0*--uuTl-zwYLHdNwK" /><figcaption>Gateway Services (source: <a href="https://amplication.com/blog">Amplication</a>)</figcaption></figure><p>Using Gateways rather than giving direct access to the microservices provides many advantages:</p><ul><li><strong>Enhanced security</strong>: The gateways are the first line of defense against threats. They can provide <em>Authentication</em>, <em>Authorization</em>, <em>Rate-limiting</em>, <em>Load Balancing</em>, <em>Caching</em>, etc., to control access to the microservices.</li><li><strong>Better monitoring</strong>: With a lot of microservices, it can be challenging to find the causes of problems. Gateways can alleviate these issues via monitoring tools such as logs, metrics, and telemetry, providing a better view for developers and operations teams alike.</li><li><strong>Composition</strong>: Microservices should focus solely <strong>on their domain</strong>. They shouldn’t know what other microservices do or can provide, nor how to access them. That is the job of the gateways: they should be able to query one or multiple microservices and compose the responses according to the business logic.</li><li><strong>Implementation abstraction</strong>: The APIs should not know how they will be used. They should be agnostic and only focus on their business logic. The ones responsible for constructing the responses for the clients should be the <strong>gateways</strong>.</li></ul><p>Long story short, gateways act as client-facing endpoints that aim to simplify Client-to-Service communication, and microservices can only connect to each other through the gateways.</p><p>Our first use case of Gateway services was to replace the component of our monolith Ruby application that provides search functionalities to our entities, such as Campaigns, Goals, Templates, Feeds, etc.</p><p>This was the traditional way of managing microservices. However, this presented a few problems as well:</p><ul><li>As microservices were being added, the gateway gradually became bigger, to the point of becoming a “mini-monolith”.</li><li>In addition, if there was a problem with the gateway (such as conflicts, faulty code, or a problem in the data), everything could go down, which beat the point of the splitting to begin with…</li><li>Gateways should only communicate with microservices and compose the responses accordingly. However, as the number of clients and use cases increase, the gateway can easily become complex and convoluted.</li></ul><p>So after identifying these flaws, we investigated and learned about a new, recent pattern that emerged to handle these pain points: <strong>MicroGateways</strong>.</p><h3>MicroGateways</h3><p><em>The BFFs</em></p><p>MicroGateways, also coined with the term “<strong><em>BFF</em></strong>” (Backend-For-Frontend), provide a supplementary level of abstraction between the Clients and the Gateways (or the microservices directly).</p><p>Their main purpose is to provide fine-tuned responses for each client, independently of the main gateway or the microservices.</p><p>Not only would this pattern help us reduce bottlenecks, but more importantly, it would provide a new level of isolation, empowering teams to work more independently and improving productivity and developer satisfaction.</p><p>The following illustration depicts the advantages of this pattern:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/0*ExviRAy7mip9h24R" /><figcaption>Traditional Architecture VS BFF</figcaption></figure><p>In this figure, we see that we have three BFFs, each for a separate use case. They provide the following benefits:</p><ul><li><strong>Agility</strong>: These services are small and can be added or removed with ease.</li><li><strong>Scalability</strong>: They reduce the load on the main gateway, thus minimizing overhead and latency.</li><li><strong>Deployment</strong>: They are independent of each other and can be deployed separately without disruption.</li><li><strong>Customization</strong>: Each BFF has its own implementation and requirements and is catered to a specific client.</li><li><strong>Ownership</strong>: They have ownership of the same team that implements the client side, thus removing cross-team dependency.</li></ul><p>In Dynamic Yield, we started with one big gateway, naively named “Adm API.” Later, as the service started growing and becoming increasingly complicated, this BFF pattern proved to remove a significant load on our shoulders, providing teams with independence over the backend side.</p><p>This, in turn, increased developer satisfaction and simplified microservices management, and it is now used as an example of a successful microservices architecture implementation for other departments.</p><h3>Conclusion</h3><p>Going from a monolithic architecture to a distributed one is challenging. While having everything in one place is easier, as companies and products grow, it can rapidly become a hassle.</p><p>Nowadays, many companies have already made the move and are here to share their experiences with the world to assist with the transition. Thanks to that, we managed to migrate a very complicated system into smaller, discrete sub-systems and implemented the right tools to facilitate communication between them.</p><p>I hope that this post gave you a better overview of the process and shed some light on the key advantages and drawbacks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fab487c75b82" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dynamicyield-techblog/transforming-architecture-a-journey-from-monolith-to-microservices-fab487c75b82">Transforming Architecture: A Journey from Monolith to Microservices</a> was originally published in <a href="https://medium.com/dynamicyield-techblog">DynamicYield Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>