Have you ever faced challenges while decoupling Microservices in cross team setup and wondered how to foster resiliency?

Have you ever faced challenges while decoupling Microservices in cross team setup and wondered how to foster resiliency?

While handling an outage situation a while back, realized how API driven inter-team/inter-service dependency is causing so many challenges to handle data sync issues & cascading failures and creating a need for having separate reconciliation reports generated/reviewed/actioned on daily basis. What a support nightmare! Given the widespread need to build APIs day-in and day-out, I looked back on my learnings, to sought to uncover the best practices that would steer me towards creating a futuristic solution.

In the ever-evolving corporate landscape, dedicated teams tackle specialized domains like supply chain, marketing, and finance, utilizing microservices to exchange vital data. However, as organizations scale, these siloed teams obstruct communication and impede innovation. To address this issue, many companies opt for cross-silo teams, bringing together experts from different domains for improved collaboration.

However, it's essential to recognize that this approach doesn't always provide a complete solution. When teams are tightly interdependent, even cross-silo teams can only tackle so much. In the event of failure, it can lead to cascading issues, trapping everyone in a frustrating deadlock and wasting precious working hours.

Absolutely! There will always be dependencies, but fortunately, there are several paradigms that enable decoupling between microservices and cross-silo teams. These approaches allow us to isolate affected services while keeping the rest operational:

  1. Design-first approach: Here focus is to design the API contract first. When designing microservices and cross-silo teams, consider decoupling from the start to simplify implementation and maintenance. There is nothing wrong with this approach and shows focus on having right team structure defined from day 1. This is not an easy way but it's worth the effort.
  2. Test-driven approach: Here focus is on building the testable silo-ed solutions first in an iterative approach. It ensures that the decoupled system remains easily testable, even after modifications. Code first approach has worked traditionally, but taking it a step further and making it test-driven first works even better in growing organizations.

No alt text provided for this image
Comparing the two approaches


(see comments for reference links)

Google Maps APIs, for instance, are so widely used for various partners, such contracts have to be thought holistically. To put these paradigms into action, we can employ the following practices and technologies:

  • Well-defined APIs: Clearly define and document APIs to facilitate seamless communication between microservices. Have API Versioning to maintain older API versions with consistent output formats, ensuring other teams can revert if needed.
  • Asynchronous communication in Apps: Enable microservices to communicate without blocking one another through asynchronous communication.
  • Event-driven architecture: Instead of API approach, one of the solution I plan to implement is to switch to use an event-driven approach to allow microservices to communicate by sending events to each other.
  • Use a message broker: Implementing a message broker reduces dependencies, providing a central location for microservices to relay data. Some examples of message brokers include Apache Kafka or RabbitMQ.

Embracing these practices proves highly advantageous as they foster greater independence for each microservice. While it's essential to acknowledge that a failure in one microservice can impact directly dependent downstream tasks, implementing decoupling strategies significantly improves the situation. By doing so, microservices become more adept at handling such cases, ensuring that the application remains operational—either fully or partially—even in the face of challenges. This robust approach creates a blue print of a more resilient and reliable system overall.

#microservices #decoupling #resilence

要查看或添加评论,请登录

Piyush Porwal的更多文章

社区洞察

其他会员也浏览了