Best Practices and Tips on Communication, Performance Metrics, and Other Strategies for Monolith Breakdowns
By Boris Korenfeld
, Global CTO and General Manager of Tech Practices, Sphere Partners
In the world of software development, monoliths are born out of simplicity and necessity.Â
Say, for example, you are the CTO of a company that is building a new application. You want a small, manageable codebase where all components are in one place and operate as a single unit. This monolithic architecture is straightforward to develop, test, and deploy, making it an attractive choice for startups and small projects.Â
The developers can leverage a single technology stack, and all the processes â from database operations to business logistics to server-side rendering â are tightly coupled and run in the same space.Â
However, as the application grows, new features are added, and the user base expands, this once small and simple monolith can evolve into a complex, sprawling, and rigid structure. This growth, while a sign of success, can also lead to a host of challenges that may necessitate a monolith breakdown.
Signs That Monolith Breakdown Is RequiredÂ
In my experience as a CTO and global tech leader at major disruptive companies, there are six surefire signals that point to it being time to pivot from monolithic architecture to microservices or modular architecture. If you recognize any of these symptoms or a combination of them at your company, consider a transition from a monolith legacy system:
- Scalability Snags: If the monolith has grown so large that it becomes difficult to scale effectively, this might be a sign that a breakdown is needed. This could include hardware constraints, where it's no longer feasible to scale vertically by adding more resources to a single machine, or software constraints, where certain components of the monolith are bottlenecking performance and can't be scaled independently.
- Development Slowdowns: As the codebase grows, it may become increasingly complex and difficult to understand in its entirety. This can lead to a decrease in development speed, as developers must navigate a large, complex codebase to make changes or add features.
- Team Coordination Problems: If the monolith is so large that multiple teams are stepping on each other's toes during development, a breakdown may be beneficial. With a microservices or modular architecture, each team could own a specific service or module, reducing conflicts.
- Deployment Challenges: If deploying updates or new features to the monolith is risky or takes a lot of time because a problem could bring down the entire system, breaking down the monolith could allow for safer, more frequent deployments.
- Technology Lock-in: Monoliths often force you to stick with a single technology stack for the entire application. If different parts of the application could benefit from different technologies (e.g., languages, frameworks), breaking down the monolith could help because each microservice can use the most appropriate technology for its needs.
- Difficulty Isolating Failures: In a monolithic architecture, failures can be harder to isolate and can potentially bring down the entire system. A breakdown can allow for better fault isolation, as a failure in one service doesn't necessarily affect the others.
How to Secure Buy-In from Company Leadership for Monolith Breakdown
Once youâve identified that a breakdown of monolithic architecture is necessary for the health of the team, the product, and the company, the next step is persuading the CEO (and potentially business stakeholders) to authorize the change.Â
When seeking buy-in from your companyâs non-tech executives and leaders, it is critical to avoid tech jargon as much as possible and use terms and concepts that appeal to their business acumen. Here are six strategies to consider:Â
- Investment Pitch: Position the project of breaking down the monolith as a business investment. Highlight that the return on investment (ROI), in terms of business impact, will be significantly higher than the initial cost (i.e., the engineering months required for the breakdown and the temporary increase in operational costs at the start of the project). The impact can be measured in terms of time to market, increased velocity, better quality, etc.
- Business Alignment: Understand your companyâs business strategy and goals, and articulate how the monolith breakdown can help achieve these objectives. Explain how the breakdown can also create business impact even if itâs not a part of the current yearâs business goals.
- KPI Improvement: Use concrete KPIs from the list below to demonstrate the potential improvements that can be achieved through this project. Show how the breakdown can lead to faster development speed, increased deployment frequency, and more efficient resource usage, among other benefits. Estimate concrete numbers of improvement: a 300% increase in X, a 50% improvement in Y, etc.
- Explain Tech in Business Terms: Make it clear that this isn't just about refactoring code for fun or for the sake of engineersâ happiness â it's primarily about driving significant business impact in the mid- to long-term.
- Pareto Analysis: Conduct a Pareto analysis to identify the 20% of your monolith that, if broken down, will yield 80% of the business impact, and present that to top company execs. The exact measure of impact will vary depending on the business and product specifics.
- High-Level Plan with Milestones: Present an attainable plan that outlines the major milestones of the project. Aim to show the first improvements within about three months. This will help build trust with business stakeholders, as they will be reassured they wonât have to wait a year or longer to see the first impact.
Best Design Practices for a Post-Monolithic ArchitectureÂ
Now that youâve got the C-suite on board, itâs time to get to work. Transitioning from a monolithic legacy system to a microservices architecture while ensuring the system continues to function is indeed a challenging task. Remember, the transition to microservices should be a gradual process. Start with one bounded context, and as you become more comfortable with the process, continue to break down the remaining parts of the monolith.
Hereâs a step-by-step strategy incorporating some important design patterns.Â
- Domain-Driven Design (DDD): Start by identifying the bounded contexts of your application
. These bounded contexts represent the different business capabilities within your application, and each of them can be a candidate for a separate microservice.
- Anti-Corruption Layer (ACL): Once you've identified a bounded context to convert into a microservice, introduce an Anti-Corruption Layer
. This layer will help isolate the microservice from the legacy monolith, translating requests and responses between the two systems. This allows the new service to be developed in a way that is not limited by dependencies on the legacy system.
- Strangler Fig Pattern: This pattern is particularly useful for gradually replacing a legacy system. The basic idea
is to build the new microservices around the edges of the old system, gradually replacing its functionalities. As you develop the new microservices, they take over more and more functionality from the monolith, which eventually gets "strangled".
- Backend for Frontends (BFF): If your application has different user interfaces (e.g., web, mobile, third-party APIs), consider creating a separate Backend for Frontend
for each interface. This will allow each interface to have a microservice tailored to its specific needs, reducing the complexity and enhancing performance.
- Database per Service: Each microservice should have its own dedicated database
to ensure loose coupling. Shared databases can create performance issues and tightly coupled services together, defeating the purpose of a microservices architecture.
- Continuous Integration/Continuous Deployment (CI/CD): Establish a robust CI/CD pipeline
to automate the building, testing, and deployment of your microservices. This will ensure that your system remains functional as you gradually replace the legacy monolith.
- Observability: Implement comprehensive logging, monitoring, and tracing
for your microservices. This is crucial for diagnosing and resolving issues quickly when they arise.
What KPIs to Track During and After a Monolith Breakdown
Itâs important to note that KPIs and percentages of improvement can vary significantly between different systems, depending on complexity, size of the engineering department, age of the monolith, required functionality, and many other factors. These eight KPIs are ones that I have seen over and over again as true indicators that a monolith breakdown was the correct call:Â Â
- Productivity (Value Delivered to Customers): If you measure story points by the book, meaning you measure work done that brings additional value to customers and not bug-fixing, work on tech debt, etc., this KPI can jump by 3-5x or more. Sometimes it requires a changing of data models in the system to deliver new functionality to the customers. And itâs extremely hard to do until the monolithic architecture is broken down.Â
- Time To Market/Cycle Time: This can increase up to 300%. However, this improvement may not be immediate. Initially, the development speed might slow down due to the learning curve and the initial overhead of setting up a microservices infrastructure.
- Deployment Frequency: With independent deployment of services, you could see an increase of 20% to 50% in deployment frequency.
- Failure Rate: In the long term, failure rate might decrease by 10% to 20% due to the isolated nature of microservices. But keep in mind that in the short term, the failure rate might increase until the kinks of the new architecture are worked out.
- Time to Recovery: With isolated failures, you could potentially see a decrease in recovery time by 20% to 40%, as you may not need to restart the entire system when a failure occurs.
- Operational Cost/Resource Usage: The improvements in resource usage can be significant, especially for large systems. It all depends on how well you're able to take advantage of the scalability benefits of microservices.
- Retention: The engineering teamâs happiness will go up significantly after a monolith breakdown. Because they will invest most of their time on making an impact on business rather than wasting time on technical issues related to monolithic architecture/spaghetti code.    Â
- Time to Hire: Strong engineers are not very excited about working with monolith and legacy technologies without any option to change. So it will be much easier and faster to hire strong engineers after a monolith breakdown.
Letâs Talk Monoliths
Have questions about monolithic architecture at your company or whether itâs time for a breakdown to microservices or modular architecture? Shoot me an email
. I love to connect with other CTOs and tech leaders to learn how they approach challenges and offer my own insights from my decades of experience in this realm.
Empowering CTOs and founders with rapid digital execution, outpacing the competition and avoiding missed deadlines. ð Golang consultant (contractor) ð Founder ð Mentor ð Coach
1yð Thanks for another great article, Boris Korenfeld! Legacy systems are one of my favourite subjects. Sometimes, nurturing and improving a legacy system brings more fruits than replacing it. When discussing legacy systems with developers, all claim they can better rewrite them from scratch. In reality, I am unconvinced by looking at the developer-produced code and by the efficiency of developers' work. ð From my experience. The legacy system should NOT be aware of the new one, it adds complexity and noise and delays time to market. â Avoid it if possible! To reduce time to market and unlock new capabilities and products, start by building read-only services in the new system by piping data. Doing ð£ BING BANG - switching off the legacy system and switching on the new system - is hard and error-prone. Also, I posted my thoughts on teams' readiness for transformation https://www.linkedin.com/posts/janishorsts_legacymodernization-legacysystems-devex-activity-7087099298185658369-CG0j?utm_source=share&utm_medium=member_desktop