Welcome to our new episode on technology on Micro-services. Although the terminology not new, but the terminology is used more frequently in the last 3-4 years. Developers and thought-leaders in this domain lay more emphasis on Micro-services. At first we will talk about Micro-Services and its application in Multiple Industries.
What is microservices?
According to Chris Richardson Microservices is an architectural style that structures an application as a collection of services that are
- Highly maintainable and testable
- Loosely coupled
- Independently deployable
- Organized around business capabilities
The microservice architecture enables the continuous delivery/deployment of large, complex applications. It also enables an organization to evolve its technology stack. The central idea behind microservices is that some types of applications become easier to build and maintain when they are broken down into smaller, composable pieces which work together. Each component is continuously developed and separately maintained, and the application is then simply the sum of its constituent components. This is in contrast to a traditional, “monolithic” application which is all developed all in one piece.
Applications built as a set of modular components are easier to understand, easier to test, and most importantly easier to maintain over the life of the application. It enables organizations to achieve much higher agility and be able to vastly improve the time it takes to get working improvements to production. This approach has proven to be superior, especially for large enterprise applications which are developed by teams of geographically and culturally diverse developers.
The benefits of micro-services are as follows:
- Developer independence: Small teams work in parallel and can iterate faster than large teams.
- Isolation and resilience: If a component dies, you spin up another while and the rest of the application continues to function.
- Scalability: Smaller components take up fewer resources and can be scaled to meet increasing demand of that component only.
- Lifecycle automation: Individual components are easier to fit into continuous delivery pipelines and complex deployment scenarios not possible with monoliths.
- Relationship to the business: Microservice architectures are split along business domain boundaries, increasing independence and understanding across the organization.
The common definition of microservices generally relies upon each microservice providing an API endpoint, often but not always a stateless REST API which can be accessed over HTTP(S) just like a standard web page. This method for accessing microservices make them easy for developers to consume as they only require tools and methods many developers are already familiar with.
- Different clients from different devices try to use different services like search, build, configure and other management capabilities
- All the services are separated based on their domains and functionalities and are further allotted to individual microservices
- These microservices have their own load balancer and execution environment to execute their functionalities & at the same time captures data in their own databases
- All the microservices communicate with each other through a stateless server which is either RESTor Message Bus
- Microservices know their path of communication with the help of Service Discovery and perform operational capabilities such as automation, monitoring
- Then all the functionalities performed by microservices are communicated to clients via API Gateway
- All the internal points are connected from the API Gateway. So, anybody who connects to the API Gateway automatically gets connected to the complete system
- Decoupling – Services within a system are largely decoupled. So the application as a whole can be easily built, altered, and scaled
- Componentization – Microservices are treated as independent components that can be easily replaced and upgraded
- Business Capabilities – Microservices are very simple and focus on a single capability
- Autonomy – Developers and teams can work independently of each other, thus increasing speed
- Continous Delivery – Allows frequent releases of software, through systematic automation of software creation, testing, and approval
- Responsibility – Microservices do not focus on applications as projects. Instead, they treat applications as products for which they are responsible
- Decentralized Governance – The focus is on using the right tool for the right job. That means there is no standardized pattern or any technology pattern. Developers have the freedom to choose the best useful tools to solve their problems
- Agility – Microservices support agile development. Any new feature can be quickly developed and discarded again
- Independent Development – All microservices can be easily developed based on their individual functionality
- Independent Deployment – Based on their services, they can be individually deployed in any application
- Fault Isolation – Even if one service of the application does not work, the system still continues to function
- Mixed Technology Stack – Different languages and technologies can be used to build different services of the same application
- Granular Scaling – Individual components can scale as per need, there is no need to scale all components together
Microservices and Open Source Relation:
When you design your applications from the ground up to be modular and composable, it allows you to use drop-in components in many places where in the past you may have required proprietary solutions, either because the licensing of the components, or specialized requirements. Many application components can be off-the-shelf open source tools, and there are myriad open source projects that implement cross-cutting requirements of microservice architectures such as authentication, service discovery, logging and monitoring, load balancing, scaling, and several more.
A focus on microservices may also make it easier for application developers to offer alternative interfaces to your applications. When everything is an API, communications between application components become standardized. All a component has to do to make use of your application and data is to be able to authenticate and communicate across those standard APIs. This allows both those inside and, when appropriate, outside your organization to easily develop new ways to utilize your application’s data and services.