3 Ways to Manage Microservices Infrastructure Complexity

One of the biggest complaints I hear against microservices architectures is that they create overly complex applications. The fact that they contain so many moving parts (compared to comparable monoliths or N-Tier applications) presumably makes your application more complicated to understand.

Microservices architectures do not create overly complex applications. Rather, they relocate the complexity from the application to the application infrastructure. The result is individual modularized components that are easier to understand and hence easier to support.

But the complexity is still present. Microservices architectures make the interconnection between services more complicated; hence, the infrastructure requirements are more complex. The fact that we leverage new and sophisticated infrastructure technology, such as Kubernetes, tends to confirm the greater infrastructure sophistication required to operate the application.

But the benefits of microservice architectures and the application simplification they enable far outweigh the disadvantages of infrastructure complexity that they incur. In other words, the advantages of the application tend to outweigh the costs of increased infrastructure complexity.

Yet, this increased infrastructure complexity still has to be dealt with. What can you do to ensure you do not overly burden your infrastructure requirements in building your microservice-based application?

There are three main things you can do to avoid an overburdened infrastructure.

Number 1. Be careful of service size

Service sizing is critical. If your microservices are too small, you’ll dramatically increase your infrastructure complexity without getting enough incremental benefits created by your reduced service size.

If your services are too big, they won’t take advantage of the service simplification inherent in this architectural pattern.

In other words, you must find the optimal service size that is right for your application. I call this the Goldilocks Calculation. How do you make your services not too small and not too big? You have to find the right balance to make them just the right size to optimize the benefits of reduced application complexity without unduly complicating your infrastructure.

Finding the right service size is essential to reaping the benefits of microservice architectures.

Number 2. Maintain service ownership and management

One of the major stumbling blocks for companies when they initially move to microservices architectures is determining how to manage them. Individual engineers get overwhelmed by the quantity and diversity of the services they must be aware of and understand. They treat all the services as white boxes—meaning they need to know how all the services work internally to fix issues in any service in the application.

This leads to madness. The problem is the organizational structure of your company. You must change and adapt your organizational structure to match your service-oriented architecture. While many valid organizational models can work with microservices architectures, I recommend the Single Team Oriented Service Architecture (STOSA) model. I describe this model in my O’Reilly Media book, Architecting for Scale.

This model emphasizes organizing your service teams into teams of five to eight individuals. Then, each service is assigned to a single team. That team owns all aspects of building and operating the services they own and has no responsibilities for understanding any other service. This creates an organization that can quickly scale upwards as the size and complexity of your application grows. This model is used successfully by many large applications and companies, including Amazon.

Number 3. Automate as much of your microservices infrastructure as you can

Manual operations lead to variable results, which leads to increased complexity. The easiest way to avoid the costs of continuously increasing the complexity of your application infrastructure is to automate as much of the infrastructure management as possible. This includes using CI/CD pipelines, launching server instances, and service sizing and autoscaling.

The more you automate, the lower the variations that will occur in your application infrastructure and the lower the overall complexity of your application.

Investing in automation upfront can allow you to build and manage larger applications later without necessarily suffering from complexity and bloat.

Keeping it Simple

Overall, keeping your microservices-based application infrastructure simple is a daunting task. As your application grows and expands, it will naturally become more complex. But you can avoid unnecessary complexity by actively managing your application service-based architecture and design.

Lee Atchison

Lee Atchison is an author and recognized thought leader in cloud computing and application modernization with more than three decades of experience, working at modern application organizations such as Amazon, AWS, and New Relic. Lee is widely quoted in many publications and has been a featured speaker across the globe. Lee’s most recent book is Architecting for Scale (O’Reilly Media). https://leeatchison.com

Lee Atchison has 59 posts and counting. See all posts by Lee Atchison