<?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 Michał Baran on Medium]]></title>
        <description><![CDATA[Stories by Michał Baran on Medium]]></description>
        <link>https://medium.com/@baranmichal?source=rss-33d49df08b0e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*wbaotbd_eQORFS5J</url>
            <title>Stories by Michał Baran on Medium</title>
            <link>https://medium.com/@baranmichal?source=rss-33d49df08b0e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 03:49:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@baranmichal/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[A Practical Approach to Increasing Team Autonomy with Command-Based Notifications Service]]></title>
            <link>https://medium.com/xapolabs/a-practical-approach-to-increasing-team-autonomy-with-command-based-notifications-service-36808f244285?source=rss-33d49df08b0e------2</link>
            <guid isPermaLink="false">https://medium.com/p/36808f244285</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[domain-driven-design]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Michał Baran]]></dc:creator>
            <pubDate>Thu, 27 Apr 2023 09:12:59 GMT</pubDate>
            <atom:updated>2023-06-27T09:24:36.681Z</atom:updated>
            <content:encoded><![CDATA[<p>Most likely, all companies that sell products send notifications of any kind to their clients. Unless the company’s primary focus is on sending notifications, customer communication is likely considered a “supporting” bounded context. This shouldn’t take up too many resources, allowing the team to concentrate on other domains of the business that <strong>generate revenue</strong>, which is known as “core” bounded contexts. The client communication bounded context, which involves sending various types of notifications such as emails, push notifications, in-app notifications, and text messages (SMS), can be implemented in multiple ways.</p><h3>Every team integrates its own notification system</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AsMO1wAUNnZkyRouXThCyg.jpeg" /></figure><p>Integrating notifications independently in each team has advantages, such as not relying on other teams and being able to add new notifications to the team’s backlog whenever necessary. However, this approach also has a disadvantage that is not as obvious — responsibility and ownership are dispersed among all teams. It is unclear which team should take responsibility for solving issues such as exceeding the API rate limit. In a monolithic architecture, this approach may work since there is only one codebase and one SDK used by multiple teams. However, in a microservice architecture, the goal is not simply to divide the monolith into microservices but to build microservices based on bounded contexts that reflect actual business functionality in the company.</p><h3>Centralized notification service</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vAoyvPKNNkJpXQIFe8rURg.jpeg" /></figure><p>This approach offers a solution to the problem of dispersed responsibility as one team will be in charge of maintaining the service. However, it leads to a team cooperation issue where other teams might get stuck waiting on the notification service team to implement new notifications or the team that owns the notifications service have totally different priorities. It’s also not ideal to force other teams to contribute to the notification service as it takes time for them to learn and can cause bottlenecks like waiting for the code review. This can result in more engineering power being focused on the “supporting” domain rather than the more important “core” domains. Ideally, a solution that doesn’t require modification to the notification service would be preferred, allowing each team to focus on their priorities and only modify their own services as necessary. This would eliminate the need to worry about issues like external vendor API implementation, throttling, retrying, monitoring, and other related matters.</p><h3>The centralized event-based notification service</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gulxu8Tv0CJ54EYwEQJ9BA.jpeg" /></figure><p>In a microservice architecture, it’s common to have services communicate with each other using events. When important actions occur, like a user registering, services produce events that are sent to a queue. This can result in a large number of events covering most of the implemented business processes, which may lead to a desire to build an event-based notification service. However, teams built on bounded contexts in a DDD-aligned system aim not only to separate functionalities but also to provide autonomy for each team to make changes. There are two approaches to the event-based notification service.</p><p>The firs option is for the dedicated team that manages the notification service to handle any changes. This would require team members to grasp the intricacies of the event-producing service in order to determine when to trigger notifications. This can be a significant cognitive burden, particularly in complex domains such as cryptocurrency.</p><p>The second approach is that the notification service is owned by a dedicated team (Team B), but a member of another team (Team A) who is responsible for that sophisticated service may implement a new notification. This approach reduces cognitive load compared to the first approach, but Team A still needs to learn how the notification service works, contribute to it, and wait for Team B’s approval, which does not provide complete autonomy.</p><p>Furthermore, notifications frequently demand supplementary details such as currency and amount, and generally, all the necessary data is sent with the event. Regrettably, there are cases where the required information is missing. It is logical to include currency and amount in a sample event that reports money withdrawal. However, an issue arises when a notification necessitates a property that doesn’t fit within a specific bounded context, or when it is impossible to obtain the information at all. For instance, the current account balance is calculated in a different service after a money withdrawal, where generating another event for balance calculation is redundant.</p><h3>The centralized command-based notification service</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Snp7FUMG6bb2gUuYQoN2eg.jpeg" /></figure><p>To address the issue of lack of autonomy, a command-based notification service can be used. With this approach, Team A does not have to rely on Team B for implementation or contribute to a codebase that they are not familiar with when integrating a new notification. Instead, they can produce a message to a dedicated queue, which the notification service will use to send the notification to the user. The communication can be either asynchronous (queue-based) or synchronous (HTTP-based, such as REST). The notification service will handle retrying in case of downtime and throttling if traffic increases or if the API rate limit is exceeded. Changes to the API can be made in one place, and it will be clear which team is responsible for making those changes. This approach follows the Open Host Service (OHS) pattern, where an upstream (Team B in this case) provides an open API that downstream teams can consume.</p><p>Despite the benefits, this approach also has some disadvantages. When a new type of notification is added, the notification service might need to be modified, which means that Team B will have to handle the modification request. This means that every change request will add to Team B’s backlog. However, notification channels do not change as frequently as new notifications are introduced.</p><p>Some notifications, such as OTP, are critical and must be received immediately, while for others, a delay of a few seconds or even minutes may not be significant. As traffic increases, a single queue may become a bottleneck, not due to infrastructure limitations, but due to a lack of notification prioritization. To avoid being blocked by less important notifications, such as birthday wishes, critical notifications can be sent via a dedicated queue.</p><p>If you’re interested in learning more about Xapo Bank — Bitcoin Bank providing simple and safe usability to retail customers, explore the resources at <a href="http://xapobank.com/">xapobank.com</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36808f244285" width="1" height="1" alt=""><hr><p><a href="https://medium.com/xapolabs/a-practical-approach-to-increasing-team-autonomy-with-command-based-notifications-service-36808f244285">A Practical Approach to Increasing Team Autonomy with Command-Based Notifications Service</a> was originally published in <a href="https://medium.com/xapolabs">XapoLabs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why to use ACL the Anti Corruption Layer]]></title>
            <link>https://medium.com/xapolabs/why-to-use-acl-the-anti-corruption-layer-1348fbaebf4e?source=rss-33d49df08b0e------2</link>
            <guid isPermaLink="false">https://medium.com/p/1348fbaebf4e</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Michał Baran]]></dc:creator>
            <pubDate>Fri, 10 Mar 2023 11:52:19 GMT</pubDate>
            <atom:updated>2023-06-27T08:01:43.960Z</atom:updated>
            <content:encoded><![CDATA[<p>The ACL is a layer that translates the language of external bounded context API or external vendor API into its own language. In some cases such as statuses and error codes might stay the same. That might suggest that this whole translation doesn’t make any sense. I will prove that it does.</p><h3>When to use ACL?</h3><p>- The short answer is <strong>always</strong> when you consume external API.</p><p>Imagine a situation when you need to implement phone verification. You need to use some third-party vendor that provides you with the functionality of spending SMSs with OTP. In Domain Driven Design such functionality will probably be located inside the bounded context responsible for identity management, authorization, and authentication. For the sake of example, let’s call it “Identity management” bounded context. The high-level architecture will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e7m6zSqUJj_jNFgM" /></figure><p>Such functionality of verifying phone numbers can be used in many places, for example during onboarding, to authorize sensitive changes in the user profile, or to authorize a bank transfer. Let’s imagine that there is another bounded context responsible for processing bank transfers, let’s call it the “Bank transfer processing” bounded context. There must be a backend service that is responsible for processing transfers and some BFF that serves the nice API for web and mobile apps. The high-level architecture will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*C4P93sn0MGGFxCzz" /></figure><p>Now, imagine that the phone verification service simply proxies the statuses and error codes from an external vendor and exposes it in its API. The bank transfer service does the same, and the BFF does too. Both mobile and web apps hardcode these statuses and error codes. The dependency tree will look more or less like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LSlYnEkA_IvJfGX5" /></figure><p>We have no control over the vendor’s API at all, so imagine what will happen if they decide to change the API. Ok, API is versioned, they shouldn’t do a backward incompatible change… But at some point, the API version might get deprecated, and later on… removed. So, upgrading the API will require changes in the phone verification service, bank transfer service, the BFF, web app, and… Force update apps since they hardcoded the statuses and error codes.</p><p>The phone number verification service will probably be storing each verification with the status, error codes, etc. If any of that changes there will be inconsistency in the data. The data analysis reports might break as well.</p><h3>What benefits the ACL usage bring?</h3><p>In desired architecture, the phone verification service should isolate the external API and translate its statuses into its own ones, even if initially the internal statutes are the same as the external ones. Since the Bank transfer service belongs to another bounded context it should implement its own ACL as well. Again, at the beginning statuses might be the same. But, maybe we would like to hide some technical details and expose only a few statutes out of all in the bank transfer service. Maybe there is no need to handle all error codes or some of them can be mapped into one error code. Taking this approach the dependency tree will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cFtPW2wPjcf-5SFy" /></figure><p>Coming back to the example of deprecating API, if the external API changes, for any reason, the only place that needs to be changed is the phone verification service. It will map the new statuses to keep the contract and no other changes should be done. The team that owns the Bank transfer bounded context shouldn’t even be aware that such a change has happened.</p><p>If you’re interested in learning more about Xapo Bank — Bitcoin Bank providing simple and safe usability to retail customers, explore the resources at <a href="http://xapobank.com/">xapobank.com</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1348fbaebf4e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/xapolabs/why-to-use-acl-the-anti-corruption-layer-1348fbaebf4e">Why to use ACL the Anti Corruption Layer</a> was originally published in <a href="https://medium.com/xapolabs">XapoLabs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>