<?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ł Grabowski on Medium]]></title>
        <description><![CDATA[Stories by Michał Grabowski on Medium]]></description>
        <link>https://medium.com/@ayeo?source=rss-b62d2906725f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-FJe3cJO5SBCiMcK4s5Few.jpeg</url>
            <title>Stories by Michał Grabowski on Medium</title>
            <link>https://medium.com/@ayeo?source=rss-b62d2906725f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 19:36:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ayeo/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[Do not copy successful architectures]]></title>
            <link>https://blog.softwaremill.com/do-not-copy-successful-architectures-2118b4f161d4?source=rss-b62d2906725f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2118b4f161d4</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Michał Grabowski]]></dc:creator>
            <pubDate>Mon, 11 Mar 2024 09:20:59 GMT</pubDate>
            <atom:updated>2024-03-11T09:20:59.813Z</atom:updated>
            <content:encoded><![CDATA[<p>One common mistake in software architecture is blindly copying successful architectures without considering a project’s unique needs and context. For example, many companies try to replicate the architecture of successful companies like Netflix without considering whether it is a good fit for their own needs.</p><p>It is important to remember that not all companies have the same scale or requirements as Netflix. Each architecture should be tailored to the specific goals and requirements of the project. Blindly copying successful architectures can lead to unnecessary complexity and inefficiency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vbNoE-wSQ7ob27xD" /><figcaption>image from free images stock <a href="https://unsplash.com/">unsplash.com</a></figcaption></figure><h3>Relevance</h3><p>In architectural design, there is no universal solution. The concept of a one-size-fits-all approach is ineffective. The most effective software solutions emerge from solving actual problems rather than striving toward an idealized vision.</p><p>What is essential for companies are <strong>robust, simple, and predictable solutions </strong>that are <strong>easy to adapt, develop, and maintain</strong>. It’s akin to building cars: it wouldn’t be practical to use every available piece of engineering without considering cost, service, time to market, and the real needs of users, such as safety and resilience.</p><p>Business needs should be at the heart of architectural considerations. An architect must deeply understand the <strong>business’s context, vision, strategic plans, and history</strong>. This deep understanding should then be reflected in the system’s architecture. The architecture should narrate the story of the business, revealing not only how it operates but also why it operates that way.</p><h3>Simplicity</h3><p>Keep it simple. Avoid solving problems that don’t exist yet. Be aware of your scale, your team’s capabilities, and their experience. Focus on your unique business niche, and keep your tech stack simple enough.</p><p>When deciding between mature and cutting-edge technologies, weigh factors like the project’s criticality and the availability of support. While established technologies are generally safer and minimize risks, sometimes new technologies are necessary. In such instances, architects should make well-informed decisions based on the project’s specific requirements.</p><p>Don’t aim to build for millions right from the start. Many successful companies, such as Amazon and eBay, have rewritten their systems several times over the years. Companies that overcomplicate their systems to accommodate customers they don’t yet have often remain unknown — they fail in the market. Identify your strengths and leverage them. Solving only the problems you really have lowers the product’s time to market.</p><p><strong>Microservices may not be necessary at the very beginning</strong>. The primary purpose behind microservices is independent deployment, and any other benefits are often just side effects rather than the intended goal.</p><p>Microservices should only be considered when there’s no other viable option. They are neither simple nor inexpensive and require significant operational effort to maintain. They also add considerable complexity just to make independent deployment feasible.</p><p>Increasingly, <a href="https://www.primevideotech.com/video-streaming/scaling-up-the-prime-video-audio-video-monitoring-service-and-reducing-costs-by-90">companies</a> are moving away from microservices due to cost and complexity. Modular monolith is a more than often sufficient approach that is easier to enhance, evolve, and refactor. When built reasonably, it is quite simple to transform into full-fledged microservices.</p><h3>Evolution</h3><p>You and your team will gather more and more knowledge over time. It is impossible to forecast all the challenges you are going to encounter. Embrace that uncertainty and partial knowledge. It’s normal for architecture to be imperfect and to evolve. Architecture is a dynamic, not static, process that requires an iterative and incremental approach. Understand that your knowledge is always incomplete; <strong>every decision is potentially temporary</strong>, awaiting new insights. Embrace this as an ongoing process.</p><p>There will always be challenges and room for improvement. Do not aim for a final state where everything is complete, as it is unattainable. Instead, <strong>grow alongside the business</strong>, acknowledging that you can’t know all the answers upfront.</p><p>Defer decisions when necessary. In fact, it is all about deferring any decision as long as possible. If you are unsure what the final decision may be, design it in a way that enables you to change your mind easily.</p><p>Avoid future-proofing your architecture, as it can divert attention from current problems. Predicting the future is not feasible, and attempts to do so can be detrimental. Focus on the present issue, thinking only one step ahead, not ten. Building universal solutions only adds complexity and rarely succeeds.</p><p>Continual learning and experience, both within and outside the organization, are vital for developing your skills and improving your capabilities.</p><p>Making informed architectural decisions based on understanding and experience is crucial. An iterative and incremental approach provides flexibility and the ability to rectify mistakes. Start with the best guess based on current knowledge and refine the architecture as new information becomes available. It’s important to <strong>separate the well-understood aspects of the system from those that are not</strong>.</p><p>Allow yourself the freedom to make mistakes and learn from them. This discovery process is crucial in understanding constraints and dependencies in architecture.</p><h3>Constraints</h3><p>Every choice in architecture has its trade-offs. When you say ‘yes’ to something, you’re inherently saying ‘no’ to something else. This concept highlights that nothing comes without a cost.</p><p>Additionally, every action, including choosing not to act, has consequences. It’s important to realize that nothing in architecture exists in isolation; everything interacts with and is influenced by its surrounding context. I write more about that <a href="https://softwaremill.com/build-cities-not-buildings/">here</a>.</p><p>Developers often search for the perfect solution to a problem, but such a solution rarely exists. Prioritizing certain values inevitably means compromising on others. This reality underlines the importance of knowing what to focus on, as specific solutions tailored to a particular problem often provide more value than generic ones.</p><p><strong>Recognize your knowledge’s limitations to avoid overconfidence and the issues it can cause.</strong></p><p>Every decision and technology carries a cost. There is no such thing as a free solution. Even striving for independence from a specific tool or technology comes with a price, often adding complexity and diminishing the clarity and readability of the solution.</p><h3>Modularization</h3><p>Modularization is a fundamental concept in software development, emphasizing <strong>well-defined boundaries, information hiding, encapsulation of business logic, and data ownership</strong>. By using simple components, we can build increasingly complex systems. It stands as the primary method to manage complexity and cognitive overload.</p><p>When building modules, it’s essential to find the right size. A too-fine-grained breakdown can lead to coordination and cooperation issues, managing dependencies, and knowledge and data sharing challenges.</p><p>The goal is to build systems that work for current needs, with the flexibility to split or merge modules in the future without impacting other parts of the system. This approach is often easier to implement in a monolithic architecture.</p><p>While complex systems may seem appealing, they often bring about complications. Simpler systems, on the other hand, can be scaled up to create more versatile and robust architectures.</p><p>The focus should not just be on the technology but also on semantic boundaries — defining clear language, responsibilities, and the flow of data and control. Modules should aim for autonomy and manage the data they require.</p><p>However, it’s important to remember that modularization has no one-size-fits-all solution. It’s a process that enriches the system’s language and enables meaningful discussions about it.</p><h3>Perspective</h3><p>The core idea behind a module is to hide as many details as possible from external view. Everything a module exposes constitutes its public API, which becomes challenging to change once other modules depend on it.</p><p>Carefully shaping these contracts and hiding decisions within the module allows for flexibility in design and assumptions, facilitating system evolution through refactoring.</p><p>A module’s strength lies in its internal invisibility from the outside, interacting solely through its public API. This design allows internal changes without affecting other modules, preserving the module’s boundaries.</p><p>This modular approach also influences how we perceive and discuss these components. Defining a clear public interface for each module clarifies its role, responsibilities, and data ownership. Designing modules with their contracts in mind results in a system where components are less interdependent and more coherent.</p><p>Maintaining a system’s architecture requires understanding it at various levels, exemplified by the C4 model. It’s important to recognize the cooperating components at each level and the level to which they belong. Mixing different levels without awareness can be problematic.</p><p><strong>Understanding a system’s relationships and levels is crucial for making informed architectural decisions.</strong></p><h3>Context</h3><p>Recognizing that a system extends beyond mere code is crucial. It encompasses a variety of practices and elements, including deployment strategies, documentation, continuous integration and deployment (CI/CD), organizational culture, communication, and testing.</p><p>These components are critical to the success and functionality of any software project. Implementing advanced techniques like canary deployments and feature flags is also essential for facilitating low-risk deployments. Additionally, having meaningful production logs and metrics is indispensable for making informed decisions.</p><p>A key factor in managing high-performing systems is the need for quick and high-quality feedback. Achieving this requires a significant investment in automated testing. Automated testing is not just about speeding up feedback and enhancing code quality; it also serves as a form of <strong>executable documentation</strong>. This type of documentation proves invaluable in understanding the existing code, simplifying modifications, and improving system design.</p><p>While code can serve as documentation, it should not be the sole source. Code often misses the wider context and rationale behind design choices. Documenting and tracking the reasons behind these decisions can be cumbersome.</p><p>Architecture Decision Records (ADRs) offer a solution to this challenge. ADRs provide a lightweight, easily accessible way to document and communicate the rationale behind architectural choices. They are crucial for keeping a clear, historical context of decisions, ensuring that the reasoning behind them is understood and retained throughout the project’s lifecycle.</p><h3>Summary</h3><p>It’s essential to observe your environment and surroundings continuously, stay informed about emerging technologies and approaches, and maintain a learning mindset. However, a healthy skepticism towards new trends is advisable. <strong>Always prioritize the relevance of the software to the business it supports</strong>. The true measure of a software’s greatness is how well it aligns with and supports the business objectives it is designed to serve.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2118b4f161d4" width="1" height="1" alt=""><hr><p><a href="https://blog.softwaremill.com/do-not-copy-successful-architectures-2118b4f161d4">Do not copy successful architectures</a> was originally published in <a href="https://blog.softwaremill.com/">SoftwareMill Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build Cities not Buildings: Holistic Approach to System Design]]></title>
            <link>https://blog.softwaremill.com/build-cities-not-buildings-holistic-approach-to-system-design-603fa83e95d5?source=rss-b62d2906725f------2</link>
            <guid isPermaLink="false">https://medium.com/p/603fa83e95d5</guid>
            <category><![CDATA[software-design]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Michał Grabowski]]></dc:creator>
            <pubDate>Thu, 15 Feb 2024 08:51:33 GMT</pubDate>
            <atom:updated>2024-02-15T08:51:33.878Z</atom:updated>
            <content:encoded><![CDATA[<p>In the dynamic world of software development, creating solutions that are not only innovative but also efficient and maintainable is paramount. This guide combines industry insights, emphasizing practices in promoting excellence in software development. It goes beyond mere coding.</p><h3>The Philosophy of Software Development</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CKzmXBiSM2J3Y4HP" /><figcaption>image from free images stock <a href="https://unsplash.com/">unsplash.com</a></figcaption></figure><h3>Building Cities</h3><p>Software development is more than writing code. It’s about constructing robust ecosystems. Similar to how a city comprises more than its buildings, software is more than its codebase. It’s a complex integration of functionalities, user experiences, and adaptability. This perspective ensures that developers aren’t merely coding but are architecting the environments that support diverse user needs, fostering growth and adaptation.</p><p>This dynamic perception of software emphasizes the importance of the relationships between its components. The system becomes more than just the sum of its parts; the relations between elements are crucial, allowing the software to adapt and respond to evolving user demands. Thus, maintaining a holistic perspective is essential, akin to urban planning, where each building <strong>affects and is influenced by its surroundings</strong>. In software, each component must align with the system’s overall state to enhance its functionality and relevance. Make sure your software remains coherent, adaptable, and meaningful.</p><h3>Incremental Progress</h3><p>The ability to receive feedback from teams, clients, and users is invaluable. Effective software development isn’t the result of an upfront design but a cumulative process of <strong>discovery and exploration</strong>. This journey enhances understanding of the business and problem space, fostering expertise in specific business niches.</p><p>Engineering is fundamentally about experimentation, testing ideas, measuring, and comparing results. It’s these qualities that elevate it beyond mere craftsmanship. Small, visible steps that all stakeholders can experience give software developers a significant advantage over traditional engineering disciplines, making their work more responsive and adaptable.</p><p>The practice of frequent commits underscores the significance of incremental progress in software development. This methodology breaks down the development process into manageable segments, enhancing progress tracking and providing a tangible sense of accomplishment.</p><p>This skill, which evolves with experience and mentorship, transforms large, daunting tasks into a series of smaller, achievable objectives. It’s a testament to the power of small, consistent steps in building complex systems.</p><h3>The Art of Simplicity</h3><p>Developers must focus on what truly matters to the business rather than getting sidetracked by less relevant technical intricacies. The priority should be to align the software with the real-world operations of the business. Recognize what is the actual requirement without adding pure technological aspirations.</p><p>A common pitfall is overemphasizing perfect data consistency, which can lead to overly complicated designs without providing significant benefits. It’s essential to recognize that businesses often thrive in environments of natural inconsistency, and only some issues are technical.</p><p>A deep understanding of the supported business is critical to excel in development. Keeping designs simple and adaptable is vital, and severe design decisions should be deferred as long as possible. When a decision is necessary, opting for the most straightforward available alternative is usually the best approach.</p><p>This strategy enables developers to stay flexible and responsive to evolving business needs. By adopting this mindset, developers can make more informed and effective decisions, leveraging their growing knowledge and the additional information they gather.</p><p>The primary goal is to create intuitively obvious designs, reducing the cognitive load on developers and end-users. A simple design is easier to manage, modify, and understand. This approach involves minimizing the impact of design decisions on the codebase, thereby reducing the need for extensive modifications.</p><p>Developers must remember that what seems straightforward might be complex for others. Therefore, achieving simplicity is a continual process of refinement and understanding from multiple perspectives.</p><h3>Managing Complexity</h3><h3>Accumulation of Complexity</h3><p>Complexity in software is often not the result of a glaring error but the cumulative effect of minor, unnoticed issues. Recognizing and addressing these incremental complexities is crucial to prevent them from escalating into more significant, unmanageable problems.</p><p><strong>Simplicity is the cornerstone of creating maintainable, bug-free software.</strong></p><p>Proactive software development is essential, with refactoring being a continuous process, not a separate task. This approach keeps models relevant and aligned with current understanding. Focusing on interactions between modules, managing dependencies, data exposure, and ownership is necessary.</p><p>Software should be allowed to evolve with modularity and flexibility to avoid being hindered by past decisions. Always design with the possibility of unforeseen changes in mind, ensuring adaptability.</p><h3>Hiding Complexity</h3><p>A key aspect of software development is the creation of effective abstractions. These are simplified representations of complex systems designed to hide unnecessary details while highlighting essential functionality.</p><p>However, developers must be cautious of semantic coupling, where the abstraction inadvertently introduces additional complexity. The challenge lies in crafting abstractions that are both simple and sufficiently informative, striking a balance between too much and too little detail.</p><p>Models in software are simplifications highlighting key elements relevant to a specific context, not detailed replicas of reality. Similarly, abstraction’s role is to capture essential aspects from the solution space, distilling the subject’s essence.</p><p>Abstractions should be scoped narrowly to avoid becoming convoluted by conflicting requirements from various uses. It’s crucial to keep the internal concepts of your model private, as abstraction focuses on language; public elements of your model become binding commitments.</p><p>Therefore, designing the API for communication across boundaries is the most challenging and vital aspect, as it defines how your model interacts with the outside world. It is also what you have promised to the others.</p><h3>Effective Design</h3><h3>Balancing Perfection and Practicality</h3><p>In software development, the developer’s role extends beyond simply minimizing complexity; it involves pragmatic decision-making, discerning when a solution is sufficiently effective, and avoiding the pursuit of perfection.</p><p>This balance is crucial to prevent over-engineering, unnecessary complexity, and resource wastage. Emphasizing practicality and efficiency, it’s essential to recognize what constitutes “good enough,” steering clear of the allure of unattainable ideals. The power of incremental changes is vital in complex systems, where sweeping, radical changes can bring risks and uncertainties.</p><p>Advocating for minor, iterative enhancements promotes continuous refinement, leading to more stable and sustainable development. This approach highlights the importance of carefully balancing idealistic goals and pragmatic implementation in software architecture.</p><h3>The Danger of Overconfidence</h3><p>Overconfidence can be a significant obstacle. This mindset can lead developers to a restricted problem-solving view, often overlooking alternative, more effective solutions. Developers must remain open-minded, constantly questioning and reassessing their decisions to avoid becoming too narrow.</p><p>Another critical aspect is the relationship between the developer and the client. Believing that you understand the client’s business better than they do is a real danger. In reality, developers and clients perceive situations from two distinct perspectives.</p><p>The general rule is that clients’ understanding of their business needs is usually correct. The primary role of software is to support and enhance the capabilities of a business, not to define or restrict them.</p><p>Effective communication within a company, using a well-developed language, is crucial as it facilitates the flow of knowledge. This flow impacts both the mindset of developers and the code they write. It’s not unusual to encounter contradictions or illogical elements in the codebase, which can be valuable opportunities to deepen understanding and, at times, streamline business processes.</p><p>The ideal scenario is a complementary relationship between developers and clients, each extending their capabilities and understanding. Remember, software is meant to support business operations, not dictate them. It’s seldom beneficial when a business has to conform to the limitations of the software in use.</p><h3>Decision-Making</h3><h3>Decision-Making as an Investment</h3><p>In software development, every decision, no matter how small, represents an investment. It’s crucial to consider not just the immediate benefits of an option but its long-term effects. This approach helps make decisions that fully acknowledge their impact on the project.</p><p>Every feature deployed into production brings responsibilities like maintenance, observability, monitoring, and ongoing development. The cost of a feature is not just in its creation but also in the added complexity it introduces. This complexity requires other developers to understand the new elements to continue working on the project.</p><p>Every addition has a cost associated with it. Choosing a particular approach can limit future opportunities. Understanding the cost of implementing a feature in a specific way is essential.</p><p>Always explore multiple alternatives, even if only theoretically. Comparing different solutions allows for a more informed choice. Remember, every decision is a trade-off, requiring compromise.</p><p>Refrain from being too attached to initial ideas, which are often flawed. Consulting with your team or clients early in the process is beneficial. Waiting until the code review stage may be too late for significant changes.</p><p>Engaging the entire team in your work adds value to code reviews and shapes the final solution. If something needs to be clarified to others, it provides valuable early feedback.</p><h3>Embracing Change</h3><p>Embracing change empowers software developers, relieving the burden of attempting to create future-proof designs. This acceptance enables concentrating on solving present challenges effectively. Such adaptability is crucial to building resilient and flexible architectures ready to evolve with changing requirements and technologies.</p><p>It’s natural for developers to be biased towards creating elastic and configurable solutions, aiming to meet future needs. However, this is only effective to a certain extent. We cannot predict the future accurately and only adapt to anticipated changes.</p><p>Often, our predictions need to be corrected, making the added complexity unjustified. This isn’t to discourage striving for adaptable designs; such an approach is valuable. But it’s important to recognize its limitations. Consider what is known and unknown.</p><p>The goal isn’t to build a universal solution but to focus on a custom approach that fits specific needs. Overly complicated solutions, designed in the name of flexibility, may not withstand the test of time in a rapidly changing environment. Starting with something simple can be beneficial.</p><p>Avoid overcomplicating elements that don’t require it. The aim isn’t to achieve perfection but to create solutions that can be easily extended in the future.</p><h3>Conclusion</h3><p>Software development is a perpetual learning, adaptation, and refinement journey. It’s about crafting solutions that meet user needs and stand the test of time, not just fulfilling a developer’s vision.</p><p><strong>Everything in software development is a trade-off; there is no perfect solution.</strong></p><p>Building a complex system is more similar to constructing a city than a single building. Every concept added to the system is both influenced by the existing system and, in turn, influences the entire system. This intricate web of interactions means that every decision made in the development process potentially closes some doors to other opportunities in the future.</p><p>Thus, focusing on sustainable growth while safeguarding essential qualities is vital. Rearranging a complex system is no trivial task. We must ensure that it continuously works and serves its users, adapting and evolving as the needs and contexts change. In this way, software development mirrors the complexities of our ever-evolving world, requiring us to balance innovation, stability, and the greater good.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=603fa83e95d5" width="1" height="1" alt=""><hr><p><a href="https://blog.softwaremill.com/build-cities-not-buildings-holistic-approach-to-system-design-603fa83e95d5">Build Cities not Buildings: Holistic Approach to System Design</a> was originally published in <a href="https://blog.softwaremill.com/">SoftwareMill Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlock the Secrets of Top Tech Highest Performers]]></title>
            <link>https://blog.softwaremill.com/unlock-the-secrets-of-top-tech-highest-performers-5c92ad8823cd?source=rss-b62d2906725f------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c92ad8823cd</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Michał Grabowski]]></dc:creator>
            <pubDate>Tue, 23 Jan 2024 10:52:52 GMT</pubDate>
            <atom:updated>2024-01-23T10:52:52.770Z</atom:updated>
            <content:encoded><![CDATA[<p>For almost ten years, the <a href="https://dora.dev/">DORA research initiative</a> has explored the effectiveness and metrics of top-performing organizations driven by technology. This effort has gathered insights from over 36,000 professionals from various sizes of organizations and a wide range of industries.</p><p>DORA aims to unravel the link between operational practices (capabilities) and their outcomes, focusing on significant achievements both organization-wide and to its members.</p><p>This article is entirely based on the <strong>State of DevOps 2023 report</strong>. I recommend reading the entire report for a more thorough and detailed understanding. You can get your free copy <a href="https://cloud.google.com/devops/state-of-devops">here</a>.</p><h3>Software delivery performance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*E_3CEzohsLo6RvVe" /><figcaption>image from free images stock <a href="https://unsplash.com/">unsplash.com</a></figcaption></figure><p>Performance in software development and operations is commonly measured using four key metrics:</p><ul><li><strong>Change lead time refers</strong> to the time taken from a change being asked for until it is successfully running in production.</li><li><strong>Deployment frequency</strong> measures how often new code is deployed to production.</li><li><strong>Change failure rate</strong> looks at the percentage of deployments causing a failure in production.</li><li><strong>Failed deployment recovery time</strong> is how quickly a team can recover from a failed deployment.</li></ul><p>A common strategy to improve all these metrics is to reduce the batch size of changes for an application. By making smaller, more frequent changes, teams can reduce the lead time for changes, increase the frequency of deployments, lower the risk of significant failures, and make recovery from any failures quicker and easier. This approach streamlines the development process and enhances software delivery’s overall efficiency and reliability.</p><p>Teams that embrace a culture of continuous improvement are often the ones that experience the most significant benefits. This ongoing development and refinement mindset focuses on evolving and enhancing their processes, practices, and products over time. <a href="https://dora.dev/research/2022/dora-report/2022-dora-accelerate-state-of-devops-report.pdf#page=7">Previous studies </a>also show that this is true. No single solution works for everyone, so teams need the freedom to try out different things and see what works best.</p><p>The key to measuring the effectiveness of these improvements is by comparing the progress of the same application over time rather than looking at other applications, organizations, or industries. This approach ensures that the team’s efforts are benchmarked against their past performance, providing a clear and relevant perspective on their growth and development.</p><p>It’s a strategy that emphasizes self-improvement and learning from one’s own experiences, which is crucial for sustained success and innovation in a rapidly changing technological landscape.</p><p>Focusing solely on performance metrics can sometimes result in counterproductive behaviors, as teams prioritize numbers over genuine improvement. Investing in developing capabilities and fostering a learning environment is a more practical approach.</p><p>By emphasizing skill development, knowledge acquisition, and continuous learning, teams are better positioned to adapt, innovate, and enhance performance meaningfully.</p><p>The key insight is that<strong> teams prioritizing learning and growth tend to show the most significant improvements</strong>. This approach aligns with the idea that long-term success is rooted in evolving and responding to new challenges and opportunities rather than just meeting predefined metrics.</p><h3>Organizational performance</h3><p>Organizations often become preoccupied with the newest technology and management fads to enhance developer productivity and overall organizational efficiency. However, research indicates that adopting a user-focused strategy in developing applications and services is vital to an organization’s success.</p><p>To boost performance, it’s crucial to gain a profound comprehension of your users and continuously refine your approach based on their input.</p><p><strong>“Teams that focus on the user have 40% higher organizational performance.”</strong></p><p>User feedback is pivotal in guiding teams to focus on the most relevant aspects, enabling them to develop products and services that genuinely cater to user requirements. This focus leads to an improved user experience and boosts user satisfaction, which in turn can drive increased revenue. By developing capabilities that are more attuned to the users’ needs, organizations set themselves on a path to success.</p><p>Prioritizing the user perspective ensures that product development and delivery teams effectively meet their users’ needs, building the right solutions for their target audience.</p><p><strong>“Focusing on the user leads to 20% higher job satisfaction.”</strong></p><p>Teams centered on user requirements are more likely to develop products and services that align closely with what is genuinely needed. When teams can freely work on and maintain a system that helps their users, they feel happier with their jobs. This also boosts their performance and the quality of the software they deliver.</p><p>A user-centered approach in software development significantly increases performance, which is a crucial point to emphasize. When organizations prioritize their users, they unlock a multitude of advantages.</p><p>By integrating user feedback, teams can align their projects more closely with user needs, leading to products and services that offer better user experiences. This alignment not only enhances user satisfaction but can also lead to increased revenue.</p><h3>Technical capabilities</h3><p>Investing in continuous integration, a loosely coupled architecture, and faster code reviews can bring many positive changes. It can improve the organization’s performance, teams, software delivery, and operations.</p><p>Plus, it’s good for the well-being of those working on the app or service. A loosely coupled design also means a team can test, build, and deploy their work without waiting for other teams. This removes delays and speeds up the process.</p><p><strong>“Teams with faster code reviews have 50% higher software delivery performance.”</strong></p><p>Having an efficient code review process brings many benefits. It improves the quality of the code, helps in sharing knowledge, and ensures everyone has a say in the code. This leads to better team ownership and shared responsibility.</p><p>If there’s less time between finishing the code and reviewing it, it can harm both the developer’s effectiveness and the quality of the software. Smaller code reviews are better. They’re easier for the reviewer to understand and help the team work more efficiently and stay focused.</p><p>Fostering a culture that enables sharing risks, increasing cooperation, and establishing psychological safety is crucial in a workplace. This involves creating an environment where team members feel comfortable taking calculated risks, knowing they have the support of their colleagues. Cooperation is enhanced when everyone feels part of a team working towards a common goal.</p><p>Psychological safety is key, allowing individuals to express their ideas and concerns without fear of negative consequences. This kind of culture improves productivity and enhances job satisfaction and team spirit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*U0jDzpBCWQMmCB0O" /><figcaption>image from free images stock <a href="https://unsplash.com/">unsplash.com</a></figcaption></figure><h3>Documentation</h3><p>High-quality documentation is more than just a guide; it acts as a repository of team knowledge. This becomes especially important as team members come and go, ensuring that valuable information and insights are retained and accessible. Good documentation also positively influences team performance, productivity, and job satisfaction.</p><p><strong>“Trunk-based development, for example, is estimated to have 12.8x more impact on organizational performance when high-quality documentation is in place relative to low-quality documentation.”</strong></p><h3>Flexible infrastructure</h3><p>Cloud computing plays a crucial role as a core enabler of flexible infrastructure. It’s not just about using cloud services; how a team utilizes them is a more significant predictor of their performance. Proper use of cloud computing can lead to remarkable improvements in job satisfaction and productivity and a notable decrease in burnout.</p><p>Teams that effectively leverage the adaptability and scalability of cloud computing can achieve greater efficiency and better outcomes, contributing to overall job satisfaction and productivity.</p><p><strong>“Using a public cloud, for example, leads to a 22% increase in infrastructure flexibility relative to not using the cloud. This flexibility, in turn, leads to 30% higher organizational performance than inflexible infrastructures.”</strong></p><p>Merely moving your workload from a data center to the cloud isn’t enough for success. To truly benefit from cloud computing, you must fundamentally rethink how you build, test, deploy, and monitor your applications. This involves embracing the<a href="https://softwaremill.com/blog/?author=Grzegorz%20Kocur"> five essential characteristics of cloud computing</a>: on-demand self-service, broad network access, resource pooling, rapid elasticity, and measured service.</p><p>The data confirms that cloud computing has a largely positive impact on employee well-being. By streamlining processes and making resources more accessible and manageable, cloud computing can reduce stress and increase job satisfaction, contributing to a healthier work environment. Leveraging public cloud infrastructure greatly diminishes the risk of burnout.</p><h3>Culture</h3><p>Culture is a vital factor in both employee well-being and organizational success. A healthy workplace culture significantly reduces burnout, boosts productivity, and enhances job satisfaction. This positive environment benefits individuals and considerably improves organizational performance, including software delivery, operational efficiency, and team effectiveness.</p><p>In a healthy organizational culture, teams are more adept at implementing technical capabilities that lead to improved outcomes. This culture fosters a supportive environment where innovation, collaboration, and continuous improvement are encouraged. As a result, teams are better equipped to take on new challenges, adapt to changes, and efficiently utilize technological advancements.</p><p>A strong and positive culture is a foundational element enabling teams to thrive and excel in their endeavors.</p><p><strong>“Teams with generative cultures have 30% higher organizational performance.”</strong></p><p>A healthy organizational culture improves technical capabilities. A positive and supportive culture aids in effectively implementing these capabilities, fostering an environment where innovation and efficiency thrive.</p><p>Moreover, a healthy culture benefits technical improvements and plays a crucial role in enhancing employee well-being. In environments where employees feel valued and supported, there is often a noticeable improvement in their overall job satisfaction and productivity.</p><p>A healthy culture is ultimately foundational to an organization’s health and success. It’s a crucial element that influences every aspect of an organization, from its technical capabilities and employee well-being to its overall performance and growth.</p><h3>Conclusion</h3><p>It’s fantastic that this research has been conducted. We now have concrete data on what is effective and why. This information gives us insights into what’s truly important in creating exceptional software.</p><p>Again, I strongly recommend reading the entire report. The value of their findings can‘t be overstated. There are other intriguing topics I haven’t touched on, such as resilience and the role of AI in the industry. The report also describes the methodology, demographics, models, and more.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c92ad8823cd" width="1" height="1" alt=""><hr><p><a href="https://blog.softwaremill.com/unlock-the-secrets-of-top-tech-highest-performers-5c92ad8823cd">Unlock the Secrets of Top Tech Highest Performers</a> was originally published in <a href="https://blog.softwaremill.com/">SoftwareMill Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The biggest waste in software development]]></title>
            <link>https://blog.softwaremill.com/the-biggest-waste-in-software-development-87536e21c441?source=rss-b62d2906725f------2</link>
            <guid isPermaLink="false">https://medium.com/p/87536e21c441</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[business-needs]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Michał Grabowski]]></dc:creator>
            <pubDate>Wed, 10 Jan 2024 08:32:41 GMT</pubDate>
            <atom:updated>2024-01-10T08:32:41.516Z</atom:updated>
            <content:encoded><![CDATA[<p>A saying stands out in the software industry: <strong>Building the wrong thing is the biggest waste in software development</strong>. This simple sentence highlights a big problem that developers and companies face. Let’s break it down and see how we can avoid falling into this trap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Bu7Q4AxmtX-kvywJ" /><figcaption>image from free images stock <a href="https://unsplash.com/">unsplash.com</a></figcaption></figure><h3>Understand What the Business Really Needs</h3><p>A critical aspect often overlooked in software development is the profound importance of understanding the real needs and desires of the business. The essence lies in this simple truth: to craft <strong>exceptional software</strong>, one must understand what the business genuinely needs and wants. All too often, developers fall into the trap of assuming they know what is desired, leading to the creation of features that prove to be anything but helpful.</p><p>Avoiding this common pitfall in software development is achievable through consistent and meaningful communication with users and domain experts. It begins with engaging them in the early stages of development and maintaining this dialogue throughout the software creation journey.</p><p>Software is based on the domain experts’ knowledge and perspective. Regular communication with these experts is critical to refining our understanding and improving our models. This collaborative approach benefits both software developers and domain experts. The need to develop detailed, almost mathematical models that capture complex concepts, relationships, and processes enables us to derive business insights of great value.</p><p>Make sure your language closely mirrors your codebase. This approach makes it easier to discuss the code with individuals without programming knowledge. It creates space for ongoing refinement and a deeper understanding of the domain. The <strong>one-to-one relationship</strong> between the system and business language allows for seamless integration of unexpected modifications, as both operate within the same linguistic framework.</p><p>If a change is straightforward from a business perspective and our system accurately mirrors this understanding, there is undoubtedly room to implement such changes efficiently. This alignment ensures that updates reflecting business realities can be efficiently and effectively incorporated into the system.</p><p>Developers should stay closely connected with the people involved in the business, as this fosters the gathering of invaluable insights and prompt feedback. Such interactions enable developers to verify that their software closely aligns with real business needs, ensuring their work is directly relevant and effectively meets business requirements.</p><p>In essence, it’s about <strong>co-creating </strong>a solution that satisfies expectations, resulting in a software product that stands out in its utility and relevance.</p><h3>Recognize What Matters</h3><p>In building effective solutions, a critical misstep is failing to grasp what truly adds value to the business. Developers often cling to assumptions about what matters, overlooking real business needs. This oversight is problematic for two key reasons.</p><p>Firstly, it hampers the ability to address the actual needs of the business. Our solutions may fail to deliver real value if we’re not fully aware of what the business requires and how it operates. This disconnect can lead to developing features or aspects the business doesn’t find useful or necessary.</p><p>Secondly, a lack of understanding often results in over-complicating the solution. Developers might start solving imagined problems they presume are valuable to the business. However, these <strong>self-conceived ideas rarely align with actual needs</strong>. This approach wastes resources and leads to over-engineered products that don’t fulfill their intended purpose.</p><p>Moreover, an incomplete grasp of business problems can lead to an <strong>overreliance on technology.</strong> Technology, while integral, is not the solution in itself. Most challenges are not fundamentally technological. Focusing solely on the technical aspects, especially using new technologies for their own sake, exacerbates the issue. It results in an over-engineered, tech-heavy solution that fails to address primary needs.</p><p>Software is an ever-evolving matter; the future is unknown. This uncertainty underscores the necessity of constant feedback and refinement. By progressively refining the product based on real-time regular feedback, we can ensure that the result is both technologically sound and, more importantly, genuinely valuable for the business. This approach moves us closer to building the right thing — a solution that genuinely matters to the company it serves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JY3Qop4zlu1TIDPO" /><figcaption>image from free images stock <a href="https://unsplash.com/">unsplash.com</a></figcaption></figure><h3>The High Cost of Heading in the Wrong Direction</h3><p>Embarking on the wrong path in software development carries a high price tag, extending far beyond the hours dedicated to writing code. The actual cost encompasses lost opportunities and significant delays in bringing your product to the market.</p><p>This notion is at the heart of the matter: once you’ve started down the wrong road, it’s not just about the coding effort but the potential that slips through your fingers and the precious time lost before your product sees the light of day.</p><p>The answer to mitigating this costly misdirection lies in adopting a work methodology that enables you to build your software incrementally and iteratively, much like the Agile approach.</p><p>This methodology allows you to construct your software piece by piece, addressing specific functionalities modularly. By doing so, you create the opportunity to course-correct swiftly and efficiently. If you discover that you’re veering off course, you can make the necessary adjustments promptly rather than waiting until the entire project is complete.</p><p>This approach serves as a strategic compass, helping you navigate the complex terrain of software development with greater agility and precision, reducing the overall cost of heading in the wrong direction.</p><h3>Happy Teams Make Better Software</h3><p>The happiness and well-being of your software development team significantly impact the quality of the software they produce. The central concept here is that when a team works on a project that is discarded or heavily criticized, it can adversely affect their morale, resulting in<strong> reduced productivity and creativity</strong>.</p><p>Ensuring that your team remains motivated and engaged, leading to the creation of better software, begins with cultivating a team culture that prioritizes several vital principles. It’s crucial that every team member feels <strong>their ideas and contributions are valued and respected</strong>. This fosters a<strong> sense of ownership and empowerment</strong>, encouraging team members to invest their best efforts into projects.</p><p>Additionally, it is vital to create an environment where it’s not only acceptable but encouraged to <strong>make mistakes and learn from them</strong>. Mistakes are an inherent part of the learning process, and by embracing them as opportunities for growth, you promote continuous improvement within your team.</p><p>Furthermore, it’s essential to celebrate even small successes along the way. Recognizing and acknowledging the team’s achievements, no matter how incremental, provides positive reinforcement and boosts team morale.</p><p>Lastly, encouraging new ideas within the team <strong>catalyzes creativity and innovation</strong>. By fostering a culture where team members feel comfortable sharing their thoughts and suggestions, you tap into a<strong> valuable source of fresh perspectives and potential improvements</strong>.</p><p>In essence, nurturing a happy and empowered team leads to increased productivity, creativity, and better software development, ultimately contributing to the overall success of your projects.</p><h3>Using Your Team’s Skills Wisely</h3><p>Harnessing your software development team’s skills and abilities is paramount to the success of your projects. The central theme here is that when a project takes a wrong turn, it’s more than time and money that goes to waste. The <strong>talent and creativity </strong>of your team is also wasted.</p><p>To ensure that your team’s expertise is used wisely and effectively, create an environment where their input and insights are valued and actively discussed. Allowing your team a say in project decisions is a powerful way to make them feel more <strong>involved and engaged</strong>. When team members are encouraged to voice their opinions, it opens the door to diverse perspectives and ideas.</p><p>Actively listening to your team’s ideas is critical. Every team member brings unique skills and experiences, and their input can lead to better-informed decisions and innovative solutions. You tap into your <strong>team’s collective creativity</strong> by embracing and integrating their ideas into the decision-making process.</p><p>Involving your team in decision-making and valuing their contributions makes them feel more involved and enhances the overall quality of your project outcomes. It’s a win-win scenario that maximizes the efficient use of your team’s skills and fosters a culture of collaboration and innovation within your organization.</p><h3>Your Reputation is on the Line</h3><p>Your company’s reputation is closely tied to the quality of the software you produce. When software falls short of user expectations, it negatively impacts your organization’s public image. This can lead to various issues, including poor reviews, dissatisfied users, and, ultimately, the loss of valuable customers.</p><p>The actual value of any tool lies in its ability to meet user needs effectively. This principle is crucial for software development. The success of a product depends on how well it fulfills user requirements and the overall user experience. Is the software intuitive and user-friendly, or is it cumbersome and difficult to navigate? Designing a product that users love requires accepting and incorporating their feedback progressively.</p><p>Developers must understand the business and its stakeholders, immersing themselves in their mindset to create a highly relevant tool. The software’s functionality, behavior, and appearance directly reflect the company and shape how the public perceives it.</p><p>It is essential that users feel the product is tailored to their needs. The goal is to serve and support the users rather than force them to adapt to the product.</p><h3>Conclusion</h3><p>In conclusion, the software development journey is dynamic and intricate, filled with challenges and opportunities. Several vital principles come to the forefront to ensure you steer clear of the pitfalls of building the wrong software.</p><p>First and foremost, prioritizing a deep understanding of what users genuinely need is paramount. This involves engaging with users early and often, utilizing surveys, interviews, and software test versions. Doing so can align your development efforts with business expectations, creating functional, genuinely valuable, and meaningful software.</p><p>Additionally, the ability to adapt and adjust swiftly is crucial. Embracing methodologies like Agile allows for the early detection of misdirection, enabling you to make necessary corrections promptly. This agile approach saves time and ensures your software remains in sync with the ever-evolving business demands.</p><p>Moreover, nurturing a happy and engaged development team is essential. Team members who feel valued and encouraged to share their ideas are more likely to contribute to better software. Celebrating small victories and fostering a culture of innovation can enhance team morale and creativity.</p><p>The path to building the right software is paved with user-centricity, adaptability, market awareness, and team well-being. Remember,<strong> it’s not just about doing things well; it’s about doing the right things</strong>. This approach conserves resources and results in software that resonates with users, fulfilling their needs and preferences, ultimately leading to success in the ever-evolving world of software development.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87536e21c441" width="1" height="1" alt=""><hr><p><a href="https://blog.softwaremill.com/the-biggest-waste-in-software-development-87536e21c441">The biggest waste in software development</a> was originally published in <a href="https://blog.softwaremill.com/">SoftwareMill Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Navigating Through the Storm]]></title>
            <link>https://blog.softwaremill.com/navigating-through-the-storm-93c54fa44f38?source=rss-b62d2906725f------2</link>
            <guid isPermaLink="false">https://medium.com/p/93c54fa44f38</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[immune-system-overload]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[efficient-systems]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Michał Grabowski]]></dc:creator>
            <pubDate>Wed, 03 Jan 2024 13:25:33 GMT</pubDate>
            <atom:updated>2024-01-03T14:15:22.429Z</atom:updated>
            <content:encoded><![CDATA[<h3>Managing system overload</h3><p>Managing high throughput and preventing systems from overloading in our digital-driven world is vital for any online service’s long-term success. Overloads not only cripple performance but can also lead to customer dissatisfaction and significant revenue loss.</p><p>Let’s explore the intricacies of managing overloaded services, presenting in-depth strategies and insights for maintaining system resilience under load.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JlUUV1dFAK_2L5YX" /><figcaption>image from free images stock <a href="https://unsplash.com/">unsplash.com</a></figcaption></figure><h3>The Perils of Overload</h3><p>When a system is overwhelmed with more requests than it can effectively process, a cascade of problems can ensue, significantly undermining its performance and reliability.</p><p>One of the most immediate and noticeable consequences is the degradation of performance. In such scenarios, users may face frustratingly slow response times or complete timeouts in more severe cases. This not only hampers the user experience but can also erode trust in the system’s reliability.</p><p>Another critical issue is the need for more resources on requests that are doomed to fail. Many will likely time out when the system is bombarded with excessive requests. Despite this, valuable processing power and memory are consumed in attempting to fulfill these requests, leading to an inefficient allocation of resources. This inefficiency is particularly problematic during periods of high demand, as it diverts resources away from potentially successful requests.</p><p>The situation can be further exacerbated by what is known as a ‘<strong>retry storm</strong>.’ This phenomenon occurs when clients, following standard protocols, automatically retry their requests after experiencing failures or timeouts.</p><p>While ordinarily a useful feature, in system overload situations, these retry attempts contribute to an already overwhelming load. This creates a vicious cycle, where the increased number of requests leads to more failures, which prompts more retries, adding to the system’s burden.</p><p>One critical issue we can face during such overloads is memory exhaustion. Modern systems rely heavily on in-memory operations for speed and efficiency. However, during periods of overload, the demand for memory can outstrip the available supply, leading to a shortage.</p><p>This shortage can cause services to crash or restart unexpectedly, introducing further instability into the system. In extreme cases, it can lead to a complete shutdown of services, as the system cannot process even a single request effectively. This disrupts ongoing operations and negatively affects the system’s health and user trust.</p><h3>Causes of overload</h3><p>Understanding and addressing the root causes of system overload is crucial for maintaining the efficiency and reliability of any digital system. Here’s an in-depth exploration of the key factors contributing to system overload. By thoroughly understanding these factors, organizations can better prepare and scale their systems, ensuring resilience and reliability even under varying and challenging conditions.</p><h3>Under-scaled Backend Services</h3><p>The backbone of any digital system is its backend services. Problems often arise when these services aren’t equipped to handle increasing loads. This under-scaling can manifest in various forms, such as insufficient hardware resources, limited processing power, or inadequate memory.</p><p>Poorly optimized databases are another common issue; they can become sluggish under heavy load, significantly impacting performance. Moreover, network capacity plays a pivotal role. If the network infrastructure can’t support the transmitted data volume, it becomes a significant bottleneck, leading to system overload.</p><h3>Faulty Deployments or Network Issues</h3><p>Deployment phases are critical, and errors during this process, such as misconfigurations or overlooked settings, can lead to substantial resource drains. These issues might not be immediately apparent but can escalate over time, significantly damaging the system. Network stability is equally vital. Instabilities or bottlenecks in the network can exponentially increase the load on the system, leading to delays and disruptions in service.</p><h3>Issues with Cloud Providers</h3><p>In an era where cloud computing is ubiquitous, the performance of cloud providers is integral to the health of the systems relying on them. While these providers generally offer reliable services, they are not immune to experiencing outages or degraded performance. Such issues can have a cascading effect on the systems that depend on these services, leading to widespread performance degradation.</p><h3>Traffic Pattern Fluctuations</h3><p>User behavior is often unpredictable, and systems must be designed to handle varying traffic patterns. This includes predictable fluctuations, such as increased usage during certain hours of the day, and unpredictable ones, like those caused by viral trends or unforeseen events. Additionally, seasonal events or marketing campaigns can lead to sudden spikes in traffic, which can overwhelm systems unprepared for such surges.</p><h3>Dependency Slowdowns</h3><p>Modern digital systems frequently rely on a network of external services and APIs. While this interconnectivity brings many benefits, it also introduces vulnerabilities. If one of these external services slows down, experiences an outage, or faces any issues, the entire system can become a bottleneck.</p><p>This interdependence means that the overall system’s performance is only as strong as its weakest link. As a general principle, services are designed to be autonomous, meaning they should possess all the data necessary to perform their tasks.</p><p>However, this is only sometimes achievable. There are instances where a service must rely on external resources. Given that we don’t have control over these external resources, it’s prudent to assume they may not always be reliable.</p><p>To mitigate this, it’s essential to implement fundamental safeguards such as circuit breakers, limiters, and bulkheads. By doing so, we can judiciously manage our resources, including time, CPU, and network bandwidth.</p><h3>Eyes wide open</h3><p>To grasp the concept of system overload, we must first establish precise performance and resilience benchmarks. This is where Google’s Site Reliability Engineering (SRE) approach becomes handy. SRE is a set of best practices and principles that are aimed at helping us create more resilient and available services.</p><p>SLOs set the desired performance goals, while SLIs measure a service’s performance. For instance, an SLO may aim for a service to be available 99.9% of the time, with the SLI tracking the uptime. Similarly, response time SLOs might demand that 95% of server queries respond within 200 ms, with the SLI recording how many queries meet this standard.</p><p>SLOs are instrumental in identifying system overloads. When performance surpasses these predefined limits, it signals the need for corrective measures. SLOs are not merely for gauging system performance; they’re vital for managing and addressing overloads, enabling swift identification of issues, and efficient allocation of resources. In scenarios of limited resources where SLOs are exceeded, prioritization decisions must be made, sometimes sacrificing less essential features like generating reports in the background.</p><p>Defining actual requirements based on client expectations is also critical. These parameters are necessary for making sound decisions. Remember, maintaining reliable services can be expensive and requires precise requirements. With well-designed performance metrics, identifying true system overload becomes easier.</p><p>Prompt detection of performance and stability issues is critical. Tracking metrics like error rates and response times can trigger automated responses such as load shedding, throttling, or autoscaling.</p><h3>Handling the Load</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*tGjqW9DTW-WgAy6A" /><figcaption>image from free images stock <a href="https://unsplash.com/">unsplash.com</a></figcaption></figure><p>Effective load management balances resource availability, cost-efficiency, and system performance. Organizations can create robust, scalable, and resilient digital infrastructures capable of handling diverse load scenarios by combining scaling techniques with overprovisioning and sophisticated queueing systems.</p><h3>Horizontal Scaling</h3><p>This approach involves adding more servers to the existing pool, effectively distributing the workload across a larger number of nodes. Horizontal scaling is particularly effective in managing increased traffic, allowing for a flexible and dynamic response to changing load patterns. This method is often favored in cloud environments due to its scalability and flexibility.</p><h3>Vertical Scaling</h3><p>Unlike horizontal scaling, vertical scaling refers to adding more resources, such as CPU power or memory, to existing servers. This enhances the capacity of individual nodes to handle more intensive tasks or larger volumes of data. Vertical scaling can be a quicker fix than horizontal scaling, but it often has physical and practical limits.</p><h3>Autoscaling</h3><p>Autoscaling dynamically adjusts the number of resources in response to the workload demand. It’s an automated process that can scale horizontally and vertically, depending on the configuration. However, while autoscaling can trigger the provisioning of additional resources, this provisioning isn’t immediate. The time taken to provision and deploy new resources can vary, and during this period, the system might still experience performance issues if the demand is high. This delay is a critical factor when implementing autoscaling to handle varying workloads.</p><h3>Overprovisioning</h3><p>Maintaining a buffer of additional capacity is a proactive measure to handle unforeseen surges in demand. This involves operating with more infrastructure than is typically required for everyday operations. Overprovisioning ensures that there is always a margin of extra capacity available to absorb spikes in load without impacting performance. While this approach incurs additional costs, it provides a safety net against sudden traffic increases and can be crucial for maintaining service availability and performance.</p><h3>Queueing</h3><p>Implementing an advanced queueing mechanism is critical to managing how requests are processed in a system. By using queues, tasks can be organized and handled efficiently, ensuring that resources are allocated in a controlled manner. This can involve setting up priority queues, processing critical tasks ahead of less urgent ones, and maintaining system efficiency and responsiveness.</p><h3>Rate Limiting</h3><p>Rate limiting can be employed as a queueing strategy. This involves restricting the number of requests a user can make in a given time frame, which helps prevent the system from becoming overwhelmed by too many simultaneous requests. Rate limiting is particularly effective in mitigating the risks associated with traffic spikes.</p><h3>Overload Management</h3><p>A proactive approach to managing system overload is crucial for maintaining performance and reliability. By incorporating the strategies below, you can create a system that is not only capable of handling unexpected surges in demand but also recovers quickly and efficiently from them, ensuring continuous service availability and a positive user experience.</p><h3>Proactive Scaling</h3><p>The cornerstone of an effective overload management strategy is anticipating potential overload scenarios. You can scale your resources in advance by closely monitoring system usage trends and predicting times of high demand. A good example could be the Black Friday surge or any similar event. This scaling can be either vertical, involving the enhancement of existing resources, or horizontal, where additional resources are added. This proactive scaling ensures that the system can handle increased loads without performance degradation.</p><h3>Cascading Failure Prevention</h3><p>It’s essential to understand the interconnected nature of modern systems, where an overload in one component can trigger a domino effect, leading to widespread failures. Identifying critical components and implementing safeguards against overload can prevent such cascading failures. This involves setting up thresholds and alarms that trigger protective measures when specific usage metrics are approached.</p><h3>Efficient Work Management</h3><p>In the event of an overload, it’s crucial to ensure that ongoing work is well-spent. Implementing strategies like saving the state of partially completed tasks allows these tasks to be resumed or completed once the system stabilizes. This conserves resources, helps maintain data integrity, and reduces recovery time.</p><h3>Resilience Building</h3><p>Designing systems for resilience is critical to handling overloads effectively. This involves creating robust error-handling mechanisms that can gracefully manage unexpected surges in demand. Implementing failover mechanisms ensures that if one component fails, another can take over, thus maintaining service continuity. Additionally, regular stress testing of the system can help identify potential weak points and allow for preemptive strengthening.</p><h3>Learn From Failure</h3><p>Failures are a priceless source of knowledge. They present a tremendous opportunity to enhance the resilience and quality of our systems. Google Site Reliability Engineering (SRE) promotes a culture where teams learn from mistakes and strive for continuous improvement. This approach isn’t limited to just technical aspects; it can also apply to refining deployment processes or monitoring systems. In this culture, each failure is viewed not as a setback but as a learning opportunity. It’s an invitation to delve into the root cause when something goes wrong. Understanding the intricacies of the systems allows us to identify areas for improvement. This method fosters a proactive mindset among team members, encouraging them to anticipate and address potential issues before they escalate.</p><h3>Advanced Techniques</h3><p>Sophisticated techniques for managing system overload extend beyond basic strategies, focusing on more nuanced and dynamic ways to handle surges in demand. Each technique requires careful calibration, monitoring, and a deep understanding of the system’s capabilities and limits. When implemented effectively, they can significantly enhance the system’s ability to handle high loads while maintaining performance and reliability.</p><h3>Load Shedding</h3><p>This technique involves deliberately dropping some incoming requests to prevent the system from becoming overwhelmed. It’s a strategic decision where non-essential requests are sacrificed to ensure that the most critical functions of the system continue to operate smoothly. By prioritizing certain types of traffic or requests, load shedding helps maintain the integrity and availability of crucial services.</p><h3>Throttling</h3><p>Throttling controls the rate of incoming requests to prevent the system from becoming overloaded. It involves limiting the number of concurrent requests that can be processed. This can be done on a user basis, where each user is only allowed a certain number of requests per second, or on a system-wide basis, where the total number of requests the system processes is capped. Throttling ensures a more equitable and smoother distribution of the load across available resources, enhancing system performance under heavy demand.</p><h3>Concurrency Control</h3><p>This involves managing the number of in-flight requests at any given time to prevent any single component of the system from becoming a bottleneck. Controlling the concurrency level ensures that every part of the system is manageable with a few simultaneous processes. This requires a delicate balance; too few concurrent processes and the system must be utilized more. There are too many, and it risks becoming overwhelmed.</p><h3>Backpressure</h3><p>Backpressure is a mechanism that resists excessive input to the system by blocking further incoming requests or rerouting traffic to less strained system parts. This approach benefits distributed systems where specific nodes might be more heavily burdened than others. By implementing backpressure, the system can signal upstream components to slow down the request rate, thereby preventing system overloads and ensuring stability.</p><h3>Conclusion</h3><p>Effectively managing overloaded services in high-throughput environments requires a blend of technical knowledge, strategic foresight, and a proactive mindset. Organizations can navigate the complexities of system overload by understanding the root causes, implementing a mix of scaling, load shedding, and throttling techniques, and learning from industry practices. The key is not just in scaling up resources or reducing load but in intelligently managing and anticipating the demands placed on your system.</p><p>Reviewed by: Bartek Żyliński, Krzysztof Ciesielski</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93c54fa44f38" width="1" height="1" alt=""><hr><p><a href="https://blog.softwaremill.com/navigating-through-the-storm-93c54fa44f38">Navigating Through the Storm</a> was originally published in <a href="https://blog.softwaremill.com/">SoftwareMill Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advanced large-scale DDD]]></title>
            <link>https://blog.softwaremill.com/advanced-large-scale-ddd-72eafc8d6050?source=rss-b62d2906725f------2</link>
            <guid isPermaLink="false">https://medium.com/p/72eafc8d6050</guid>
            <category><![CDATA[domain-driven-design]]></category>
            <category><![CDATA[bounded-context]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[system-architecture]]></category>
            <dc:creator><![CDATA[Michał Grabowski]]></dc:creator>
            <pubDate>Tue, 12 Dec 2023 07:54:16 GMT</pubDate>
            <atom:updated>2023-12-12T07:54:16.337Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>The most complex domains require tools to model larger structures and concepts. Developers need to understand the model to evolve it effectively. It’s easy to lose track of where things belong. It becomes difficult to reveal the meaning and relationships between distinct system parts. We may quickly lose the most remarkable advantages of DDD. There is a need to structurize the model and introduce particular architecture on the model level.</p><p>Architecture imposes certain constraints that make the model more explicit and clear. Relevant aspects of the business must be carefully separated from each other to keep them meaningful and easy to understand. The goal is a system that is easy to reason about and develop. Tools that allow us to describe the system as a whole are a necessity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-5RmIyiyRLDOJbCt" /></figure><h3>Responsibility Layers</h3><p>This approach employs a layered model, which assumes the division of a system into layers. Each layer has a narrowly defined responsibility and does not know what is above it, while the higher layers can use the functions of the layers below.</p><p>Here, we have two main approaches. A more radical one that assumes the use of only the direct underlying layer. A more flexible one that allows the use of any lower layer.</p><p>By definition, the “<strong>Responsibility Layers”</strong> model is based on the second, more relaxed approach so that each layer can use domain functions from any layers below.</p><p>The layered model, used at the system or application level, delineates its responsibilities based on technical aspects. This model’s decisions are rooted in purely business considerations, aiming to divide the model into smaller parts. We are focused on emphasizing business responsibilities and the relationships between them. The layers will also form an essential part of the ubiquitous language.</p><p>Every business has its natural stratification. Therefore, the selection of specific layers will depend on the particular case. It would be difficult to predetermine such layers; instead, it results from the model’s evolution. Over time, as we better understand our domain, we will notice that certain concepts are based on others, lower down.</p><p>Several proven heuristics allow for the recognition of the layered nature of a model.</p><p>- <strong>Linguistic Context</strong> — We cannot speak of sales without having a product or service. The concept of sales is based on the product/service. We can model a product without knowing about the existence of sales.</p><p>- <strong>Evolutionary Context</strong> — Some model elements will change at a different pace and for various reasons than others. We will change the concept of price less frequently than the discount model based on it.</p><p>- <strong>The storytelling context</strong> of layers communicates priorities and the realities of the domain. The choice of layers is a purely business decision.</p><p>Let’s describe an exemplary layered model based on a transport company. Similar layers can be observed in many other domains. In particular, the first two layers tend to occur almost everywhere.</p><p>- <strong>Capabilities</strong> — the actual possibilities we have. In a logistics company, these would be trucks, railway wagons, agreements with airports or ports, and access to traffic density data — all the resources that allow for the transportation of goods from point A to point B. Our resources do not know what we use them for; they model the capabilities. Not all possibilities will be utilized by our business. We can discuss transport schedules without considering the actual loads these units transport.</p><p>- <strong>Operations</strong> — here, we talk about the current and actual activities of the business. A logistics company picks up a package from one location and commits to delivering it to another. Of course, to make this possible, this layer must use trucks, cars, or trains. However, the execution of the entire process will require various means of transportation so that the package ultimately reaches the recipient. If we want to track our shipment, we must be aware of the unit transporting it — here, we depend on the layer below and coordinate its work.</p><p>- <strong>Policies</strong> — this is where we describe what we want to achieve or aim to optimize. We might optimize for the security of the shipment, the cost of delivery, or the time it takes. These will be certain specifications that determine the behavior of operations.</p><ul><li><strong>Commitments</strong> — all kinds of agreements and contracts. Namely, things that obligate us to specific behaviors. For example, to deliver a package within three days.</li><li><strong>Decision Support</strong> — the layer responsible for selecting the appropriate policy. A decision may arise from legal regulations in a contract with a client and may vary depending on the period or even a specific client. If this is our essential customer, we might focus on building the relationship and delivering the package faster, sometimes even at the expense of individual profit.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y1v0ZO0j_ToVnGlz" /></figure><p>Each of these layers may constitute its independent context or parts of it. We could use strategies or machine learning, rely on existing data warehousing mechanisms, or utilize an existing rule engine in the decision layer. It’s worth noting that such a division may not be limited to a single bounded context.</p><p>The benefits of this approach indeed come to the fore within highly complex systems. By deliberately delineating our business’s objectives and capabilities, we can prevent the conflation of concepts. It can also help us avoid introducing confusion into our shipping organization’s management model, such as blending in the minutiae of specific transportation means usage, the intricacies of process optimization, or decision-making methodologies. We address these considerations on three distinct levels:</p><ul><li><strong>Usage</strong> — focus on what resources we utilize and how they are coordinated.</li><li><strong>Optimization and Prioritization </strong>— define what aspects of our operation we aim to refine and elevate in importance.</li><li><strong>Rationale</strong> — clarify why we adopt certain strategies under specific conditions.</li></ul><p>With planning, it’s easier for these distinct responsibilities to become entangled, leading to a challenging model to read, understand, and develop further. Our objective is to consciously delineate dependencies and awareness within our operations. This separation not only clarifies roles and responsibilities but also enhances the stability of our model.</p><h3>Guidance</h3><p>When making changes such as shifting focus from cost to customer relations and aiming for shorter delivery times — we must ensure that our modifications do not inadvertently affect unrelated system components. For example, suppose we decide to dispatch trucks earlier to improve delivery times, even when they aren’t fully loaded. In that case, we must ensure this doesn’t result in unforeseen issues like GPS malfunctions in our vehicles. This level of careful change management ensures that improvements in one area do not cause disruptions in another.</p><p>The layers form an outline of the story that our system tells. The division imposed by bounded contexts prevents the blurring and contamination of models. However, it does not help to see the system as a coherent whole. In an extensive system, people will work independently at various levels.</p><p>Without guidance, different teams will create separate solutions, which leads to difficulties in understanding how the individual parts fit together. The large-scale structure must evolve as part of the domain model. An ill-chosen structure is worse than no structure at all. A proper structure can be found only through a deep understanding of the domain and the problem. The practical route to that understanding is an iterative development process.</p><p>Sometimes, it is criticized that at the capability layer, we deal with aspects that the business did not request — potential abilities that we have but that the business does not use. However, having such a division often makes adding new functionalities simpler and faster. By modeling the capability layer in complete isolation, we do not contaminate it with artificial limitations. It is just that the operational layer only uses a portion of the available capabilities.</p><h3>Knowledge Level</h3><p>Relationships between objects can be very complex. They may even change dynamically and result from configuration. For example, organizations are composed of people and smaller organizations, each with defined roles and relationships with other units. Such structures can be very complex and, more importantly, may look different in each organization, using various departments, names, permissions, or policies.</p><p>The Knowledge Level is a particular case of the reflection pattern, which allows capturing changing needs by making the system self-aware. We divide a given concept into two levels. The Base Level carries out operational responsibilities. Meta Level represents knowledge about behavior and structure.</p><p>The meta-model describes how various employees and their relationships are organized and what rules govern them. It enables the organization of data from the base model. It defines how we can organize and manipulate that data. The meta-model describes the blueprint for organizing the base model.</p><p>Thus, it answers questions like:</p><ul><li>A department can contain many positions.</li><li>A manager oversees the employees within their department.</li><li>An employee is assigned to one department.</li></ul><p>These are not rigid rules; they may depend on many different factors. The meta-model can be derived from configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PM4Sww-xtFyEhHPQ" /></figure><p>It sounds very similar to the layers described above, yet these are not the same layers. The difference here lies in the flow of dependencies. The Knowledge Level is based on the bidirectional dependency of the base and meta-models.</p><p>This method is apparent in the Party Archetype. The structure’s model is complex, and managing the relationships separately is helpful. This way, each part can evolve without affecting the other. It also makes it easier to reuse parts of the system. Our goal isn’t to create a one-size-fits-all solution, though. We want to keep our system flexible while still focusing on the critical aspects of our domain.</p><h3>Conclusion</h3><p>These aren’t the only model architectures out there, but they serve as great examples to appreciate their power. Along with bounded context and distillation, these structures are techniques for shaping models. However, this is an optional technique.</p><p>Each model architecture has its strengths. These examples highlight how effective they can be when applied correctly. When we talk about bounded context, we refer to setting clear boundaries within which a particular model is defined and relevant. Distillation, conversely, is about refining and simplifying a model to its essence.</p><p>Adding structures, such as new layers or components, can enhance a system’s capabilities, but it also brings additional complexity that may not be necessary. The key is to balance the benefits of these structures against their cost in complexity. They should only be introduced when they add clear value and align with the goals of the domain. It is essential to remember that adding more structures to a system can make it more complex, and in most cases, it is just not worth the effort.</p><p>By treating these structures as optional, we maintain flexibility in our design, ensuring we can adapt to changes without being locked into an overly rigid model framework.</p><h3>Further reads</h3><p>1. Domain Driven Design Tackling Complexity in the Heart of Software — (Section 16: Large Scale Level) Eric Evans 2014</p><p>2. Enterprise Patterns and MDA — (Party Archetype, Party Relations Archetype) Jim Arlow 2003</p><p>3. [PL] Better Software Design — (O modelowaniu w wielkiej skali) Mariusz Gil, Jakub Pilimon 2020</p><p>4. Pattern Languages of Program Design — (Reflection Pattern) Frank Buschmann 1995</p><p>5. Dealing with Properties — Martin Fowler 1997</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72eafc8d6050" width="1" height="1" alt=""><hr><p><a href="https://blog.softwaremill.com/advanced-large-scale-ddd-72eafc8d6050">Advanced large-scale DDD</a> was originally published in <a href="https://blog.softwaremill.com/">SoftwareMill Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A good program is a small program.]]></title>
            <link>https://levelup.gitconnected.com/it-is-hard-to-reason-about-anything-that-consists-of-many-different-moving-parts-6e99521ef18e?source=rss-b62d2906725f------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e99521ef18e</guid>
            <category><![CDATA[modularization]]></category>
            <category><![CDATA[software-design]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Michał Grabowski]]></dc:creator>
            <pubDate>Mon, 11 Jul 2022 11:53:02 GMT</pubDate>
            <atom:updated>2022-07-11T12:14:56.026Z</atom:updated>
            <content:encoded><![CDATA[<h3>A good program is a small program</h3><p>It is hard to reason about anything that consists of many different moving parts. It just exceeds our cognitive abilities as humans. It is hard to introduce any change if everything depends on each other. The consequences of such change are always unpredictable. We can not adapt to new requirements because we get bogged down with all that dependencies. Small, seemingly innocent changes in one place may result in disaster on the other end of the system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TqsfHvBEfvFqXdbS5-0Ypg.jpeg" /></figure><p>Any complex design calls for modularisation. Consider a regular car. The car consists of thousand different parts altogether. But it is not built as a single monolithic instance where everything is intertwined and tangled. Parts are grouped in higher-order structures. We can easily swap tires or add a more powerful supercharger to the engine. The way air is supplied to the combustion chamber is irrelevant from the engine’s perspective. The engine assumes the air to be provided somehow — this constitutes a contract between the „air provider” and the engine. The engine knows nothing about the internal details of the design of any peryferial device that supports its work. Such design is much easier to understand and reason about. It introduces some form of abstraction. From a car design perspective, such an approach is apparent and obvious. Many different divisions or even companies may focus on developing and optimizing just a single part of the overall system. Any detail of other systems does not disturb them at all. They could afford to entirely focus on their problems and make decisions best for them.</p><p>The same rules apply to any other complex design out there. But when it comes to software, it is not always the case. Without deliberate commitment, the design of our system tends to strive toward higher entropy. Complexity keeps increasing as time passes. Why does it look that way in the first place? Part of the problem is the fact we work with something quite intangible. Software, by its very root definition, is volatile and transient. Laws of physics such as gravity do not limit software developers. In software engineering, everything seems possible to achieve; it is just a matter of time and resources. Classical engineering can not neglect or ignore physical constraints. Because of all the physical constraints, it is impossible to just come up with a 10-kilometer high skyscraper. Achieving something like this requires considering thousands of different forces and factors. It is not even easy to build elevators fast enough to operate at such distances that remain comfortable for passengers. In software, we may scale our solutions at ease.</p><p>Another difference is that requirements for software keep changing all the time. This is not the case when it comes to building skyscrapers. It is impossible to change your mind and decide you ultimately want the building to be twice as high along the way. This is just not feasible. It would require pulling down everything to the ground and starting over again. In software engineering, we are more than accustomed to expecting change. We design against changes. But the change has a specific inherent trait that makes the change cumbersome. Namely, the change is unexpected in its form. We may do our best to be prepared for certain changes, but sooner than later, the new requirement disrupts our assumptions. The sad reality is that we do not possess a crystal ball; we can not predict the future. To make things even worse, we may be sure that any of our design decision ultimately turns out to be at least undesirable — it is just a matter of time.</p><p>There are many concepts out there like: modules, components, microservices, actors, and objects that boil down to the idea of splitting an extensive system into many smaller parts. It is not as important as how you are going to name it. The important part is to focus on the need to split things no matter how. Having many separate parts loosely coupled into bigger structures has enormous advantages.</p><p>First of all, such parts are interchangeable. If those parts are small enough, we can get rid of the particular implementation and build something better suited from scratch within one week. Instead of refactoring or fighting against technical debt, we may delete the whole code. This is huge. As long we build small parts, we get this for free.</p><p>Imagine a regular e-commerce system. To fill an order, many different parts have to be involved. We need to know about the customer, his discounts, group, etc. We have to know about the stock of ordered items in the warehouse. We have to know the price of course. We have to know about possible delivery methods available for that order. Does the supplier operate at the given address, and how much will it cost? How about parcel insurance? A lot of knowledge is required to fill an order, and it is easy to get all such concerns tangled. We need the habit of looking for smaller cohesive responsibilities. Look at such a proposal:</p><p>- <strong>Order</strong> — responsible for all accountancy, customer details<br>- <strong>Product</strong> — what we can buy. It manages all presentation data and descriptions of the product. <br>- <strong>Tariff</strong> — provides prices based on given circumstances (customer, country, the temperature outside)<br>- <strong>Discount</strong> — focused on all forms of discounts to a particular customer is entitled in the context of given items at the given time. It knows how different discounts apply together and when.<br>- <strong>Warehouse</strong> — take care of stock information. Can answer when something will be available. Maybe there is a scheduled delivery of this item. Maybe their many warehouses out there — it is not essential from the perspective of its clients. Clients want a simple answer: when you will be ready to supply a particular item.<br>- <strong>Shipment</strong> — knows about offers of specific suppliers. What parcel size do they allow, for example, or when they collect goods from a given address. <br>- <strong>Logistic</strong> — coordinates work of shipment and warehouse. Sometimes it is cheaper to send something from a particular location, but it also depends on available stock and other competing orders.</p><p>Order knows nothing about tariffs, discounts, warehouses, shipment, or logistics. In some circumstances, the order may be concerned about discounts because of accountancy rules, but the idea of discount is part of its model. Tariff knows nothing about anything; it does not even know about the product’s existence — it is irrelevant from its perspective; it manages price logic that is abstracted away from the product itself. It may handle services, digital content, or subscription fees. All those services are loosely coupled; they do not depend on each other. The warehouse or Shipment does not need to know it is about to fill orders. Those services fulfill more generic requirements, and this is what makes them interchangeable. It is all about finding natural contracts between distinct parts.</p><p>Business structures and operations will always change at a different pace and for various reasons. We, as developers, love data consistency. If a customer wants to buy five items, but we got only four items in the warehouse, it is simple for us: deny selling five items. The problem is that business does not work that way. Bussiness often builds its competitive advantage based on its operations in such circumstances. The answer to the above problem is not trivial. We may:</p><p>- We may ship four items now and promise to send 5th item later on our cost<br>- We may ask the customer for a few days more to fill the order<br>- If the customer is essential, we may try to order a lacking item using some expensive and fast transport<br>- We may offer to ship only four items and notice the customer when something more will be available<br>- We may promise the customer to reserve that item for him when it is again available</p><p>Notice that not single responsibility or shape of proposed services has been changed. The subject of change is how those services cooperate.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e99521ef18e" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/it-is-hard-to-reason-about-anything-that-consists-of-many-different-moving-parts-6e99521ef18e">A good program is a small program.</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exception in Domain-Driven Design]]></title>
            <link>https://levelup.gitconnected.com/exception-in-domain-driven-design-832c92fb04f4?source=rss-b62d2906725f------2</link>
            <guid isPermaLink="false">https://medium.com/p/832c92fb04f4</guid>
            <category><![CDATA[exception-handling]]></category>
            <category><![CDATA[domain-driven-design]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Michał Grabowski]]></dc:creator>
            <pubDate>Mon, 04 Jul 2022 17:41:11 GMT</pubDate>
            <atom:updated>2022-07-05T12:17:41.886Z</atom:updated>
            <content:encoded><![CDATA[<p>Exceptions have been introduced to handle errors on the function level. The intention was to avoid returning error codes and remove return type ambiguity. The power of exceptions comes from their ability to propagate through the stack downward. You are not obliged to handle exceptions directly. It allows you to separate your normal code flow from error handling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*63iFyBn_CoUyGfCZKaPI9g.jpeg" /></figure><p>An exception should be thrown when function assumptions about arguments are broken or if the function cannot fulfill its promise. The simplest example would be dividing by zero. We have to signal the caller that we can’t provide an answer. The exception constitutes part of the function contract. In linguistics, this is sometimes called presupposition failure. Consider the question if the king of France is bald. There is no king of France, so we cannot answer in terms of either yes or no. Any of those answers would be misleading.</p><h3>Exceptions as part of the domain language</h3><p>It is convenient to think about exceptions as part of the domain language itself. It is a great way to communicate. Business exceptions like OrderLimitExceeded are significant and informative. You get essential information on business expectations by flicking through the list of exceptions. It is necessary to build a consistent hierarchy of domain exceptions. For example, if your Order aggregate may raise many different exceptions as part of its API, all of them should extend a single exception like OrderException. It makes it easier to handle. The fact is that controlling exceptions flow is no easy task, and it requires a lot of discipline. Otherwise, it will get out of control sooner than later.</p><h3>Problems with exceptions</h3><p>Unfortunately, exceptions are not ideal. They disrupt the natural control flow of the code. It is GOTO in disguise. Using exceptions also adds complexity to the interface and enhances coupling. Throwing an exception breaks referential transparency, so our methods are not pure. Our function has no single return point, and that hinders reasoning substantially.</p><p>There is another massive issue with exceptions. Exceptions may lead to an inconsistent state of the model. If some operation can not be fulfilled, the model should remain in the same condition as before. Developers do not always pay attention to this. Offen exception is raised in the middle of computation where the model state has been only partially changed and is inconsistent. Neither your IDE nor compiler won’t help you with that issue.</p><p>A recent study shows that 90% of failures in distributed systems refer to incorrect error handling.</p><h3>Functional approach</h3><p>Using a monad-like container type like Option, Either, or Result is far more readable and elegant. Those are well-known constructs within functional-focused languages. We can design our API with a single return type in mind and don’t distort the control flow.</p><pre>Order.addItem(Item $item): Either[Order, Error]</pre><p>Adding an item may result in a new order (with that item) or an Error. Specifying what error types we may get from that method (OrderItemsNumberExceed, CanNotAddItemToFinishedOrder) is essential. The API is elegant and complete. Return type explicitly tells us we may not have a valid answer for any argument. We may use union types or generic OrderError and describe the errors in method documentation, but it is always better to depend on type-level safety.</p><p>It must be possible on a language level to easily sequence many calls without bothering about error handling. It is excellent when it is the case. <br>Option, Either, Result — types that retain monad characteristics are easily composable. This does not disrupt normal control flow or referential transparency. But without syntactic support on the language level might turn out to be cumbersome. Otherwise, exceptions may be far more attractive alternatives.</p><h3>Disclaimer</h3><p>This whole post refers only to the business domain environment and probably is not applicable in low-level or infrastructural circumstances.</p><h3>Level Up Coding</h3><p>Thanks for being a part of our community! More content in the <a href="https://levelup.gitconnected.com/">Level Up Coding publication</a>.<br>Follow: <a href="https://twitter.com/gitconnected">Twitter</a>, <a href="https://www.linkedin.com/company/gitconnected">LinkedIn</a>, <a href="https://newsletter.levelup.dev/">Newsletter</a><br><strong>Level Up is transforming tech recruiting ➡️ </strong><a href="https://jobs.levelup.dev/talent/welcome?referral=true"><strong>Join our talent collective</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=832c92fb04f4" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/exception-in-domain-driven-design-832c92fb04f4">Exception in Domain-Driven Design</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Open-Closed Principle is nothing about the code]]></title>
            <link>https://levelup.gitconnected.com/open-closed-principle-is-nothing-about-the-code-270f1c04bebf?source=rss-b62d2906725f------2</link>
            <guid isPermaLink="false">https://medium.com/p/270f1c04bebf</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[solid-principles]]></category>
            <category><![CDATA[open-closed-principle]]></category>
            <dc:creator><![CDATA[Michał Grabowski]]></dc:creator>
            <pubDate>Thu, 30 Dec 2021 21:46:52 GMT</pubDate>
            <atom:updated>2022-01-03T14:20:59.299Z</atom:updated>
            <content:encoded><![CDATA[<h3>History</h3><p>In 1972 Professor David Parnas proposed the concept of Information Hiding. Many people misinterpreted the term as simple encapsulation. Many books use those terms as synonyms. The real intention is to hide module design information from other modules. Communicate modules using well-defined interfaces that reveal as little as possible about internal module decisions and design. This makes modules loosely coupled and interchangeable. We gain the opportunity to reason about in module scale.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7opFjBKM_pxaNTP6aYj0iw.jpeg" /></figure><p>The term Open-Closed Principle was first used in 1988 by Bertrand Meyer in his book “Object-Oriented Software Construction”. He stated that modules should be both open and closed. As closed he meant module that is done, published, and used by others. Modules depend upon each other to perform their own tasks so such change may trigger a chain reaction of errors among the whole system. Many parts of the system proved to work well over time would become uncertain again. His idea is to not modify the existing module to handle any new special case but to instead introduce a new module that encapsulates new case logic. Mayer suggested using the original module as a parent for a new version. This approach allows adding new functionality without modifying existing code. It is all based again on using abstract contract instead of the particular implementation.</p><p>During the 1990s the principle get redefined to refer to the use of abstract interfaces. Implementations of those interfaces may change. The interface itself is considered to be closed not the implementation. Many different implementations of the interface can exist at the same time. We want to reuse the interface, not the implementation. The contract is closed. In 1996 Robert C. Martin proposed exactly such an approach.</p><p>In 1996 Alistar Cockburn introduced his concept of Protected Variation. And this is the exactly same thing as our modern understanding of OCP.</p><h3>Extensions points</h3><p>OCP is the holy grail of software engineering. Most of the design patterns out there aim to fulfill that requirement. As a design principle, it is rather an guidance or even mindset, not some pattern to follow. It tells how we should design out components to be reused and how to extend functionality without violating abstraction boundaries. Those abstractions are a relevant part of the design. It is a viable part of our model. The new behavior should come from the new code. It is all about finding natural extension points. Professional cameras are a great example here. You are free to change lenses easily. The socket stands for an interface and as long as the lens producer adheres to that standard it would work with your camera just fine.</p><p>The point is not to provide the ultimate universal solution. It is just impossible. Code is supposed to do exactly what it was designed for. Not less and not more. What OCP says is to focus on providing good abstractions. It does not change the fact that no abstraction is perfect. Each abstraction works only to the extent it has been designed to. So it is inevitable to change existing code and more important to change existing abstraction. The abstraction is the key here. Different parts of the system should not depend on each other. Our role is to craft appropriate contracts between components in form of interfaces. The problem is that it is not easy to spot the right extension points early on. There is a vague border between overengineering and getting tight. It is easy to justify any additional level of indirectness just by presumptive flexibility. But it is not a good recipe for great software design. The hard thing here is to provide the right level of extendibility and to define the right contracts. It is a matter of intuition and experience. There will always be a requirement that could not be implemented easily without modifying the component. And this is a good thing. By gathering more knowledge about your domain you just come up with a better model and your abstractions are an important part of the model. The goal is not to avoid changing existing code. It so more about trying to spot and explicitly model real dependencies. It is a process of looking for an answer to how much (or how little) we need to know about each other to effectively cooperate. Our codebase and language as general is not something still. It keeps evolving and adapting to new needs. Violation of OCP is not when you advertently refactor your codebase due to new domain insight but when you need to cross abstraction boundaries.</p><h3>Limitations</h3><p>You may change tires in your car for winter. It is a great example of extending functionality. It is all based upon a well-established contract. How rims fit your car axle, how tire fits the rim etc. The is a lot of indirectness there. Your engine does not really care what type of tires are you using (it might look a bit different in days with tons of electronics onboard). All lean on well-defined interfaces. However, we are allowed to custom our cars to a particular degree and in dimensions that it was designed as such. It does not mean that any concept should be transformable to any other. It does not mean you should try to turn your car into a helicopter. Being a car and being a helicoper are two different things. And if you try to be too open it will be at least awkward, not efficient, rather expensive, and not reliable.</p><p>Let&#39;s imagine we need to design API for tax policy service. The only task of the service is to determine the tax rate for a particular item. We know that each item must belong to a particular tax category and that classification may differ among different countries or regions. We are experienced developers so we want to rely upon abstraction, not concrete implementation. All we need now to calculate tax is an item and classification table.</p><p>But one year later our business expand to Mexico and it turns out that in Mexico you are not obliged to pay taxes when you turned 100 years. So tax rate may depend on the customer&#39;s age. Our interface does not take it into consideration. Even though we suspected change in that dimension we failed to leave our contract flexible enough.</p><p>It is still solvable to some degree. We may use IoC here and according to customer age use a classification table with zeros all the way down. But this is a knowledge leak. We may also introduce some TaxFreePolicy and use factories based on customer properties. This does not seem to be a flexible solution either. Only particular items may be tax-free for example so we do have not enough information to decide upfront. All of that is hacky and does not reflect our knowledge.</p><p>We may safely assume that the Customer is relevant in our contract because we actually ask on behalf of the customer. It also enables us to calculate tax for many customers within the same context.<br>In terms of DDD, the best option we got is to adhere our codebase to current knowledge. We were enforced to break OCP in favor of adjusting code to gather knowledge. Now we may easily build MexicoTaxPolicy which encapsulates knowledge that you are free of paying tax above 100 years old in Mexico. Sounds like a solid solution, we have got domain knowledge right into the appropriate model.</p><p>Unfortunately, in Germany tax may depend not on the item’s price but on quantity. For example, you are supposed to pay 2.19 EUR per kilogram when buying roasted coffee and 4.78 when it comes to instant coffee. This is cumbersome. Again it is something hard to predict early on and again we need to adjust our interfaces accordingly and add the requested quantity as part of the query.</p><p>If you are a producer it may even depend on how many items you produce annually. The FET was reduced from $7/barrel to $3.50/barrel on the first 60,000 barrels for domestic brewers producing less than 2 million barrels annually. It is close to impossible to propose an elegant and flexible API here. Our best option is to move that burden to the policy constructor which leaves our API untouched. The downside with that approach is that the service is not stateless any longer. It has to hold access to some kind of repository to deliver a proper result for us. It is often the case that some dependencies must be provided upfront because some policies may depend on an arbitrary set of properties. We want to keep the contract relevant and generic as much as it is possible.</p><p>It would be also reasonable to add DateTime param to our query API. Tax for particular items may depend on the season and I am sure in some countries it really depends. We should not depend on the current date-time because it would make our API impure. DateTime will also model the fact that rates change over time.</p><p>It is apparent that it is just impossible to predict the future. It is a matter of experience and intuition to judge what belongs to our natural contract and what doesn&#39;t. It all depends on your domain and your problem space. There is no ultimate design for tax service out there. Probably above proposals and considerations do not make any sense in your system. If something is a generic problem there is a generic solution out of the box. For any other scenario, you have to model your own reality with a just-right level of extensibility.</p><h3>Timeline</h3><p>- 1972 David Parnas — Information Hiding “On the Criteria to Be Used in Decomposing Systems Into Modules”<br>- 1988 Bertrand Meyer — Open Closed Principle in form subclassing — “Object-Oriented Software Construction”<br>- 1996 Robert C. Martin — Redefinition of OCP in terms of interfaces/abstraction — “The Open-Closed Principle”<br>- 1996 Alistair Cockburn — Protected Variation introduced — “Prioritizing Forces in Software Design”<br>- 2001 Craig Larman “Protected Variation: The Importance of Being Closed”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=270f1c04bebf" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/open-closed-principle-is-nothing-about-the-code-270f1c04bebf">Open-Closed Principle is nothing about the code</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why our code tends to become big ball of mud over time]]></title>
            <link>https://ayeo.medium.com/the-connection-e1b32d698d60?source=rss-b62d2906725f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1b32d698d60</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[domain-driven-design]]></category>
            <category><![CDATA[object-oriented-design]]></category>
            <dc:creator><![CDATA[Michał Grabowski]]></dc:creator>
            <pubDate>Mon, 28 Jun 2021 11:09:04 GMT</pubDate>
            <atom:updated>2021-06-28T14:10:20.486Z</atom:updated>
            <content:encoded><![CDATA[<p>Our codebases seem to corrode over time. Overall quality tends to decrease. Each new change is harder to introduce. We all use OOP good practices, control our dependencies, adjust to SOLID principles and use patterns. And even so our systems heads toward becoming big ball of mud inevitably. It turns out it is not enough to keep systems viable in environment of relentless change. There are of course many factors involved but I want to focus on the most important one. Namely the lost connection between business reality and our implementation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*99bemDX21RPasOZCH3ifFA.jpeg" /><figcaption>Pictrue from unsplash.com</figcaption></figure><p>Let`s consider following scenario, we want to introduce money transfer functionality to our existing system. Business describes transfer as process of blocking funds on one account if possible, then move such funds on another account, and take off blocked funds from originating account. That is extremely clear and easy process. But we as developers tend to think in our own technical way. One may come up with simple solution consist in adding “balance” property to existing User model. Then withing single transaction modify values accordingly for both users. All seems fine and ultimately we got exactly what we need in terms of functionality. I believe even that for simple and non-complex domains that will be enough.</p><p>When it comes to complex systems that we need to develop and maintain long term this solution is harmfull. The main problem here is that we lost connection between our real concept and its implementation. Bussines description of the process is not reflected in our implementation. The definition is lost, we use different definition in our implementation. We use different language. Code achieves its goals using own language.</p><p>We lost the ability to reason about our system on language level. We can not discuss new features using common language. We have not well-defined concepts in our code that we thoroughly understand. We are enforced to analyze the implementation itself and then come up with way that allows us to satisfy new expectations. It will often turn out that new requirement does not match our implementation because the implementation is somehow artificial. We just made it up that way from our technical perspective. What we really want and what implementation does is discrepant. There is no problem if the system is not meant to change but otherwise such solution is deemed to be degraded and ultimately becoming big ball of mud.</p><p>Implementing new features would differentiate those two words even further. Each change will make our intention more vague and indirect. The code does not communicate our real needs. The business process is not apparent and our intention is hidden. That is why adding new features is getting harder and code itself becoming worse after each change. It should work totally opposite and each change should make our model better. We are supposed to gather knowledge and that knowledge should be apparent in models. We have not modeled the real process. We have not used concepts like: block, account, transfer, currency etc. As an result we have to hack our codebase to satisfy new needs because the codebase does not reflect the reality. That is why those needs does not match there.</p><p>And the point is not to overly complicate the code. The point is to deliberately make that decision. It is not always beneficial to invest in such approach probably. But in complex and long-lived systems ability of discussing concepts and implementation on language level is priceless. There is no possibility that some new requirement will no match our code since our code reflects our business reality.</p><p>It is often that other developers will start using our vague implementation to achieve own goals. The goals may be logically contradicted but our implementation is close enough to their needs. Just add some extra conditions and it is done. Now our balance may be used to store some customer loyality points for example. All we need to do is to make currency optional. Now we have something entirely artificial to maintain. We have false abstraction. We will be enforced to satisfy contradict needs. If someone want to spoil our code he will always find a way. But it is more likely to keep our models in good condition if we communicate explicitly its purpose and its responsibilities in terms of business language.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1b32d698d60" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>