Organizations’ drive toward continuous innovation, agility, and scalability is supported by the increased rate of adoption of microservices. However, do all microservices adoption initiatives become successful?Lot of times, when an enterprise adopts microservices, it ends up having multiple monolithic applications that complicate the entire system. Below are the 10 areas where an enterprise should pay extra attention in order to achieve success with microservices adoption.
1. Security
Security is one of the most important aspects to look at while designing the microservices architecture. Security solutions should ensure that the API Gateway is used by secured microservices, and should be capable enough to handle authentication and authorization of the external/internal callers through the microservices level. Though there are many ways to do this,a delegated authorization (OAUTH) model along with tokens is considered the most efficient and scalable solution for authentication and authorization of callers through microservices.
The delegation authorization service (OAUTH) can be used to share permissions across microservices.
2. Services communication and design
A robust and efficient interface between services is often a struggle during microservices implementation and more critical when multiple services communicate with each other for completing a single transaction. The solution to this challenge lies in the informed decision one makes during the microservices architecture design phase whether to follow a point-to-point (synchronous) approach or asynchronous approach.
Asynchronous messaging wins over synchronous messaging in terms of decoupling, isolation, responsiveness, load leveling, and workflows. It enables communication even when there is no receiver, unlike synchronous workflow, which holds the requests until it receives a response. It is best suited for communication between distributed systems where there is intermittent increase in traffic loads.
3. Data consistency
One of the challenging things in an enterprise is maintaining data consistency across business lines. Microservices architectural design plays a vital role in ensuring consistent data flow across applications regardless of the volume of transactions. Enforcing architecture principles such as avoiding 2 phase commit in a distributed transaction and adopting SAGA pattern with appropriate service operations for rollback etc. are some of the best practices.
4. Service discovery and service catalogue
Gone are the days of storing service locations statically in a configuration or property file and amending them whenever there is a change in the location. In a microservices adopted architecture,auto-scaling is enabled in order to meet business needs. This brings in a bit of complexity in locating the services on a network. To have a robust service discovery model, it is important to have a 24x7 available service catalogue/registry configured to hold the service locations.
5. Fault tolerance
When the number of microservices and the volume of transactions among them increase, it is possible that one service failure can influence the failure of the entire process. Fault tolerance should be a mandate in microservices architecture design and this can be adopted in multiple ways. One of them is by enabling a circuit breaker, which restricts calling resources when it detects a service failure. Another way is through custom codes, which cautiously fail the services when they are not obtainable.
6. DevOps
Enterprises are facing the following key challenges while implementing business functionalities to cope with the market, which is agile and dynamic in nature.
Business level
A one-stop solution here is to design and implement a strong DevOps pipeline and container-based architecture, which makes the deployment process easy.
7. Distributed logging&debugging:
With microservices-based architecture in place, business functions and processes are split into microservices that are distributed across the technology landscape. This makes centralized logging a bit challenging and eventually affects end-to-end visibility, analysis and debugging of transactions and processes.This calls for the need to have a robust transactions logging design in place and leveraging the advantage of single logging features of available products.
8. Tech proliferation
Though we see many benefits of microservices-based solutions, they also increase the implementation complexity due to the rise in the number of tools/technologies. A Solution Architect plays a key role here by having to choose the right product for microservices adoption. Below are the parameters a Solution Architect should look at while choosing the product and design:
9. Testing
At times, we run into several challenges in microservices testing. Traditionally, we launch a single WAR file through which we ensure backend connectivity with underlying systems, databases, etc. However, this does not hold well for microservices because of the level granularity and increase in the number of services. Unit testing works well for services with well-defined boundaries. In the case of microservices, it is very tough to define such boundaries and test.
Therefore, robust integration testing which is independent of the service behavior with a focus on service intercommunication will help. E.g., Introduction of a new service will require compatibility testing to ensure seamless business operations. Testing automation and service virtualization can also enable effective microservices testing.
10. Monitoring & performance
The primary goal of adopting microservices architecture style is to achieve high performance, reliability, scalability and observability. This forces organizations to have a robust monitoring system. Monitoring of hosted platform and services (distributed), and APIs should be in sync with the organization structure.
Most of the PaaS product vendors provide necessary enterprise capabilities (such as monitoring, logging, and discovery) which are to be leveraged appropriately. One should design the monitoring component in such a way that microservices should either push metrics or enable their metrics via pull interfaces to provide real-time statistics. This enables us to observe the overall system’s health and help in defining scaling rules. Observability relies on logs, matrices, events etc., which helps us to understand the service controls across the enterprise though it does not have the insight of others.
In a nutshell, enterprises adopting microservices can get it right by meticulously managing the above mentioned parameters with technology standards and best practices.
Industry :
Venkiteswaran Perumal
Managing Consultant, Wipro
Venki has over 19 years of experience working at every phase of the software development lifecycle specifically in the areas of enterprise application, B2B, API and microservices integration. He is involved in business consultation and delivery of mission-critical integration programs that enable systems to handle a large number of business partners and complex data for global clients across industry domains.