Microservices Starter Kit v1.0

(Updated Dec 18, 2024)

 


 

The Modern Software Problem


Monolithic Architecture

For the past 20 years most IT organizations have been building monolithic applications. These consisted of large, single code base, web or desktop based applications with millions of lines of code. Due to their size they are typically two or three technology generations old due to the cost and effort required to keep them up to date. Code tended to be tightly coupled which made it difficult to test and very easy to break in unexpected and unanticipated ways. Adoption of new technologies or patterns was often difficult or impossible. Development resources with appropriate skills could be hard to find. Integration with other systems was difficult and cumbersome. They tend to have a monolithic data source that was itself, difficult to maintain. The result was a lot of time and effort spent in care and maintenance of these applications and minimal opportunity for innovation.


Monolith Pros and Cons

It's not fair to say that monolithic applications didn't have their advantages but they must be weighed with the disadvantages when weighed against todays modern technologies and approaches.

PROS:

  • Simple to develop initially
  • Development tools and approaches have been around for 20 years
  • Simple to deploy. Typically one asset (dll, war, exe, etc...)
  • Simple to scale (usually given forethought to design). Can run multiple instances behind a load balancer

CONS:

  • Steep learning curve for new developers - especially less experienced developers who may not have experience with older technologies or approaches
  • Large code base reduces performance in most IDEs
  • Continuous deployment is difficult or impossible
  • Testing is difficult and is usually manual
  • Scaling is limited with little granular control. Individual pieces or features of the application typically cannot be scaled independently
  • Obstacle to scaling development. The team can only be so large before stepping on toes
  • Married to technology stack as it is difficult, expensive and time consuming to change
  • As code accumulates, technical debt increases and hinders agility

Distributed Architecture

Recently there has been a concerted effort to move away from this outdated approach in favor of a more distributed approach. This has only been made possible by new tools and frameworks that have been released to more easily support the challenges a distributed architecture presents to an organization. Container technology makes it easy to build once and deploy many times. Container orchestration platforms like Kubernetes easily run one or more instances of a service in a cluster providing performance, scalability and redundancy. CI/CD pipelines provide the ability to easily build and deploy individual services. IDPs such as Cognito or Keycloak provide an easy means to secure any http service requests. Enterprise messaging platforms like Kafka enable inter-organizational communication when key events occur. Without these tools the dream of a true distributed architecture could not be fully realized.


Distributed Architecture Pros and Cons

PROS:

  • Better testability. Everything is smaller and therefore faster and easier to test
  • Quicker/more frequent deployment. Each service can be independently deployed
  • Development can easily be organized across multiple teams
  • Easier for developers to understand and get up to speed
  • IDE performance is typically quicker increasing productivity
  • Improved fault isolation. Problems affect only a single service instead of the entire app
  • Eliminates long-term commitment to a technology. Each service can be built using it's own appropriate and acceptable technology
  • Lego block development. Build once, reuse everywhere!

CONS:

  • Developers must deal with the complexity of a distributed system
  • Increased deployment complexity due to dozens to hundreds of deployable units
  • Distributed mindset required
  • Increased infrastructure complexity. Eg: service discovery, inter-service communication, health monitoring, etc...

Conclusion

As with anything, there are many ways to solve complex problems and while a distributed architecture can be an elegant approach it does require discipline, communication and oversight to fully realize.