<?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 Ihar Sadounikau on Medium]]></title>
        <description><![CDATA[Stories by Ihar Sadounikau on Medium]]></description>
        <link>https://medium.com/@isadounikau?source=rss-276e484aa5ad------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*H0DVbtdy5ngSxloMmoDiMw.jpeg</url>
            <title>Stories by Ihar Sadounikau on Medium</title>
            <link>https://medium.com/@isadounikau?source=rss-276e484aa5ad------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 18:30:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@isadounikau/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[Must have AI tools]]></title>
            <link>https://medium.com/swlh/must-have-ai-tools-f5505a6437e1?source=rss-276e484aa5ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5505a6437e1</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Ihar Sadounikau]]></dc:creator>
            <pubDate>Mon, 08 Apr 2024 11:00:28 GMT</pubDate>
            <atom:updated>2024-04-08T11:00:28.673Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Once men turned their thinking over to machines in the hope that this would set them free. But that only permitted other men with machines to enslave them.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aJEJCKUhvL2d20zOe4Redw.jpeg" /><figcaption>Evolve &amp; Adapt</figcaption></figure><p>Over the past decade, the speed of life has increased dramatically. And AI takes it even higher. While studying, my parents ate books to gain the necessary level of knowledge. The main skill of my generation is searching for information, we don’t need to process book after book, but we need to know where to find the right knowledge. AI is taking knowledge acquisition to new heights. And the ability to effectively use AI is becoming a must-have skill for professional growth.</p><p>Each person’s AI needs are unique, some need help creating music or writing a book. Others with optimizing routines or increasing creativity. So I can’t advocate for a perfect set of AI tools and am going to share my personal top 5 FREE AI tools for my day to day work in the world of software engineering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nM2b_s2QtWgOZKJ6_ui5jw.png" /><figcaption><a href="https://chat.openai.com/">https://chat.openai.com</a></figcaption></figure><p><a href="https://chat.openai.com/">ChatGPT</a> — is the most useful tool. It is the current leader in content generation. I love to use it on daily basis, probably like googling. It can give a brief overview of technology or specific product, build a skeleton or plan for future. For example the next set of usecases ChatGPT gives for a simple prompt question: <em>What are the top 5 problems that ChatGPT can help a software engineer?</em></p><ol><li><strong>Code Assistance and Troubleshooting</strong></li><li><strong>Documentation and Knowledge Retrieval</strong></li><li><strong>Code Review and Feedback</strong></li><li><strong>Project Management and Task Tracking</strong></li><li><strong>Idea Generation and Problem Solving</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*gwtdYdNzKY6KeelxS5CXpA.png" /><figcaption><a href="https://www.codium.ai/">https://www.codium.ai</a></figcaption></figure><p>Code writing is important part of my workdays. And AI optimisation allows me to eliminate a significant part of routine tasks from my daily work. Initially I started with Copilot during my first steps into AI development. However, recurrent payment becomes necessary after the end of the technical period. Therefore I replaced Copilot with <a href="https://www.codium.ai/">Codium</a>. Both tools provide incredible support in code generation. And the most important <a href="https://www.codium.ai/">Codium</a> tool has straightforward integration abilities with <a href="https://www.codium.ai/install/intellij/">Intellij Idea</a> and <a href="https://www.codium.ai/install/vs-code/">VS Code</a>:</p><ol><li><a href="https://www.codium.ai/install/intellij/">https://www.codium.ai/install/intellij/</a></li><li><a href="https://www.codium.ai/install/vs-code/">https://www.codium.ai/install/vs-code/</a></li><li>And others</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*omSfCBYh8-Z6fHnMtlHecg.gif" /><figcaption><a href="https://github.com/Codium-ai/codiumai-vscode-release">https://github.com/Codium-ai/codiumai-vscode-release</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*CdeKxkYFrx3KjEVE.png" /><figcaption><a href="https://tome.app/">https://tome.app</a></figcaption></figure><p>But code is not everything. Presentation of ideas and solutions takes a major part of my time at work. Thus presentation generation AI becomes highly valuable tool for me. <a href="https://tome.app/">Tome App</a> managed to fulfil the missing gap of presentation generation instruments. It is free as well and easy to use. The most important is create clear vision of requirements and write as mush as possible explicit instructions. Of course the result is not even close to ideal. However amount of saved time is incredible. And it allows to spend released time on more valuable and meaningful information about a presentation topic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*eVfmiJXD49LeWokAvUM_dw.png" /><figcaption><a href="https://playground.com/">https://playground.com/</a></figcaption></figure><p>And of course images. Every presentation or document feels empty without graphical filling. Most powerful and famous Images generators are <a href="https://www.midjourney.com/home">Midjourney</a> and <a href="https://stability.ai/">Stable Diffusion</a>. However first require monthly subscription and second requires own server configuration. And <a href="https://playground.com/">Playground AI</a> doesn’t has those limitations and easy to use. Probably it is as powerful as top players, but Playground AI does required work perfectly fine for simple graphical filling in presentations.</p><p>Obviously the tool has limits, and it is <strong>100 images per day.</strong> What is quite generous on my opinion. I asked <a href="https://playground.com/">Playground AI</a> to generate an example of me writing this article. <em>Even sample is quite good, I didn’t manage to get rid of beard</em> 😅</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LXEkDkJx9By1btnp.jpeg" /></figure><p>The conclusion is simple. AI in its current state is not a replacement for human labor, AI is just a tool. And as we got used to computers and smartphones, we should also get used to artificial intelligence tools in our lives.</p><ol><li><a href="https://chat.openai.com/">https://chat.openai.com</a></li><li><a href="https://www.codium.ai/">https://www.codium.ai</a></li><li><a href="https://github.com/features/copilot">https://github.com/features/copilot</a></li><li><a href="https://playground.com/">https://playground.com</a></li><li><a href="https://www.midjourney.com/home">https://www.midjourney.com</a></li><li><a href="https://stability.ai/">https://stability.ai</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5505a6437e1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/must-have-ai-tools-f5505a6437e1">Must have AI tools</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Travel Easy With VPN]]></title>
            <link>https://medium.com/swlh/travel-easy-with-vpn-52c6f33f2bc3?source=rss-276e484aa5ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/52c6f33f2bc3</guid>
            <category><![CDATA[free]]></category>
            <category><![CDATA[router]]></category>
            <category><![CDATA[vpn]]></category>
            <category><![CDATA[travel]]></category>
            <category><![CDATA[vps]]></category>
            <dc:creator><![CDATA[Ihar Sadounikau]]></dc:creator>
            <pubDate>Thu, 28 Mar 2024 22:42:52 GMT</pubDate>
            <atom:updated>2024-03-28T23:11:43.327Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2EGikjXosB-78D_j6GPpbw.png" /></figure><blockquote>“To expect the unexpected shows a thoroughly modern intellect”</blockquote><p>The quote comes from Oscar Wilde and was said over a century ago. Unfortunately, modern intellect dictates the need for a backup plan in our extremely limited world. The Internet was supposed to be a source of freedom of speech and a free space from government communication. And the authorities turned it into a terrifying propaganda tool.</p><p>The solution is not simple. However, we can get a breath of fresh air with a basic VPN. I’m not a fan of difficult solutions. Complexity always brings problems and frailness.</p><p>Today I want to share with you an easy way to set up a VPN for home/travel with the following steps:</p><ol><li><a href="https://www.gl-inet.com/products/gl-mt300n-v2/">N300 Mini Wireless Router</a> — 34.90€</li><li><a href="https://amnezia.org/">Amnezia VPN</a> — Free</li><li><a href="https://ishosting.com/en?aff_sub=6605beabe2e88e000181c9da&amp;pid=2240">Is*hosting VPS</a> — 5€ per month</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YSauCb58aCDEZ5C3n2kdWA.jpeg" /></figure><p>The most important part of the article is the <a href="https://www.gl-inet.com/products/gl-mt300n-v2/">router</a>. And I don’t want to beat around the bush and I’m going to share the kill-features straight away:</p><ol><li><strong>Size</strong> - 6x6cm</li><li><strong>Laptop USB power</strong> compatible</li><li><strong>Wireguard &amp; OpenVPN clients</strong> with integrated providers</li><li><strong>Internet Kill Switch</strong>, no VPN — no internet</li><li><strong>Cable, Wifi, Tethering and 3g/4g Modem</strong> connectivity</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oj3EWAxmM7fJLLsow75R2A.png" /></figure><p>The router is the perfect fit for traveling. It’s easy to set up and doesn’t require an extra plug. All you need to do before your trip is pre-set up your VPN client, enable Internet Kill Switch and that’s it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kqr_smadkXecfA9yptO2_Q.png" /><figcaption>For a simple setup just follow provider instructions</figcaption></figure><p>Most of the time my personal work setup looks like this: laptop, router and iPhone with hotspot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NWi9XPgt4AWnlTSBhtnw_w.jpeg" /><figcaption>Nothing Extra</figcaption></figure><p>If you prefer to use one of the configured VPN providers, there is nothing more to read. You just need to follow the pre-set instructions and enjoy privacy during your trip.</p><p>Personal VPN server is a bit more complicated to configure, but nothing impossible. The correct tooling makes the configuration smooth and simple. I have tried several approaches like, <a href="https://www.wireguard.com/quickstart/">manual VPN server setup</a>, <a href="https://github.com/trailofbits/algo?tab=readme-ov-file#deploy-the-algo-server">semi-automated</a> and <a href="https://amnezia.org/en/instructions/0_starter-guide">fully automated</a>. The last option is the most suitable for majority of VPN users. And lately I use <a href="https://amnezia.org/en">Amnezia</a> for personal server setup.</p><blockquote>Amnezia VPN — simple and free app to run a self-hosted VPN with high privacy requirements</blockquote><p>The installation requires to download the <a href="https://amnezia.org/en/downloads">Amnezia app</a>, and follow detailed instructions for initial setup. Amenzia doesn’t provide own hosting solution therefore we are required to host our own server with publicly available VPS providers. I personally use <a href="https://ishosting.com/en?aff_sub=6605beabe2e88e000181c9da&amp;pid=2240">Is*hosting</a> as it has hight region selection variety. The step by step hosting guide is available <a href="https://amnezia.org/en/instructions/0_starter-guide">here</a>.</p><blockquote><a href="https://amnezia.org/en/instructions/0_starter-guide">https://amnezia.org/en/instructions/0_starter-guide</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C-ZK3KdT89zcAWztcP93Yw.png" /><figcaption>Select One You Like</figcaption></figure><p>After finishing setup guide you will need to setup you router with your personal VPN server configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GRTsRMQLPQkYRGRRsvHVOA.png" /><figcaption>Example of Wireguard Protocol Configuration</figcaption></figure><p>And that’s all. Your personal VPN server and router VPN client are ready to give you back your privacy.</p><p>In conclusion I would like to say, VPN is turning from nice to have to must to have tool in our life. Due to new technology, aggressive marketing and world situation — privacy becomes luxury. And I hope this article will help you take back your privacy in a simple, effective and affordable way.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52c6f33f2bc3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/travel-easy-with-vpn-52c6f33f2bc3">Travel Easy With VPN</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microservices Integration Testing & Spring Boot]]></title>
            <link>https://medium.com/swlh/microservices-integration-testing-spring-boot-404b6f8617d1?source=rss-276e484aa5ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/404b6f8617d1</guid>
            <category><![CDATA[integration]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[testcontainer]]></category>
            <category><![CDATA[spring]]></category>
            <dc:creator><![CDATA[Ihar Sadounikau]]></dc:creator>
            <pubDate>Mon, 01 Jun 2020 11:35:11 GMT</pubDate>
            <atom:updated>2020-06-14T19:31:43.053Z</atom:updated>
            <content:encoded><![CDATA[<h3>Docker Power for Spring Boot Integration Testing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v9wVGLLMW6OJ8X18" /><figcaption>Photo by <a href="https://unsplash.com/@souravdnath1?utm_source=medium&amp;utm_medium=referral">Sourav Debnath</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Spring Boot is a well-known and overpowerful server-side framework. And nowadays it has been used more and more in microservices systems. And no matter how the system is built it has to be tested. So how would you prefer to test your microservices system with hundreds of isolated components? I would like to take a bit of your attention for Spring Boot &amp; Docker combinations for integration testing of different system components</p><p>Before going to the real examples I would like to give a bit of the context. Like many other engineers, I encountered problems in the testing of individual microservices in isolation from an entire system. Especially if the system had existed for years and contained quite a lot of legacy code. So here several problems teams faced:</p><ul><li>Almost all business logic was covered only by unit tests, and each change in the code without changes in business logic led to additional overhead with changes in the behavior of many unit tests, which did not make any sense</li><li>On one hand, the company has been fast-growing, therefore the majority of engineers were new and not familiar with the system. On the other hand, some of the guys with most of the knowledge about the system already left, and the rest of them simply didn’t have enough knowledge about already implemented features. Therefore code refactoring was a risky, complicated, and unsafe procedure. So most of the feature decisions have followed the rule “works — do not touch”. Because of it, technical dept has grown massively</li><li>Most of the “<em>integration tests</em>” were useless, they had a lot of dependencies within other existing and live running systems and because of it the behavior of most of the tests was unpredictable and unstable</li></ul><p>So how could I improve the confidence and reliability of our services? As the first step, I decided to study whether anyone already faced the same problem and whether there are ready-made solutions in the modern world of microservice development. I read a lot of articles, and the next J.B. Rainsberger’s and André Schaffer’s articles impressed me the most</p><ul><li><a href="https://blog.thecodewhisperer.com/permalink/integrated-tests-are-a-scam">Integrated Tests Are A Scam</a></li><li><a href="https://labs.spotify.com/2018/01/11/testing-of-microservices/">Testing of Microservices</a></li></ul><p>They focus on rethinking the classic testing pyramid</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/242/1*gQIIXIZZgvO_aC-T-y6vTQ.png" /></figure><blockquote><em>Integrated test is a test that will pass or fail based on the correctness of another system</em></blockquote><p>If we consider the microservice structure as one big monolith, then we will conclude that classes in a classical monolithic service perform similar functions as microservices in a modern distributed architecture. And the most significant is testing the interaction between components, microservices in our case. Based on this, the idea of <strong><em>Honeycomb</em></strong> was born</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/282/1*OlUcOlh66kpgHyEqH9JARw.png" /></figure><p>But what can be used to recreate external dependencies? At the moment, the easiest way to configure and deploy components is the <a href="https://www.docker.com/">Docker</a>, so I began to explore its capabilities for integration testing of services. So I concluded that <a href="https://docs.docker.com/compose/">docker-compose</a> allows you to quite conveniently describe all the dependencies in a single file and run them if necessary</p><p><strong>Spring Boot &amp; Maven Docker Compose</strong></p><p>Configurations for external dependencies can be described at docker-compose.yaml file</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/41203c0a7bf6a5d1d47e5e8d07a5eb18/href">https://medium.com/media/41203c0a7bf6a5d1d47e5e8d07a5eb18/href</a></iframe><p>If the project builds by Maven, the next plugin will take all docker up and down management. It runs all containers before verify stage and shutdowns them after</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a4db1e48c9444b358ccee71cda9b988d/href">https://medium.com/media/a4db1e48c9444b358ccee71cda9b988d/href</a></iframe><p>And as always the decision had its pros and cons</p><p>Pros:</p><ul><li>Single description place of all dependencies</li><li>All data migrations are isolated and run only once</li><li>The solution allows you to deploy the service locally along with all the necessary external dependencies</li></ul><p>Cons:</p><ul><li>It is necessary to clear containers contents after every test run</li><li>The more complex process of running tests in the IDE</li><li>Constant ports conflicts</li></ul><p>The current solution already solves all mentioned above problems, however, it has some drawbacks. Therefore I come back to the alternatives research. And this led me to a rather interesting project — <a href="https://www.testcontainers.org/">Testcontainers</a>. The main idea is elegant and super simple, why do we need to use static YAML files when we can control the container’s dynamic life cycle from code</p><p><strong>Spring Boot &amp; Testcontainers</strong></p><p>The current approach requires an additional dependency at the project pom file and integration of all external components in the tests codebase</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7f07ef21cbe4a6356d53b8b2a3da4d55/href">https://medium.com/media/7f07ef21cbe4a6356d53b8b2a3da4d55/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/617a69bfbe0120ad7e615b4121f6fb06/href">https://medium.com/media/617a69bfbe0120ad7e615b4121f6fb06/href</a></iframe><p>Although the current solution did solve some issues, it still had several drawbacks</p><p>Pros:</p><ul><li>All data migrations are isolated and run only once</li><li>New containers will be launched for each new Spring Context</li><li>Run tests from the IDE in one click</li></ul><p>Cons:</p><ul><li>Bulky constructions to describe container launch rules</li><li>Opaque tincture of Spring Application Context files</li></ul><p>The combination of Testcontainers and Spring Boot seems to be super promising and I decided to dig deeper to solve existing shortcomings</p><p><strong>Spring Boot &amp; Testcontainers Spring Boot Library</strong></p><p>The result of all investigations and researches in the implementation of the next library — <a href="https://github.com/testcontainers/testcontainers-spring-boot">Testcontainers for Spring Boot</a></p><p>If the service external dependency is in the supported technologies list, then all you need to do is to add a maven dependency to your pom.xml and provide application configuration to application-test.yaml The library will take care of the rest of the work</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/85fb7e2ecd81c23b0418c48470d6d3c4/href">https://medium.com/media/85fb7e2ecd81c23b0418c48470d6d3c4/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b79377ee758c72b6205b244364aec7e8/href">https://medium.com/media/b79377ee758c72b6205b244364aec7e8/href</a></iframe><p>Pros:</p><ul><li>All data migrations are isolated and run only once</li><li>New containers will be launched for each new Spring Context</li><li>Run tests from the IDE in one click</li></ul><p>Cons:</p><ul><li>Not all technologies are supported by the library</li></ul><p>Solved problems:</p><ul><li>A lot of useless unit tests have been removed. Only critical parts of the implementation are covered by unit tests</li><li>The refactoring process is more confident and prevents a lot of problems before service deployment to a real environment</li><li>All integrated tests have been modified to be independent of external systems and performed stable and constant regardless of the state of a third-party system</li></ul><p><strong>Conclusion</strong></p><p>This trip was exciting and help to solve many of the problems of the existing product. As an ideal option for developing microservice integration testing, I would recommend using a combination of all the approaches above, docker-compose for local deployment of dependencies, Testcontainers Spring Boot Library for integration testing, and pure Testcontainers for dependencies that are not yet supported by the library</p><p><strong>Relevant links for further reading</strong></p><ul><li>I have found inspiration in J.B. Rainsberger’s article <a href="https://blog.thecodewhisperer.com/permalink/integrated-tests-are-a-scam">Integrated Tests Are A Scam</a> and André Schaffer’s <a href="https://labs.spotify.com/2018/01/11/testing-of-microservices/">Testing of Microservices</a>, maybe it will inspire you as well</li><li>Is it your first time with Docker? <a href="https://docs.docker.com/get-docker/">https://docs.docker.com/get-docker/</a></li><li>Do you want to know more about Testcontainers? <a href="https://www.testcontainers.org/">https://www.testcontainers.org/</a></li><li>Or maybe you already know it and want to try something more Spring Boot oriented?<br><a href="https://github.com/testcontainers/testcontainers-spring-boot">https://github.com/testcontainers/testcontainers-spring-boot</a></li><li>And Spock Framework <a href="http://spockframework.org/spock/docs/1.3/all_in_one.html">http://spockframework.org/</a> is super nice for <a href="http://spockframework.org/spock/docs/1.0/data_driven_testing.html">parametrized tests</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=404b6f8617d1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/microservices-integration-testing-spring-boot-404b6f8617d1">Microservices Integration Testing &amp; Spring Boot</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Coroutines and Kotlin: What this Means to Mobility]]></title>
            <link>https://medium.com/inside-freenow/coroutines-and-kotlin-what-this-means-to-mobility-74687ea3c06?source=rss-276e484aa5ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/74687ea3c06</guid>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[coroutine]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[free-now]]></category>
            <dc:creator><![CDATA[Ihar Sadounikau]]></dc:creator>
            <pubDate>Tue, 17 Mar 2020 10:39:34 GMT</pubDate>
            <atom:updated>2020-03-27T11:07:03.033Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m a Software Engineer for our Driver Operations Tribe in our Barcelona Tech Hub, where we focus on the FREE NOW Driver tools. Myself and the team strive to ensure that all of our drivers have all tools that are innovative, accurate and above all, a tool that they can rely on during their day to day work in whichever city they are working in. Of course, selecting and developing high-quality processes and software is key for the teams in Barcelona, so I shed some light on why FREE NOW decided to start using Coroutines to innovate the Driver Operations experience.</p><p><strong>What is Coroutines?</strong></p><p>Coroutines are one of the main Kotlin features now. They are lightweight threads. Coroutines can work in parallel, wait for other Coroutines and notify each other like threads. The biggest difference between Coroutines and threads is resource consumption. A huge advantage of Coroutines is that it is unbelievably cheap for the application processes. The application can create thousands of Coroutines without impacting performance. At the same time, threads are expensive and a thousand threads can be a problem even for a very powerful machine.</p><p><strong>Why Coroutines?</strong></p><p>We decided to use Coroutines because they are easy to implement, Coroutines do not waste resources of services and increase the performance of applications. Coroutines use atomic lightweight callback functions — continuations. Every continuation is managed by a state machine and can be suspended in the needs of service. It gives us the advantage of non-blocked threads services.</p><p><strong>Did we manage to solve our problems with Coroutines?</strong></p><p>Yes, we have! In a point of registration, we have to validate and revalidate a lot of incoming data across multiple services over and over. After a code analysis, we found that our validations are totally independent of each other and we as engineers can improve performance by providing an asynchronous way of communication between services, as a result of our code improvement with Coroutines, we got an incredible decrease of latencies around 40%. And it means our drivers have to spend less time in the registration process.</p><p><strong>How did we manage to achieve it?</strong></p><p>I will try to explain it with examples of one of our information services. Let’s take a look at the example of the initial sequential code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U5SBjwnMQpss5ScqDgrO2w.png" /><figcaption>Sequential code example</figcaption></figure><p>Code is easy to read and it contains a lot of external services API calls, as a result, we have a huge response latency around 1000ms per each request. Threads are blocked by other services until the response. We can find a way to fix it and one of the approaches will be the reactive pattern of communication between services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_u9lKvSxWQ4FRG2-Bufqog.png" /><figcaption>Reactive code example</figcaption></figure><p>Yes, right now we have an example of parallel non-blocking communication with a response time around 500ms, but code losses readability and business logic became much more complex. So we can try to solve it with Coroutines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7f6PEuk85U27gkKPNieSmQ.png" /><figcaption>Coroutines async-await example</figcaption></figure><p>As you can see the code didn’t change much from the sequential version, but we got a benefit of asynchronous communication between services. And here is one of the main strength of the coroutines approach, business logic can be clean, easy to read and asynchronous at the same time.</p><p><strong>Did we find something unexpected while implementing Coroutines in our services?</strong></p><p>Yes, we did! As a company, we are used to use MDC context for the logging process and with coroutines, we unexpectedly loosed it. It means we weren’t able to track our requests between services so easily as before. But after some research, we found a way to restore the context inside coroutines with additional Kotlin library for MDC context.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QOCn7OxKl1FAH3JcWDw9Dg.png" /><figcaption><em>Have fun and keep your code clean</em></figcaption></figure><p><strong><em>Are you interested in opportunities in mobility? Check out the open opportunities available across Europe and in our tech hubs in Barcelona, Berlin and Hamburg </em></strong><a href="https://free-now.com/de/career/"><strong><em>here</em></strong></a><strong><em>.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74687ea3c06" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inside-freenow/coroutines-and-kotlin-what-this-means-to-mobility-74687ea3c06">Coroutines and Kotlin: What this Means to Mobility</a> was originally published in <a href="https://medium.com/inside-freenow">FREENOW Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>