<?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 Aleksei Kornev on Medium]]></title>
        <description><![CDATA[Stories by Aleksei Kornev on Medium]]></description>
        <link>https://medium.com/@aleksei-kornev?source=rss-f25003cef950------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*THNfFIvvqoaFISv9.</url>
            <title>Stories by Aleksei Kornev on Medium</title>
            <link>https://medium.com/@aleksei-kornev?source=rss-f25003cef950------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 19:44:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aleksei-kornev/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[What software engineer have to learn in era of LLMs]]></title>
            <link>https://aleksei-kornev.medium.com/what-software-engineer-have-to-learn-in-era-of-llms-27ea70ebc7bf?source=rss-f25003cef950------2</link>
            <guid isPermaLink="false">https://medium.com/p/27ea70ebc7bf</guid>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[openai]]></category>
            <dc:creator><![CDATA[Aleksei Kornev]]></dc:creator>
            <pubDate>Tue, 21 Apr 2026 10:12:02 GMT</pubDate>
            <atom:updated>2026-04-21T10:12:02.788Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*BIS5sEPjIdnqcFRS59yj1Q.png" /><figcaption>Your brain is like a blender: put in the right ingredients and you get a tasty result</figcaption></figure><p>Modern LLMs can now write code pretty well. I’m not talking about throwaway vibecoded applications. I’m talking about solutions built by an engineer as an orchestrator of agents. So, to be fair, writing code in the modern world is not a problem anymore. Another way to say it is that writing code has become cheap.</p><p>If we look at the software engineering industry, progress has been moving forward. Let’s say five years ago, writing code was already simple. There were plenty of solutions for different standard tasks. This progress in the industry has of course impacted engineering as well. I’ve seen engineers who just remember git commands or Java Spring bean mappings and got jobs as software engineers. Unfortunately for engineers who just memorize everything and efficiently write code by using memory, they are going to be less valuable in the near future. What I think will be valuable is the ability to think in a more abstract way in order to design systems. Software engineering is going to be more complex than now because the unit of work is going to be not just a class that uses some libraries, but a group of services and data storages and we all know that even at the class level, everything is not ideal in terms of code quality, stability, and security.</p><p>I would like to share my list of materials that helped me develop abstract thinking and system design. I can’t say that I’m a master in this area; I can only say that these materials have helped me over the last 12 years design different types of systems, such as deployment automation and CI/CD, a bunch of backend systems with different architectures, mobile applications, and data processing systems.</p><h3><strong>Materials that I recommend learning:</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*sLNOJ-Z2Czfj-t8znir9zA.png" /></figure><p><a href="https://www.amazon.com/Introduction-Algorithms-fourth-Thomas-Cormen/dp/026204630X"><em>Introduction to Algorithms</em></a> by Thomas H. Cormen</p><blockquote>Yeah, guys, you need to know how to write a simple sorting algorithm — and more than that, write it yourself, not using any library function or asking a LLM. Just write it. Because if you don’t understand common algorithms and only know their names, you can’t come up with something new in your mind. For example, if you don’t understand how a big sort works, it will be harder to understand how MapReduce works and why data processing uses MapReduce. Then, if you don’t understand MapReduce, you don’t understand how Hadoop, Spark, BigQuery, etc., work. If that’s the case, you can’t use them in an optimized way.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*2wTs1w53WLNDAv2JRZWf6g.jpeg" /></figure><p><a href="https://web.mit.edu/6.001/6.037/sicp.pdf"><em>Structure and Interpretation of Computer Programs</em></a></p><blockquote>This book gives you the basis to understand how programming languages work. That will help you not only learn new languages much faster but also build your own DSLs. It focuses on abstractions, not on a specific language. In the LLM era, engineers should invest more in abstract thinking rather than focusing on something specific. You can also read this note: <a href="https://people.eecs.berkeley.edu/~bh/sicp.html">Why <em>Structure and Interpretation of Computer Programs</em> matters</a>.</blockquote><p><a href="https://www.youtube.com/@DrBartosz/courses">Bartosz Milewski</a></p><p><a href="https://www.youtube.com/@DrBartosz/courses">Category Theory</a></p><blockquote>This is one of the best lecture series about category theory that again improves your abstract way of thinking.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*TtI3I9d1WZmqqkADOrJu5w.png" /></figure><p><a href="https://linear.axler.net/LADR4e.pdf"><em>Linear Algebra Done Right</em></a> and <a href="https://www.youtube.com/playlist?list=PLGAnmvB9m7zOBVCZBUUmSinFV0wEir2Vw">video version</a></p><blockquote>When I was a kid, my math teacher used to say that math is the queen of all sciences. And it’s true.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*vj6CYXuovHIAa-Xt9WBGow.jpeg" /></figure><p><a href="https://www.amazon.com/Statistical-Analysis-Financial-Springer-Statistics/dp/1461487870"><em>Statistical Analysis of Financial Data in R</em></a></p><blockquote>You can read any book about statistics. I just love this one.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/1*cnjOA6J3brWGQo1fLiDBIg.jpeg" /></figure><p><a href="https://www.amazon.com/Thinking-Systems-Donella-H-Meadows/dp/1603580557"><em>Thinking in Systems: International Bestseller</em></a></p><blockquote>Systems thinking theory helps you understand how any system works — no matter if it’s a CI/CD workflow, a data processing ETL, or even the global economy. It’s a universal, abstract way to look at our world as a system that always tries to achieve equilibrium.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*OHbcSSpLFuE6ClZI-XRH9w.jpeg" /></figure><p><a href="https://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612/133-5213399-0490915"><em>Design Patterns: Elements of Reusable Object-Oriented Software</em></a></p><blockquote>This book is about design patterns that any engineer should know — and, more importantly, understand why the pattern was invented, what problem it solves, and where its limitations are. One day, a friend of mine told me a story about how he got an enterprise Java project from another team for support and extension. He said the whole project was built like a facade on top of a facade wrapped in another facade. The previous team of this service defenetly miss the understanding part :-)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*ZA4snOGZQZ-_ez5zEup3oA.png" /></figure><p><a href="https://www.amazon.com/Refactoring-Improving-Existing-Addison-Wesley-Signature/dp/0134757599"><em>Refactoring: Improving the Design of Existing Code</em></a></p><blockquote>Writing the first iteration of a system is not enough. Software engineers constantly think about how the system will be supported and extended in the future. The most complicated part of software development is not how to write something that works, but how to change an existing, highly complicated system to make it better without breaking its customers.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*zR7YyEcz4wp3Y6edx202lg.png" /></figure><p><a href="https://www.interdb.jp/pg/"><em>The Internals of PostgreSQL</em></a></p><blockquote>Understanding how databases work inside is highly important, and I think if you’ve watched the videos on category theory, you can understand this without my comments.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*TapCVOacolKPFV6JWbideQ.jpeg" /></figure><p><a href="https://www.amazon.com/Applied-Cryptography-Protocols-Algorithms-Source/dp/1119096723"><em>Applied Cryptography: Protocols, Algorithms and Source Code in C</em></a></p><blockquote>In a world where cryptocurrencies are getting more and more adoption, as an engineer it’s highly important to understand the cryptographic aspect of the picture.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*DFAePwYufamkFHMxV3WgxA.jpeg" /></figure><p><a href="https://www.oreilly.com/library/view/routing-tcp-ip-volume/1578700418/"><em>Routing TCP/IP, Volume I</em></a> and <a href="https://www.ciscopress.com/store/routing-tcp-ip-volume-ii-ccie-professional-development-9780134192789"><em>Volume II</em></a></p><blockquote>All people on Earth are now connected by a network. The bigger chunk of software works via the network. It’s a great example of a huge and complex system that in most cases becomes part of the system you develop.</blockquote><p>This list is not ultimate — it’s just a starting point. The main idea in the LLM era is that it’s more important to solve problems at an abstract level. At the development level, let the LLM generate code under your control.</p><p>LLMs don’t have a purpose, thanks God. That means looking at a system through different angles is, in my opinion, what engineers are going to do in the near future.</p><p><em>If you have in mind how to extend this list please send me link in comments.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27ea70ebc7bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to organize DataLake. Data ingestion, reconciliation, transformation and data validation.]]></title>
            <link>https://aleksei-kornev.medium.com/how-to-organize-datalake-data-ingestion-reconciliation-transformation-and-data-validation-97544f3099d?source=rss-f25003cef950------2</link>
            <guid isPermaLink="false">https://medium.com/p/97544f3099d</guid>
            <category><![CDATA[data-lake]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[airflow]]></category>
            <category><![CDATA[architecture]]></category>
            <dc:creator><![CDATA[Aleksei Kornev]]></dc:creator>
            <pubDate>Mon, 06 Feb 2023 12:48:16 GMT</pubDate>
            <atom:updated>2023-02-06T12:48:16.376Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="DataLake structure" src="https://cdn-images-1.medium.com/max/1024/1*ny5rPjDjdm9vyg52wTlBLA.jpeg" /><figcaption>DataLake structure</figcaption></figure><p>When you hear about BigData, what do you imagine? A lot of the data or something else. I usually imagine a set of several systematic processes that works with data. Actually the organisation of those processes usually called Data Lake, yes, yes, and yes Data Lake is based on some storage, but more important that data lake is a set of well orchestrated processes.</p><p>One of the way to organize the data lake is to logically split it to several layers. On the picture above you may see 3 layers: bronze, silver and golden. Let’s take a look at the difference between those layers:</p><h4>Bronze layer</h4><p>Layer is responsible for raw data that comes from any source. As you can see above, I especially group different type of sources. Between the bronze and source, there is an ingestion process. Ingestion could be done by multiple ways: CDC (mostly loved nowadays), files, APIs, dumps fetching, etc. So the data that was consumed from source is stored in this layer as is from data perspective, from the processing perspective the data should be consumable for your precessing framework.</p><h4>Silver layer</h4><p>It’s the layer where you have done simple type of transformations, in this layer you should not do any type of complex joins or aggregations. Try to keep the objects in this layer simple and plain. In Java world there is a term <em>POJO (plain old java objects) </em>so this term perfectly describes data model of this layer.</p><h4>Golden layer</h4><p>In this layer, you have more complex objects that have been built by joining/aggregating of several objects from Silver layer. It usually keeps datamart objects and more complex aggregated objects. This layer is mostly used for exposing dashboard, making reports, exposing objects over API, etc.</p><h4>Validation and reconciliation</h4><p>One is the most important task for data engineers who manage data lake is to keep it consistent on the all layers. There are 2 process that helps to keep storage consistent: data validation and data reconciliation.</p><p>Validation is usually done between data lake layers: <em>bronze</em>, <em>silver</em> and <em>gold</em>, the main goal of validation is to find bugs in transformation processes between layers. It usually organized as a bunch of data quality checks. The checks itself could be partition based or random checks against the whole data set, the technique is depends on the amount of data.</p><p>Reconciliation is the process that is done between data source and storage. The goal is to make sure that the data in data lake is in consistent state with the source data. It’s usually run against <em>bronze and source.</em></p><h4>Conclusion</h4><p>The most important thing is to have understanding about DataLake structure across the data team. Everybody from the team should understand that consistency of data is the most important part of Data Lake management. Everything else is built on top of consistent and stable DataLake.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97544f3099d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ultimate guide of cooking Airflow properly]]></title>
            <link>https://aleksei-kornev.medium.com/ultimate-guid-of-cooking-airflow-properly-ce0409692af2?source=rss-f25003cef950------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce0409692af2</guid>
            <category><![CDATA[data-workflow]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[airflow]]></category>
            <dc:creator><![CDATA[Aleksei Kornev]]></dc:creator>
            <pubDate>Fri, 20 Jan 2023 05:25:49 GMT</pubDate>
            <atom:updated>2023-01-24T02:16:54.969Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*lgdCFcvCShvlZWSA6Pa5Mw.png" /></figure><p>Airflow is a powerful tool for managing and scheduling data pipelines, but to get the most out of it, it’s important to follow best practices when using the platform. In this article, we’ll discuss some of the best practices for using Airflow to ensure that your data pipelines are efficient, reliable, and easy to maintain.</p><ul><li>First and foremost, it’s important to <strong>minimize the use of Python operators</strong>. While they can be useful in some cases, most data pipeline tasks can be accomplished using the built-in operators that come with Airflow. This will help to keep your codebase clean and easy to understand.</li><li>Another important best practice is to <strong>avoid using pandas for data transformations</strong>. Instead, use BigQuery or any other tool, which are specifically designed for this purpose and can handle large data sets more efficiently.</li><li><strong>When running heavy calculations that you can’t do on the build-in operators, don’t use PythonOperator or BashOperator. Instead, use KubernetesPodOperator, which allows you to run calculations in a containerised environment. </strong>This will ensure that your calculations are performed in a consistent and isolated environment, which can improve the performance and scalability of your pipeline.</li><li><strong>To make your code more reusable, try to wrap common processes in functions. </strong>This will allow you to easily reuse these processes in future DAGs, which can save you time and make your pipeline more maintainable.</li><li>Consistency is key when naming your DAGs. <strong>Use the same name for the DAG and the file that contains the DAG definition.</strong> This will make it easier to find and understand your DAGs. Hint: you can make a function that can return the name of the DAG from <em>__file__.</em></li><li><strong>Don’t define SQL queries in the DAG file.</strong> Instead, use separate files for queries, so that they can be easily reused and updated. This will make it easier to test and maintain your queries, which can improve the reliability of your pipeline.</li><li><strong>When working with date and time, don’t use the SQL NOW() function or Python’s now() function.</strong> Instead, use the execution_date variable in Airflow, which is specifically designed to provide the current date and time during DAG execution.</li><li><strong>Try to parametrize your queries as much as possible.</strong> This will make it easier to update and test your queries without having to modify the DAG file, which can improve the maintainability of your pipeline.</li><li><strong>Treat your DAG file as a configuration definition. </strong>This will make it easier to understand what your pipeline is doing and how it’s configured, which can improve its maintainability.</li><li><strong>For better monitoring, set Service Level Agreement (SLA) for your DAGs.</strong> You can choose the number like (<em>1.5 * avg duration</em>) then increase of decrease it during the usage. This will allow you to keep track of your pipeline’s performance and quickly identify any issues that arise.</li><li><strong>Please avoid of making your own Domain Specific Language (DSL) in YAML or JSON on top of Airflow DAGs</strong>, because the DAG file is a declaration of the process already. Making additional layer of abstraction makes it hard to support in the future.</li><li><strong>Try to avoid cross dependencies between the DAGs.</strong> Once the amount of pipeline will be quite big it’s hard to maintain the DAGs.</li><li><strong>Try to avoid “Monster DAG” it’s usually happened when you have similar pipelines that runs in parallel inside of 1 single DAG.</strong> For example you transform several tables and you just loop over the list of tables and generate pipelines for each table inside one single DAG. It’s better to group such pipelines logically and split to several DAGs. This will make it easier to tweak your DAGS and monitor them, which can improve its maintainability.</li><li><strong>Add versioning to your DAGs.</strong> The synchronisation process with airflow could take some time to sync the DAGs, so it’s better to have some version of DAGs in order to understand that your DAGs are synced. I personally add dummy DAG with git-short-sha suffix in the name. <em>For example the name of the DAG: version-fa45b25.</em></li></ul><p>In conclusion, it’s small list of technics that can help you to make your Airflow usage much simpler.</p><p>If you have any questions just reach me out, I can help you solve your problems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce0409692af2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2 things that you have to know to become a master of python]]></title>
            <link>https://aleksei-kornev.medium.com/2-things-that-you-have-to-know-to-become-a-master-of-python-4bcaa4cb2a0c?source=rss-f25003cef950------2</link>
            <guid isPermaLink="false">https://medium.com/p/4bcaa4cb2a0c</guid>
            <category><![CDATA[programming-languages]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[language]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Aleksei Kornev]]></dc:creator>
            <pubDate>Sun, 09 May 2021 15:56:01 GMT</pubDate>
            <atom:updated>2021-05-09T15:56:01.740Z</atom:updated>
            <content:encoded><![CDATA[<h4>The concept of python language. <strong>Higher order functions and Dictionaries are two whales of python</strong></h4><h4>Into</h4><p>There are many programming languages. Some of them represent a bunch of different tools to manage memory. For example, C language is a more human-readable wrapper for ASM, whoever writes or saw MASM with macroses may mention that it’s so easy to make C language on them. Another type of programming languages made around some concept. This concept is a base for the language so that any more difficult structures of language is defined through the parts of the concept.</p><p>The python language is based on 2 things(like 2 whales 🐳 ):</p><p>🐳 <strong>Higher order functions</strong> — lambdas, data processing(map, reduce, etc or list comprehension), class methods, closures, decorators<br> 🐳 <strong>Dictionaries</strong> — classes, meta classes, modules, etc</p><p>That’s it! Understanding those 2 things help to write any difficult framework or library on python. So who understand the idea of those 2 whales can just clap 👏 and skip reading this article. Who needs more examples, let’s go.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oGpPN7nWt29kjoCWFeyMfA.png" /></figure><h4>Disclaimer</h4><p>All examples are on python 3 it only affects syntax not concept.</p><h3>🐳 Thing #1: Higher order functions</h3><p>It’s when you treat the function as an object so function could be passed to the another function or function could closure on the state. More detailed you can read <a href="https://en.wikipedia.org/wiki/Higher-order_function">here</a>.</p><p>Let’s look to decorators through the prism of higher order functions</p><p>Start from simple decorator that track decorated function:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/92b08ec482f15442133e5ca7a27c9e3d/href">https://medium.com/media/92b08ec482f15442133e5ca7a27c9e3d/href</a></iframe><p>When python interpreter see declaration started with <strong><em>@</em></strong> its translate it to the function call.</p><blockquote>Where are such decorators may be used? In many scenarios where you need to register function for the further call from the framework. For example: <a href="https://docs.celeryproject.org/en/stable/getting-started/introduction.html">Celery</a> <strong>@shared_tasks</strong> or <a href="https://flask.palletsprojects.com/en/1.1.x/">flask</a> <strong>@app.route</strong> of course their decorators are much complex but the idea is the same register function to call inside a framework.</blockquote><p>But what if I need to control not only the declaration of the function but also its execution. That means that instead of the function itself decorator should return some wrapper function where all execution control things are declared.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a8943947ad0977528a32cfb4c7ed4fa0/href">https://medium.com/media/a8943947ad0977528a32cfb4c7ed4fa0/href</a></iframe><p>In the example above you may see that instead of the <em>my_func</em> decorator returns some wrapper function and this wrapper function closure to the state of <em>decarator2</em> so that it knows about source function during the execution.</p><blockquote>Such decorators use in many cases for example <a href="https://github.com/rholder/retrying">retrying</a>. Also, you may play with function arguments and with the execution of the source function itself. For example look at <a href="https://click.palletsprojects.com/en/7.x/">Click</a> as homework and try to repeat the <a href="https://click.palletsprojects.com/en/7.x/">Click</a> decorators.</blockquote><p>Knowledge about higher order functions in python helps to make any imaginable combinations of code.</p><h3>🐳 Thing #2: Dictionaries</h3><p>This thing is more difficult to understand than higher order functions. Basically, python looks at everything as at dictionary(dict) and provides tools to manage dicts. I’m not talking about primitives like 1 + 1. Basically, I wanna say that everything in python like modules, execution environment, classes, class instances and etc. are just dicts.</p><p>Let’s deep dive it steps by step.<br>When you start your program you have 2 dicts GLOBALS and LOCALS. The difference is the scope. GLOBALS is the global scope of your app, LOCALS is the local scope, for example scope of the function. Basically, LOCALS is the way to keep a state for higher order functions.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/99c62cb4a8f45100bb91177ef31eb400/href">https://medium.com/media/99c62cb4a8f45100bb91177ef31eb400/href</a></iframe><p>In another word when you define something, you tell python to make changes in dict.</p><p>Let’s go to a more complex thing like <strong>classes</strong>.<br>When you define class you tell python to create a dict and everything that you define inside it, put as keys and values to that dict. More mistakes happened when developers define class variables then change them in methods and thinking that it’s object fields, but they are classes. I’ll show this example later.</p><p>When you instantiate a class you tell python to make a new dict and call function from <em>__init__</em> key of class definition dict with that new created dict as first arg for initialization.</p><p>In case if you have a chain of inheritance you have a list of dicts that python use for lookup. As you may understand when you call <em>__init__</em> from parent class you just tell hey parent here is the instance dict put whatever data you need for further work.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5e285c44a7ad86f33938db96fc732bb9/href">https://medium.com/media/5e285c44a7ad86f33938db96fc732bb9/href</a></iframe><p>Python methods are basically functions that call with the dict as the first arg the name of this arg usually is <strong>self</strong> but you may call it whatever you want for example pepa 🙂.</p><p>Here we come to the scariest part of python language —<strong> metaclasses</strong>. But I think those who understood everything that I said before having a clue what metaclasses are. With metaclasses, python gives you the ability not only to manage objects that instantiated from class but also class definition itself.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2dfe176c00e2394df677b14aefac9654/href">https://medium.com/media/2dfe176c00e2394df677b14aefac9654/href</a></iframe><p>As you can see it’s possible to make a new class dynamically by providing the dict. When you are working on a framework you may have a lot of similar definitions like Pepa in example above. Why don’t apply the well-known approach with classes to them, because at the end everything is dicts. That’s how we have metaclasses</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/796dd5cc568060601c9e152644bb9c7e/href">https://medium.com/media/796dd5cc568060601c9e152644bb9c7e/href</a></iframe><blockquote>You may see metaclasses in frameworks where the class definition is used as some declaration. It’s mostly data mapping frameworks such as ORM for example Django models, web form mapping or JSON mapping, etc.</blockquote><blockquote>Also, it’s very helpful when you want to add some class-specific behavior like Django DoesNotExist exception is added to class from its metaclass so when you are catching exceptions for example User.DoesNotExist and Comment.DoesNotExists, for “except” operator they are different but DoesNotExist is defined once in metaclass.</blockquote><h4>Conclusion</h4><p>Who read these lines and understood everything from this article now know python as master. At the end I wold like to confess there is the third thing it’s sugar :)</p><p>Higher order functions, Dictionaries and Sugar now you know everything about python</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bcaa4cb2a0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why there are Cloud Functions and Service Mesh & whats next.]]></title>
            <link>https://aleksei-kornev.medium.com/why-there-are-cloud-functions-and-service-mesh-whats-next-6a60ec013f8?source=rss-f25003cef950------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a60ec013f8</guid>
            <category><![CDATA[amazon-step-function]]></category>
            <category><![CDATA[amazon-lambda]]></category>
            <category><![CDATA[cloud-functions]]></category>
            <category><![CDATA[no-code]]></category>
            <category><![CDATA[service-mesh]]></category>
            <dc:creator><![CDATA[Aleksei Kornev]]></dc:creator>
            <pubDate>Sat, 05 Sep 2020 10:49:43 GMT</pubDate>
            <atom:updated>2020-09-06T14:57:20.240Z</atom:updated>
            <content:encoded><![CDATA[<h4>Journey into the history of Backend development and DevOps to understand why we have Cloud Function and Service Mesh</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*znwfqzRcf3M9vS69o3FI-Q.jpeg" /></figure><h4>DevOps discography</h4><p>Let’s just quickly go through what happened in the DevOps/Backend development industry for the last 20 years.</p><blockquote><strong>Disclaimer: </strong>I don’t try to describe all events that happened in IT industry I just wanna show how tools were made for the tasks that need to solve at that particular moment.</blockquote><h4>🏢 Vertical scale era</h4><p>Starting from the moment when server-side applications were so small. One single server with Apache handles different web applications from a separate FTP folder. Those servers were bare-metal machines and at that moment there was no DevOps, it were “bearded” system administrators who had to manage those servers. The main problems for them were:</p><ol><li>Apply new updates to the bare-metal server.</li><li>Inventory. Understand which packages do you have and where. Server capacity, etc.</li><li>Setup a new server.</li><li>Clean up resources on those servers.</li></ol><p>The tools that come up to solve this problem such as Puppet and Chef.</p><blockquote><strong>Note:</strong> of course there were many different approaches to solve those problems as an example I choose those 2.</blockquote><p>The idea was that you setup a special agent that helps you to manage your servers. Gather information about machines, automate the deployment of the packages, and routine operations on the servers.</p><h4>🏢🏢🏢 Horizontal scale era</h4><p>Then applications become more complicated and vertical scale could not handle the load as before. At that moment clouds come in place. In the era of clouds and the idea of DevOps and CI/CD new problems come in place.</p><ol><li>How to deploy and configure different applications with minimum effort</li><li>How to deliver your service</li><li>How to migrate applications between different cloud providers</li><li>How easily prepare the infrastructure for your project it’s something similar that was solved before as ‘Setup new server’ but now you need to setup different configurations of infra with autoscaling, etc.</li><li>How to reuse deployment automation that was made before on any Linux distributive.</li></ol><blockquote><strong>Note:</strong> of course amount of problems was more than in that list</blockquote><p>Chef and Puppet still were in place and many deployments were made on them. The idea about some platform that solves those problems come up at that moment. Such platforms are called PaaS. So you can make for example ruby application and PaaS will manage configuration for your app. Making PaaS systems developers had to solve the problem with the unification of service configuration, management, etc. As one of such unification solutions for the PaaS system was Docker. If somebody thinks that Docker is about containerization it’s a big mistake, containers were long before Docker and the first version of docker used LXC containers as backend. Docker is about a common contract of how to configure, run, and distribute your applications.</p><h4>👥 Unified application management</h4><p>With Docker new era has begun.</p><p>Now you can make common deployment solutions because you don’t care about the app itself your work with an abstraction that is called Docker.</p><ul><li>So there is an abstraction above of your service, but you still need one more because migration between clouds was still so painful.</li><li>Developers started to divide applications to microservices which somehow should be deployed and managed.</li></ul><p>I think now everybody knows which tool solves such problems. It is the Kubernetes. It helps you not only orchestrate your cluster, solve the problem with service discovery, etc but also gives your ability to run your cluster on the cloud provides who support Kubernetes out of the box or just ask the DevOps team to deploy it there and run your cluster on top of it.</p><p>Ok, it seems everything is perfect now you can make your microservices on any language that you know and it will be deployed and scale on any cloud provider or bare metal with Kubernetes.</p><h4>🧑‍💻Just write business logic and forget about app management</h4><p>What are the new problems that need to be solved?</p><ol><li>You still need to develop a service which is 70% boilerplate configuration code (describe it more broadly what boilerplate means here, monitoring, tracing, logging, etc)</li><li>You need somebody in the team who knows how to deal with Kubernetes</li></ol><p>The solution to these problems is the natural evolution of Docker, Kubernetes, Monitoring practice, and Microservices approach. It’s Cloud Functions. To combine backend you just need to make a set of Cloud Functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/1*MneKi3aK1H-jCgt6fxFaDQ.png" /></figure><p>Most of the strong Cloud Function implementation has Amazon — Amazon Lambda. On top of the Lambda, they have Amazon Step Functions which is the next obvious step in the area of building abstractions above functions. (Read my article about workflows <a href="https://itnext.io/the-concept-of-workflow-engines-c14e8088283">here</a>) The Cloud Function itself is just a tiny building block to make an application one single function is not enough need something that “glue” Cloud Functions together.</p><p>Many open source solutions organize functions into groups with some context and relationships.</p><p>I think the evolution of backend development and DevOps will go in this direction and in 2–3 years, we will see backend that is made full of functions.</p><h4>🔌 Connect with the others and reuse services</h4><p>There is another direction of improvements</p><ul><li>Boilerplate we have killed with functions fine, but service/functions still need to write.</li></ul><p>So in the world of services, you need something responsible for service communication. It is a service mesh. The idea is simple to move out of the communication between service to separate service. If somebody familiar with Hystrix or Twitter Finagle it’s java libraries so service mesh is parts of those libraries wrapped into separate service. It’s a generic layer that handles communication between services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*nxlEXZyna4YwD1A67YuH6A.png" /></figure><p>The brief future architecture where you run some functions by your self some other functions you use from the other service.</p><h4>🤓 Recap</h4><p>It’s similar to modern development right now something you take from libraries something you make by yourself. For the end-user, it’s just your application that dealing with everything. I think backend development and DevOps will keep going in that direction and we will see more and more interesting tools and solutions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a60ec013f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Production readiness checklist for backend applications]]></title>
            <link>https://aleksei-kornev.medium.com/production-readiness-checklist-for-backend-applications-8d2b0c57ccec?source=rss-f25003cef950------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d2b0c57ccec</guid>
            <category><![CDATA[devops-practice]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[microservices-application]]></category>
            <dc:creator><![CDATA[Aleksei Kornev]]></dc:creator>
            <pubDate>Fri, 22 May 2020 07:42:56 GMT</pubDate>
            <atom:updated>2020-06-09T17:49:06.023Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a_qCman9YEXRgeJlILDvJA.jpeg" /></figure><h3>Intro</h3><p>Releasing my own apps or working with teams to help them to release their application. I realized that rolling out to production is usually chaos. It doesn’t matter how big is your app: the app that was made by different 35 teams or just one mature team. It just a matter of entropy :-).</p><p>There are a lot of books that describe <em>best practices</em> to go to live with subsequent production support. But you are not going to read all those books right before going to production and event if you read them, during the rollout you may forget something that you read about. Of course, I’ve read many of them and have my own experience. Before go-live I usually starting to recollect everything that I know and try to apply to the current case. I was thinking about how to organize information better and come up with an idea of well known old checklists.</p><p>Here is my checklist.</p><h3>Checklist to go live for backend application</h3><h4>Network</h4><ul><li>The network is isolated from the internet(nothing is reachable from the internet)</li><li>APIs are covered by API Gateway</li><li>Databases are available only from the production network</li><li>[Nice to have] Application is deployed to at least 2 different locations(VPC peering could be configured between location)</li></ul><h4>Monitoring</h4><ul><li>Need to monitor each service of your application</li><li>Need to monitor databases</li><li>Need to monitor 3rd party service</li><li>Need to monitor Kubernetes(in case you have it)</li><li>Configure request tracking(in case of multi-services)</li></ul><h4>Log aggregation</h4><ul><li>Logs are centralized to log aggregation service</li><li>Add filters at least for ERROR and WARN</li></ul><h4>Alerts</h4><ul><li>Alerts are configured at least for basic metrics so that CPU, memory, IOPS, disk space</li><li>[Nice to have] Configure alerts for errors in logs</li><li>[Nice to have] Use error reporting services</li><li>Have a mechanism to turn off alerts during deployment</li><li>All alerts should be tracked</li></ul><h4>Backups</h4><ul><li>The backup strategy should be applied to each database</li><li>Backups should have a validation process in place</li><li>Rollback process should be automated and tested</li></ul><h4>Deployment</h4><ul><li>Deployment process should be automated</li><li>[Nice to have] Blue/Green deployment</li><li>[Nice to have] Support canary deployment</li></ul><h4>Data replication</h4><ul><li>Databases should be deployed at least with a minimum required number of a node with a replication factor that helps you to recover as soon as possible</li></ul><h4>Access</h4><ul><li>Only the production team should have access to production environments</li><li>Developers may have access to logs and monitoring information</li></ul><h4>Secrets</h4><ul><li>Should be stored in any service which is responsible for secret management</li><li>None of the passwords or keys should be stored anywhere</li><li>Secret management strategy should be defined along with people who have keys</li></ul><h4>Smoke tests</h4><ul><li>Need to have a list of smoke tests (it’s good if they are automated) that could show that production is up and running</li></ul><h4>Health checks</h4><ul><li>Application Services should provide health check endpoints</li><li>3rd party services health check should be either checked by application service itself or has his health check endpoints or needs to make some scripts that check the health of 3rd party service.</li></ul><h4>Versioning</h4><ul><li>All components should be versioned</li></ul><h4>Git branches and tags</h4><ul><li>According to git-flow that you use need to assign tags to prepare branches for quick fixes, etc.</li></ul><h4>Capacity planning</h4><ul><li>Make sure that you understand the number of necessary resources for each component in a system</li><li>Make sure that you configure all limits for the services. To avoid situations when because of the memory leak in one service you kill everything around.</li></ul><h4>Time configuration [optional]</h4><ul><li>Make sure that you have synced time over all nodes of your cluster</li></ul><h4>Release strategy process [in case if there is an old version of product]</h4><ul><li>Need to describe the procedure that you are going to use</li><li>Bigbang</li><li>Rolling upgrade</li><li>Canary</li></ul><h4>Production sign off process</h4><ul><li>Need to have a person who is responsible for production deployment and sign off that production is ready to go</li></ul><h4>Support documents</h4><ul><li>Contains common issues and resolutions</li><li>Contains instructions about production management(deployment commands examples, purge scripts, other automation)</li></ul><h4>Disaster recovery</h4><ul><li>Need to have a disaster recovery plan with different levels of details and ETAs for example: how to recover one service, how to recover a database, how to recover the whole cluster, how to recover the whole region</li></ul><h3>P.s.</h3><p>Please don’t hesitate to send me the things that you usually check before go live and I will update this list. And of cause, if you need help with your Application Architecture/DevOps Processes/BigData processing reach me out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d2b0c57ccec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The concept of workflow engines]]></title>
            <link>https://itnext.io/the-concept-of-workflow-engines-c14e8088283?source=rss-f25003cef950------2</link>
            <guid isPermaLink="false">https://medium.com/p/c14e8088283</guid>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[workflow-automation]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[airflow]]></category>
            <dc:creator><![CDATA[Aleksei Kornev]]></dc:creator>
            <pubDate>Sat, 14 Mar 2020 11:17:54 GMT</pubDate>
            <atom:updated>2020-03-18T09:10:19.729Z</atom:updated>
            <content:encoded><![CDATA[<h3>Intro</h3><p>Workflows are used in many cases from automation of build processes and CI/CD to order management systems in online/offline stores and booking a taxi. You may find a lot of solutions from small github projects to enterprise systems. There is a huge variety of implementations: the frameworks that could be integrated into your system, some separate solutions, workflow engines which are available in big complex system as part of functionality and etc. Here is a small list of workflow engines: Jenkins, GitLab Pipelines, Cadence, Airflow, Conductor, etc.</p><p>In this article I would like to show the base concept for all workflow engines.</p><h3>What is the workflow, state machine and workflow engine?</h3><p>Before looking into the concept let’s understand the terms: workflow, state machine and workflow engine.</p><p>What wikipedia tells us about the workflow term.</p><blockquote><em>A workflow consists of an orchestrated and repeatable pattern of activity, enabled by the systematic organisation of resources into processes that transform materials, provide services, or process information.</em></blockquote><p>I think this description of the workflow from wikipedia is clear. I just wanna mention that it describes what the workflow is in general, nothing saying about any technology or development pattern or math model. The math model of the workflow is a state machine. Let’s take a look at wikipedia about it.</p><blockquote><em>A state machine is a mathematical model of computation. It’s an abstract concept whereby the machine can have different states, but at a given time fulfils only one of them.</em></blockquote><p>So as soon as there is workflow and its math model, needs something that implements the math model. Workflow engine is an implementation of the math model(state machine). Read wikipedia one more time =).</p><blockquote><em>A workflow engine manages and monitors the state of activities in a workflow, such as the processing and approval of a loan application form, and determines which new activity to transition to according to defined processes (workflows).</em></blockquote><p>Basically any application is an implementation of some workflow and as I said before there are a lot of places where kind of parts of workflow engine are used. Let’s take a look at the concept of the workflow engine.</p><h3>Concept</h3><p>Workflow engine consists of 6 logical components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*CPG-BqM7K4BPVLOL6Plnew.png" /><figcaption>Component diagram of workflow engine</figcaption></figure><h4>Scheduler</h4><p>It’s the main part of workflow engine where all magic happen. It schedule the runs, knows about flow definition, monitor the results of the task execution. It could be triggered by some event like a timer, API or manually.</p><h4>Metadata store</h4><p>It’s just a storage for data that needs scheduler to orchestrate the runs. Depends on implementation it could be in memory structures or a database. I’ll describe it more carefully in the next article about data concept.</p><h4>Triggers</h4><p>The way how your workflow could be triggered. In case of framework it’s usually call of some function. If it’s some solution then it could be some sort of API, time schedule. Basically you may have different implementations of triggers for the workflow.</p><h4>Executors</h4><p>Component that is responsible for running an atomic task and providing the results of the run. It could be just separate thread inside of your app, container or event VM.</p><h4>Flow repository</h4><p>The place where definitions are stored depends on implementation it could be different place and provide additional features not just storage for definitions. Flow is kind of description of the workflow. I’ll describe it more carefully in the next article about data concept.</p><h4>Shared context</h4><p>As soon as your workflow becomes a little bit complex you immediately need to pass some context from one task to another. This component is responsible for that.</p><h3>Conclusion: When do you need to use workflow engine?</h3><p>In order to answer the topic question let’s take a look 2 examples.</p><p>The first one: “UI that provides a list of users to the client” in this case API needs to provide a result to the client and after that client decides what to do next, may be just analyse the result or take some action. So the process is not fully automated there is a space for the client to make a decision.</p><p>Another example: “Get the list of users, find peoples with birthday today and send them a message ‘Happy birthday’” in this scenario the client do care only about let call it “job to be done”, the client doesn’t need to analyse and make a decision based on the list of users because the behaviour pattern was found before and now client needs just to execute it.</p><p>Simply to say when you need to implement some fully automated process pick a workflow engine(example: Build processes, CI/CD processes, Provisioning of VM, Order management process, etc), when you wanna provide some ability to your client to take an action (example: show me list of entities and provide set of actions on them, show me list of my friends in social network, let me find some video and then play it or comment it, etc), so try to consider the another approach because workflow engine as any unified solution doesn’t cost zero.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c14e8088283" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/the-concept-of-workflow-engines-c14e8088283">The concept of workflow engines</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>