Pros and Cons of Microservices – The Trending Business Architecture
What is Microservices?
A microservices architecture is a suite of small, autonomous services which are independently self-contained and implemented to a single business capability.
• Services can be deployed independently. A team can update an existing service without rebuilding and redeploying the entire application.
• Services are responsible for persisting their own data or external state. This differs from the traditional model, where a separate data layer handles data persistence.
• Services communicate with each other by using well-defined APIs. Internal implementation details of each service are hidden from other services.
• Services don’t need to share the same technology stack, libraries, or frameworks.
What’s special about Microservices?
• Agility: These independently deployable services can be easily managed mainly during bug fixes and feature releases. Unlike traditional application, the service can be updated without redeploying the entire application.
• Small, focused teams: The microservices have short development cycles, which can be managed by a small development team eliminating dependency between teams that helps in promoting greater agility and increase productivity.
• Small code base: Each service is a separate code-base, that in turn minimizes dependencies, and that makes it easier to add new features.
• Mix of technologies: Teams can pick the technology that best fits their service, using a mix of technology stacks as appropriate.
• Scalability: Services can be scaled independently, letting you scale out subsystems that require more resources, without scaling out the entire application. Using an orchestrator such as Kubernetes or Service Fabric, you can pack a higher density of services onto a single host, which allows for more efficient utilization of resources.
• Data isolation: Contrast to monolithic applications, the schema updates can be easily updated without affecting the other parts of the application.
What are the Stumbling blocks in Microservices Architecture Integration?
The benefits of microservices don’t come for free. Here are some of the challenges to consider before embarking on a micro services architecture.
• Complexity: A microservices application has more moving parts than the equivalent monolithic application. Each service is simpler, but the entire system as a whole is more complex.
• Development and testing: Due to different runtime environment, each service requires individualized testing and monitoring, which means organizations have to consider automation tools.
• Lack of governance: The decentralized approach leads to the inclusion of different languages and frameworks, which in turn makes the maintenance difficult.
What is an API gateway?
The API gateway is the entry point for clients. Instead of calling services directly, clients call the API gateway, which forwards the call to the appropriate services on the back end.
Pros and Cons of using an API gateway include:
• It decouples clients from services. Services can be version-ed or re-factored without needing to update all of the clients.
• Services can use messaging protocols that are not web friendly, such as AMQP.
• The API Gateway can perform other cross-cutting functions such as authentication, logging, SSL termination, and load balancing.
• Complexity in client code as the track of multiple endpoints, and handle failures in a resilient way is difficult.
• A single operation might require calls to multiple services. That can result in multiple network round trips between the client and the server, adding significant latency.
• Each public-facing service must handle concerns such as authentication, SSL, and client rate limiting.
• Services must expose a client-friendly protocol such as HTTP or Web Socket.
• Services with public endpoints are a potential attack surface, and must be hardened.
To get further insights, talk to our experts at +1(415) 233-4737 or reach us at email@example.com for a free consulting.