Several years, monolithic architecture has been the widely-used architecture for building the web and mobile applications. These applications were mostly characterized by individual programs handling multiple functionalities. Though monolithic applications were known for easier to operate, as the systems grow bigger, they introduced complexity for both coding and deployment stages of software development life cycle. Single point of failure, technology lock-in, and limited scalability are few other drawbacks of monolithic applications.
In the recent past, microservice architecture has been evolved as a paradigm shift in decomposing large monolithic applications into smaller manageable pieces having its own code base and deployment infrastructure. Considering practical business applications, multiple microservices are required to fulfill one single use case, still we can describe microservices as simple and stateless.
In a microservices world, business requirements are divided into independent features and each of them is built as individual services that are loosely coupled when deployed in separate containers. So microservices are quicker to build and deploy, especially when they are packaged in containers. Microservices can be implemented as small feature as possible, making it easier for releasing changes without disturbing other parts of the application.
Since services interact over technology agnostic protocols like HTTP, applications could use mix of technologies that are most suitable for a service. Microservices introduce multiple benefits to applications, like high availability, better flexibility and responsiveness, however, service level independent scalability has been considered as the most value adding advantage for choosing microservices architecture for applications.
Microservices adoption was costly at IT operational level, this was mainly due to the cost incurred for deployment, load balancing, process monitoring and scalability to be established for each of the services. But today, platforms like Docker (Container as a service) and Kubernetes (Container Orchestrator) are providing these features as part of their platform. These platforms aided microservices to be easily scalable, hence making it the hot architecture choice for applications.
Just because Microservices is the new buzzword in the industry, doesn’t mean that it has no challenges. Here are few of the challenges for adopting microservices architecture.Microservices use HTTP as the protocol for synchronous communication and multiple service endpoints give hackers more opportunities for system penetration. Hence it is a challenge to secure microservices based applications with proper authentication and authorization methods. Solutions like Amazon’s AWS API Gateway (single entry point for all requests) is probably the most optimized method for securing microservices.Another challenge is Monitoring and debugging of microservices running in a multi-node environment. Distributed tracing solutions from Twittter (ZipKin) and Google (Dapper) have inspired several monitoring solutions for microservices. Opentracing, developed by Uber, Apple, Yelp and various other big players, is rapidly becoming the de facto standard for microservices tracing. Such tracing tools are capable of tracing microservices across multiple systems to view service maps and identify bottlenecks. Recently announced AWS X-ray by Amazon seems to be a good choice for monitoring applications running on Amazon cloud infrastructure.\nContrary to monolithic applications,deploying microservices application is a challenge as there will be multiple services written in a variety of languages and frameworks. The best way to deploy microservices-based applications is inside containers. Serverless technologies like AWS Lambda reduce the deployment complexities by running enough instances of the services to handle requests on demand. In this case, deployment is as simple as uploading the package as a zip file along with metadata, Lambda will take care of the rest.
In summary, applications built using microservices have benefits of strong module boundary, independent scalability and technology diversity. Though architecture imposes challenges, microservice adoption can be a highly beneficial experience for organizations provided the right tools and solutions are used to address the operational and security complexities.